This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Watchpoints + conditionals problem
- From: Luis Machado <luisgpm at linux dot vnet dot ibm dot com>
- To: Vladimir Prus <ghost at cs dot msu dot su>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Thu, 29 Nov 2007 10:05:54 -0200
- Subject: Re: [PATCH] Watchpoints + conditionals problem
- References: <1196272755.15925.11.camel@gargoyle> <filumj$65b$1@ger.gmane.org>
- Reply-to: luisgpm at linux dot vnet dot ibm dot com
Thanks Vladimir,
Either way is fine with me. The simple fix or the alternate one.
Anybody has any comments?
Regards,
Luis
On Thu, 2007-11-29 at 11:53 +0300, Vladimir Prus wrote:
> Luis Machado wrote:
>
> > Hi folks,
> >
> > There is an unexpected behavior when we use software watchpoints (also
> > hardware in some cases) attached to conditional expressions, such as:
> > "watch x if x == <number>", considering "x" a simple "int" type
> > variable.
> >
> > When that watchpoint goes out of scope, it's marked for disposal at the
> > next stop as obviously there's no way to evaluate the expression "x"
> > anymore. But GDB is still trying to evaluate the conditional part of the
> > watchpoint, even though "x" is out of scope already. Thus, GDB is
> > failing to find correct frame information and ends up in an internal
> > error.
>
> I've run into same problem yesterday.
>
> > I've tracked down this issue and it seems we need to check for the
> > disposition field of the watchpoint whenever we check for the return
> > value of a conditional expression.
> >
> > Attached is a simple patch of what i have in mind to fix this issue. The
> > testcase can be a simple "Hello world"-like binary with a few variables
> > to watch.
> >
> > Any other ideas?
>
> I guess ideally we need to:
>
> 1. Don't check condition at all if bs->stop is already 0.
> 2. Immediately delete watchpoint, don't bother with del_at_next_stop
>
> But for now, your approach is probably fine -- can anybody approve it?
>
> - Volodya
>