From: Vladimir Prus <ghost@cs.msu.su>
To: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Watchpoints + conditionals problem
Date: Thu, 29 Nov 2007 08:54:00 -0000 [thread overview]
Message-ID: <filumj$65b$1@ger.gmane.org> (raw)
In-Reply-To: <1196272755.15925.11.camel@gargoyle>
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
next prev parent reply other threads:[~2007-11-29 8:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-28 17:59 Luis Machado
2007-11-29 8:54 ` Vladimir Prus [this message]
2007-11-29 12:06 ` Luis Machado
2007-12-16 21:48 ` Daniel Jacobowitz
2007-12-17 11:35 ` Luis Machado
2007-12-17 12:36 ` Luis Machado
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='filumj$65b$1@ger.gmane.org' \
--to=ghost@cs.msu.su \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox