This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Watching complex expressions patch


> >    if you have a struct  t { int a,b,c;}> and you set a watch to t.c
> > you only want to get stopped if t.c changes not if t.a or t.b
> > changes but currently using the VALUE_LAZY seems to be quite unsure
> >   On  go32 target,
> > the code wanted to watch first t.c and then this entire t struct
> > and that is wrong of course !

> You are quite right!
> This problem is not limited to go32, I think it is general.
> I will review your patch, and if it really fixes this problem
> I will be very happy.

Sorry, guys, I don't quite understand what are you talking about.  I
just tried a simple program that declares "struct { int a, b, c; } t;"
and then assigns values to some of its members.  I can watch each and
every struct member individually and the entire struct as a whole,
with hardware-assisted watchpoints, and I don't have any false
alarms.  In particular, I never saw GDB trying to watch the entire
struct unless I told so.

Of course, it could be that the patches I posted today (see my message
Re: Hardware watchpoints for bitfields) solve the above problem as
well, since they force GDB to *never* watch structs and arrays, unless
the user actually says so (in which case the struct will appear at
the head of the value chain).  If so, my patches might be less scary
because they don't make any drastic changes in the logic used by GDB
to watch expressions.  YMMV.

So could you please post a simple test program and a GDB session that
exhibit the problem?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]