* 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.
This commit is contained in:
Thiago Jung Bauermann
2009-12-30 17:33:35 +00:00
parent 236f1d4def
commit 218d2fc650
7 changed files with 52 additions and 3 deletions

View File

@@ -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)
{