This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: Watching complex expressions patch
Pierre Muller wrote:
>
> I think that the approach of VALUE_LAZY for the watchpoint is
> completely wrong !
>
> I propose here a patch that completely change the mecanism of
> which memory must be watched :
>
> 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.
> So my mecanism remembers the last memory that has been set a watch
> and after reject all watches of bigger memory regions including that
> memory !
Hmmm... I'm not sure that's really a valid approach.
What if the user deliberately says:
watch t.a
watch t
You might argue that is unnecessary, but we have
no reason to forbid it.