This patch augments watchpoint.c to check the BLOCK::VARIABLE syntax in watched expressions when it refers to local variables (and also to fix a small bug I found in the existing version of the file). However, as things stand, the test is not particularly stringent, since the relevant part is restricted to the hppa, sparc SunOS, and m32r platforms. I modified the restriction temporarily to check that the test now works on i686 Linux, but did not make that a part of the patch, since I think that someone who knows more about the reason for the restriction ought to decide whether it is time to remove it. First, fix a technical problem with the function recurser. The test sets a watch on local_x at a point where its value is technically undefined. The test is written assuming that the value is not initially 2, but nothing in the C standard guarantees that. Second, augment the existing test for variables in recursive calls to check an equivalent expression that explicitly sets the scope of the local variable being tracked. Paul N. Hilfinger (Hilfinger@adacore.com) 2012-01-07 Paul Hilfinger * gdb/testsuite/gdb.base/watchpoint.c (recurser): Initialize local_x. (main) Repeat recurser call. * gdb/testsuite/gdb.base/watchpoint.exp: Check that 'watch recurser::local_x' is equivalent to 'local_x'. --- gdb/testsuite/gdb.base/watchpoint.c | 8 +++++++- gdb/testsuite/gdb.base/watchpoint.exp | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 1 deletions(-)