diff options
author | Thiago Jung Bauermann <bauerman@br.ibm.com> | 2009-12-30 17:33:35 +0000 |
---|---|---|
committer | Thiago Jung Bauermann <bauerman@br.ibm.com> | 2009-12-30 17:33:35 +0000 |
commit | 218d2fc6506ec89b6ee03af89b4f23199f9fc8e9 (patch) | |
tree | 81f3c02f2cc8344f66870a074c9c5fdde8713ccb /gdb/breakpoint.c | |
parent | 236f1d4defb2070d3e43ce406604da7659860b38 (diff) | |
download | gdb-218d2fc6506ec89b6ee03af89b4f23199f9fc8e9.zip gdb-218d2fc6506ec89b6ee03af89b4f23199f9fc8e9.tar.gz gdb-218d2fc6506ec89b6ee03af89b4f23199f9fc8e9.tar.bz2 |
gdb/
* valarith.c (value_equal_contents): New function.
* value.h (value_equal_contents): Declare.
* breakpoint.c (watchpoint_check): Use value_equal_contents
instead of value_equal.
gdb/testsuite/
* gdb.base/watchpoint.exp (test_watchpoint_in_big_blob): New function.
(top level): Call test_watchpoint_in_big_blob.
* gdb.base/watchpoint.c (buf): Change size to value too big for hardware
watchpoints.
(func3): Write to buf.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r-- | gdb/breakpoint.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index f041e64..5c60542 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -3174,7 +3174,7 @@ watchpoints_triggered (struct target_waitstatus *ws) #define BP_TEMPFLAG 1 #define BP_HARDWAREFLAG 2 -/* Check watchpoint condition. */ +/* Evaluate watchpoint condition expression and check if its value changed. */ static int watchpoint_check (void *p) @@ -3245,8 +3245,12 @@ watchpoint_check (void *p) struct value *new_val; fetch_watchpoint_value (b->exp, &new_val, NULL, NULL); + + /* We use value_equal_contents instead of value_equal because the latter + coerces an array to a pointer, thus comparing just the address of the + array instead of its contents. This is not what we want. */ if ((b->val != NULL) != (new_val != NULL) - || (b->val != NULL && !value_equal (b->val, new_val))) + || (b->val != NULL && !value_equal_contents (b->val, new_val))) { if (new_val != NULL) { |