From 3a1115a0cc0a0a98555ba99df76ad9bcfee08759 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 2 Aug 2013 16:41:08 +0000 Subject: fix PR symtab/15719 This patch fixes PR symtab/15719. The bug is that "watch -location" crashes on a certain expression. The problem is that fetch_subexp_value is catching an exception. For ordinary watchpoints this is ok; but for location watchpoints, it is better for the exception to propagate. Built and regtested on x86-64 Fedora 18. New test case included. PR symtab/15719: * breakpoint.c (update_watchpoint, watchpoint_check) (watch_command_1): Update. * eval.c (fetch_subexp_value): Add "preserve_errors" parameter. * ppc-linux-nat.c (check_condition): Update. * value.h (fetch_subexp_value): Update. * gdb.base/watchpoint.c (struct foo5): New. (nullptr): New global. * gdb.base/watchpoint.exp (test_watch_location): Add test. --- gdb/testsuite/gdb.base/watchpoint.exp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gdb/testsuite/gdb.base/watchpoint.exp') diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp index e0f7adc..e0d4f81 100644 --- a/gdb/testsuite/gdb.base/watchpoint.exp +++ b/gdb/testsuite/gdb.base/watchpoint.exp @@ -603,6 +603,9 @@ proc test_watch_location {} { gdb_breakpoint [gdb_get_line_number "func5 breakpoint here"] gdb_continue_to_breakpoint "func5 breakpoint here" + gdb_test "watch -location nullptr->p->x" \ + "Cannot access memory at address 0x0" + gdb_test "watch -location *x" "atchpoint .*: .*" "watch -location .x" gdb_test "continue" \ -- cgit v1.1