This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] pr11371 conditional watchpoints with a function in the condition.
- From: Chris Moller <cmoller at redhat dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Fri, 04 Jun 2010 13:24:05 -0400
- Subject: [patch] pr11371 conditional watchpoints with a function in the condition.
The description in this PR doesn't describe thing well--what's really
happening is that if the condition associated with a watchpoint
contained a function call, it resulted in a segfault. This patch fixes
that.
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.486
diff -u -r1.486 breakpoint.c
--- breakpoint.c 13 May 2010 22:44:02 -0000 1.486
+++ breakpoint.c 2 Jun 2010 19:39:12 -0000
@@ -1355,7 +1355,10 @@
/* We don't free locations. They are stored in bp_location array and
update_global_locations will eventually delete them and remove
breakpoints if needed. */
- b->loc = NULL;
+
+ if (b->type != bp_watchpoint && b->type != bp_hardware_watchpoint &&
+ b->enable_state != bp_call_disabled)
+ b->loc = NULL;
if (b->disposition == disp_del_at_next_stop)
return;
--- virgin.sum 2010-06-04 12:39:10.180908008 -0400
+++ patched.sum 2010-06-04 13:13:18.561033412 -0400
@@ -1,4 +1,4 @@
-Test Run By moller on Fri Jun 4 12:24:14 2010
+Test Run By moller on Fri Jun 4 13:05:22 2010
Native configuration is i686-pc-linux-gnu
=== gdb tests ===
@@ -6047,6 +6047,11 @@
PASS: gdb.base/pr11022.exp: breakpoint hit 2
PASS: gdb.base/pr11022.exp: set var x = 1
PASS: gdb.base/pr11022.exp: watchpoint hit 2
+Running ../../../src/gdb/testsuite/gdb.base/pr11371.exp ...
+PASS: gdb.base/pr11371.exp: watch aa if cond(aa)
+PASS: gdb.base/pr11371.exp: run to conditional watchpoint
+PASS: gdb.base/pr11371.exp: run to conditional watchpoint
+PASS: gdb.base/pr11371.exp: run to conditional watchpoint
Running ../../../src/gdb/testsuite/gdb.base/prelink.exp ...
PASS: gdb.base/prelink.exp: set verbose on
PASS: gdb.base/prelink.exp: prelink
@@ -14384,7 +14389,7 @@
Running ../../../src/gdb/testsuite/gdb.mi/mi2-console.exp ...
PASS: gdb.mi/mi2-console.exp: breakpoint at main
PASS: gdb.mi/mi2-console.exp: mi runto main
-FAIL: gdb.mi/mi2-console.exp: Started step over hello
+PASS: gdb.mi/mi2-console.exp: Started step over hello
KFAIL: gdb.mi/mi2-console.exp: Hello message (PRMS: gdb/623)
PASS: gdb.mi/mi2-console.exp: finished step over hello
Running ../../../src/gdb/testsuite/gdb.mi/mi2-disassemble.exp ...
@@ -16222,8 +16227,8 @@
PASS: gdb.threads/attachstop-mt.exp: attach4 to stopped switch thread
PASS: gdb.threads/attachstop-mt.exp: attach4 to stopped bt
PASS: gdb.threads/attachstop-mt.exp: continue (attach4 continue)
-PASS: gdb.threads/attachstop-mt.exp: attach4 stop by interrupt
-PASS: gdb.threads/attachstop-mt.exp: attach4, exit leaves process sleeping
+FAIL: gdb.threads/attachstop-mt.exp: attach4 stop by interrupt (timeout)
+FAIL: gdb.threads/attachstop-mt.exp: attach4, exit leaves process sleeping
Running ../../../src/gdb/testsuite/gdb.threads/bp_in_thread.exp ...
PASS: gdb.threads/bp_in_thread.exp: successfully compiled posix threads test case
PASS: gdb.threads/bp_in_thread.exp: breakpoint on noreturn
@@ -16542,7 +16547,7 @@
PASS: gdb.threads/schedlock.exp: step without lock does not change thread
PASS: gdb.threads/schedlock.exp: listed args (3)
PASS: gdb.threads/schedlock.exp: current thread stepped
-FAIL: gdb.threads/schedlock.exp: other threads ran - unlocked
+PASS: gdb.threads/schedlock.exp: other threads ran - unlocked
PASS: gdb.threads/schedlock.exp: set scheduler-locking on
PASS: gdb.threads/schedlock.exp: continue (with lock)
PASS: gdb.threads/schedlock.exp: stop all threads (with lock)
@@ -16753,7 +16758,7 @@
PASS: gdb.threads/watchthreads2.exp: all threads started
PASS: gdb.threads/watchthreads2.exp: watch x
PASS: gdb.threads/watchthreads2.exp: set var test_ready = 1
-KFAIL: gdb.threads/watchthreads2.exp: gdb can drop watchpoints in multithreaded app (PRMS: gdb/10116)
+PASS: gdb.threads/watchthreads2.exp: all threads incremented x
Running ../../../src/gdb/testsuite/gdb.trace/actions.exp ...
PASS: gdb.trace/actions.exp: 5.1a: set three tracepoints, no actions
PASS: gdb.trace/actions.exp: 5.1b: set actions for first tracepoint
@@ -17019,7 +17024,7 @@
=== gdb Summary ===
-# of expected passes 16154
+# of expected passes 16159
# of unexpected failures 31
# of expected failures 47
# of untested testcases 7