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
On Tue, Mar 03, 2009 at 09:18:02PM +0000, Antony KING wrote:
> struct {int m1, m2, m3, m4;} a;
> int main (void)
> {
> a.m1 = 1;
> return 0;
> }
>
> In both cases value_equal is comparing the address of the object and not
> the contents. This is caused, I believe, by the following code at the
> start of value_equal:
>
> arg1 = coerce_array (arg1);
> arg2 = coerce_array (arg2);
>
> which is converting the compound objects into pointers. These are then
> used in the latter tests of value_equal.
Arrays are supposed to be handled specially, but I was talking about
structs since that was in your original example. coerce_array has no
effect on structs.
--
Daniel Jacobowitz
CodeSourcery