This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: [GDB 6.8] Problem using watchpoints with compound objects
- From: Daniel Jacobowitz <drow at false dot org>
- To: Antony KING <antony dot king at st dot com>
- Cc: gdb at sourceware dot org
- Date: Tue, 3 Mar 2009 15:33:09 -0500
- Subject: Re: [GDB 6.8] Problem using watchpoints with compound objects
- References: <49AD6B30.2010102@st.com>
On Tue, Mar 03, 2009 at 05:38:56PM +0000, Antony KING wrote:
> After applying the patch for problem 1 I then encountered a second
> problem where a watchpoint is being erroneously dismissed as being
> unchanged. I believe this problem is due to the following test in
> watchpoint_check():
>
> if (!value_equal (b->val, new_val))
>
> This test is only comparing the address of the object and not its
> contents. I think the test should be revised to the following:
What are you setting a watchpoint on? value_equal is an
implementation of the equality operator in the CLI. If you have a
pointer, it will only compare the addresses, but for a struct object
it should compare contents.
--
Daniel Jacobowitz
CodeSourcery