From ccc57cf9e6782a19d8bccb1fdd0d02dd6ab98702 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 1 Jan 2009 22:02:03 +0000 Subject: 2009-01-01 Pedro Alves PR breakpoints/9681: * exceptions.h (enum errors): New error type, MEMORY_ERROR. * corefile.c (memory_error): Rewrite to throw a MEMORY_ERROR. * breakpoint.c (fetch_watchpoint_value): Ignore MEMORY_ERRORs, but retrow all other exceptions. 2009-01-01 Pedro Alves PR breakpoints/9681: * gdb.base/watchpoint.exp: Add regression test. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.base/watchpoint.exp | 12 ++++++++++++ 2 files changed, 17 insertions(+) (limited to 'gdb/testsuite') diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 7244a1d..3b9c4b4 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-01-01 Pedro Alves + + PR breakpoints/9681: + * gdb.base/watchpoint.exp: Add regression test. + 2008-12-31 Pedro Alves * gdb.threads/attach-into-signal.exp: Don't use diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp index 9935ef8..6557cba 100644 --- a/gdb/testsuite/gdb.base/watchpoint.exp +++ b/gdb/testsuite/gdb.base/watchpoint.exp @@ -649,6 +649,18 @@ proc test_inaccessible_watchpoint {} { # valid) memory. if [runto func4] then { + # Make sure we only allow memory access errors. + set msg "watchpoint refused to insert on nonexistent struct member" + gdb_test_multiple "watch struct1.nosuchmember" $msg { + -re ".*atchpoint \[0-9\]+: struct1.nosuchmember.*$gdb_prompt $" { + # PR breakpoints/9681 + fail $msg + } + -re "There is no member named nosuchmember\\..*$gdb_prompt $" { + pass $msg + } + } + gdb_test "watch *global_ptr" ".*atchpoint \[0-9\]+: \\*global_ptr" gdb_test "next" ".*global_ptr = buf.*" gdb_test_multiple "next" "next over ptr init" { -- cgit v1.1