From: Paul Koning <pkoning@equallogic.com>
To: drow@false.org
Cc: eliz@gnu.org, ghost@cs.msu.su, gdb@sources.redhat.com
Subject: Re: MI: reporting of multiple breakpoints
Date: Fri, 17 Feb 2006 21:56:00 -0000 [thread overview]
Message-ID: <17398.16942.92466.13879@gargle.gargle.HOWL> (raw)
In-Reply-To: <20060217211942.GA609@nevyn.them.org>
>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:
Daniel> No, this is not the opposite of what I described; could you
Daniel> explain why you think it is? It's indistinguishable from
Daniel> what I described. If we set the PC to the PC of the
Daniel> breakpoint, we assume we are past (have already hit) the
Daniel> breakpoint. Therefore when we're stopped by a watchpoint at
Daniel> the PC of a breakpoint, it's sensible to treat this situation
Daniel> to the user as if we have already hit the breakpoint.
You talked about a case where a user sets $pc. That doesn't show up
in my discussion at all. The program is just running, and hits a
watchpoint triggered by an action in source line 421. It is really a
bad idea to pretend that we've stopped at a breakpoint on line 422.
The fact that some hardware may take the exception with PC pointing at
422 is not a valid reason to do otherwise. It's conceivable that it's
unavoidable, if the hardware doesn't distinguish watchpoint from
breakpoint exceptions. But, for example, on MIPS the two are
distinct. So if I get a watch exception at PC 0x12340, I know that
the instruction that caused the watch is 0x1233c, which is line 421,
so that's what should be reported.
The instruction that caused the exception is NOT the break, first of
all because it's at 0x12340 which is not the instruction address that
caused the exception, and second because the exception type (watch
exception) cannot be produced by a break instruction.
Daniel> What I'm maintaining is that we shouldn't "sort this out".
Daniel> What we display should be, IMO, all the events which we
Daniel> consider to have logically occurred in the current
Daniel> conditions. The value of a watchpoint has changed since we
Daniel> last checked it? Report the watchpoint. We've reached the
Daniel> PC of a breakpoint? Report the breakpoint.
Daniel> What you're suggesting would have two stops at identical PC
Daniel> values. You'd want to say continue and have GDB stop again,
Daniel> right away, without executing any instructions. I'd find
Daniel> that much more confusing!
Maybe you find it confusing because you're trying to reason about this
at the machine code level. Look at the source line level instead.
If you watch foo, you should be told about watchpoint stops at lines
that touch foo. You should not be told about breaks in other lines.
If you hit at watchpoint in line 421, and you continue, and you had
defined a breakpoint in line 422, you would expect that breakpoint to
fire because 422 != 421.
For that matter, if you do this, then in fact you DID execute one
instruction, namely the break instruction. Also, if you recognize
that watch exceptions are caused by the instruction at PC-size, and
break instructions are caused by the instruction at PC, it all makes
even more sense -- the triggering instruction is NOT the same, and if
you take BOTH the exception type AND the exception PC into account in
the analysis, you will get the correct answer.
As far as I remember from the break/watch analysis code, this is all
perfectly doable, even if it isn't the way it's currently coded.
paul
next prev parent reply other threads:[~2006-02-17 21:37 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-17 15:32 Vladimir Prus
2006-02-17 15:48 ` Daniel Jacobowitz
2006-02-17 16:04 ` Vladimir Prus
2006-02-17 18:59 ` Daniel Jacobowitz
2006-02-17 19:04 ` Daniel Jacobowitz
2006-02-17 19:52 ` Eli Zaretskii
2006-02-17 19:54 ` Daniel Jacobowitz
2006-02-17 19:59 ` Eli Zaretskii
2006-02-17 20:06 ` Paul Koning
2006-02-17 20:08 ` Daniel Jacobowitz
2006-02-17 20:16 ` Eli Zaretskii
2006-02-17 20:19 ` Daniel Jacobowitz
2006-02-17 20:18 ` Paul Koning
2006-02-17 20:24 ` Daniel Jacobowitz
2006-02-17 21:37 ` Paul Koning
2006-02-17 21:43 ` Daniel Jacobowitz
2006-02-17 21:56 ` Paul Koning [this message]
2006-02-17 22:12 ` Daniel Jacobowitz
2006-02-18 9:54 ` Paul Koning
2006-02-18 10:56 ` Daniel Jacobowitz
2006-02-18 15:47 ` Eli Zaretskii
2006-02-18 15:28 ` Eli Zaretskii
2006-02-18 17:28 ` Daniel Jacobowitz
2006-02-18 17:42 ` Eli Zaretskii
2006-02-18 17:50 ` Daniel Jacobowitz
2006-02-18 18:33 ` Eli Zaretskii
2006-02-19 18:20 ` Paul Koning
2006-02-19 18:31 ` Daniel Jacobowitz
2006-02-19 18:44 ` Robert Dewar
2006-02-20 3:16 ` Eli Zaretskii
2006-02-18 11:39 ` Eli Zaretskii
2006-02-19 18:19 ` Paul Koning
2006-02-19 18:38 ` Daniel Jacobowitz
2006-02-19 18:54 ` Paul Koning
2006-02-19 19:05 ` Robert Dewar
2006-02-19 19:30 ` Paul Koning
2006-02-19 19:52 ` Daniel Jacobowitz
2006-02-19 19:57 ` Paul Koning
2006-02-19 21:55 ` Eli Zaretskii
2006-02-20 4:33 ` Daniel Jacobowitz
2006-02-20 7:25 ` Eli Zaretskii
2006-02-20 18:20 ` Daniel Jacobowitz
2006-02-17 20:14 ` Eli Zaretskii
2006-02-17 20:08 ` Daniel Jacobowitz
2006-02-17 20:22 ` Eli Zaretskii
2006-02-17 20:31 ` Daniel Jacobowitz
2006-02-17 20:32 ` Eli Zaretskii
2006-02-17 20:41 ` Daniel Jacobowitz
2006-02-17 20:02 ` Eli Zaretskii
2006-02-17 20:15 ` Daniel Jacobowitz
2006-02-17 19:36 ` Eli Zaretskii
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=17398.16942.92466.13879@gargle.gargle.HOWL \
--to=pkoning@equallogic.com \
--cc=drow@false.org \
--cc=eliz@gnu.org \
--cc=gdb@sources.redhat.com \
--cc=ghost@cs.msu.su \
/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