summaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorThiago Jung Bauermann <bauerman@br.ibm.com>2009-12-30 17:33:33 +0000
committerThiago Jung Bauermann <bauerman@br.ibm.com>2009-12-30 17:33:33 +0000
commitf48749608cbe3e5ea4da08c2b86ac575f9ba12cb (patch)
tree6957fa4ddb6399e3ee9aeef6fa7dc9cec23ee726 /gdb/breakpoint.c
parent94c0f1804049a742c977ebb024effd14ad08168b (diff)
downloadgdb-f48749608cbe3e5ea4da08c2b86ac575f9ba12cb.tar.gz
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.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index f041e647c0d..5c605422a5f 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)
{