From: Daniel Jacobowitz <drow@mvista.com>
To: Eli Zaretskii <eliz@elta.co.il>, gdb-patches@sources.redhat.com
Subject: Re: RFC: Centralize DECR_PC_AFTER_BREAK handling from infrun
Date: Sat, 31 Jan 2004 17:49:00 -0000 [thread overview]
Message-ID: <20040131174949.GA5154@nevyn.them.org> (raw)
In-Reply-To: <20040118151909.GA17039@nevyn.them.org>
On Sun, Jan 18, 2004 at 10:19:10AM -0500, Daniel Jacobowitz wrote:
> > > + /* If we've hit a breakpoint, we'll be stopped with SIGTRAP. */
> > > + if (ecs->ws.kind != TARGET_WAITKIND_STOPPED)
> > > + return;
> > > +
> > > + if (ecs->ws.value.sig != TARGET_SIGNAL_TRAP)
> > > + return;
> >
> > The original code didn't check these conditions, right? So why add
> > them here? (Also, the comment doesn't seem to describe the two
> > tests, only the second one.)
>
> The comment does describe both tests; if != TARGET_WAITKIND_STOPPED,
> then we aren't stopped by a signal. The other waitkinds correspond to
> things like exiting and catchpoints, and with the exception of some
> complications in the FORKED/EXECD cases, stop_signal will not get set
> to SIGTRAP. Also, the original code did check these conditions, though
> somewhat indirectly:
>
> if (stop_signal == TARGET_SIGNAL_TRAP)
> {
> /* Check if a regular breakpoint has been hit before checking
> for a potential single step breakpoint. Otherwise, GDB will
> not see this breakpoint hit when stepping onto breakpoints. */
>
> Oh, hum, that's for the first set (thread hit thread-specific BP for a
> different thread). The second thread does this:
>
> if (stop_signal == TARGET_SIGNAL_TRAP
> || (breakpoints_inserted &&
> (stop_signal == TARGET_SIGNAL_ILL
> || stop_signal == TARGET_SIGNAL_EMT))
> || stop_soon == STOP_QUIETLY
> || stop_soon == STOP_QUIETLY_NO_SIGSTOP)
>
> The stop_soon's aren't relevant here, since they're handled before
> DECR_PC_AFTER_BREAK, but the ILL/EMT are relevant. They should be
> added to adjust_pc_after_break - thanks!
Actually, I'm not sure they should. The question is, on an operating
system such that hitting a breakpoint causes SIGILL, should
DECR_PC_AFTER_BREAK be applied? I don't have a machine such that
breakpoints cause SIGILL, but I tested x86 and alpha (both
DECR_PC_AFTER_BREAK targets). On x86 a SIGILL leaves the PC pointing
at the beginning of the illegal instruction, and on Alpha a SIGILL
leaves the PC pointing to the second instruction after the illegal one.
In neither case does that match the behavior of DECR_PC_AFTER_BREAK.
So this will become a comment also.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2004-01-31 17:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-17 22:20 Daniel Jacobowitz
2004-01-17 22:39 ` Andrew Cagney
2004-01-17 23:04 ` Daniel Jacobowitz
2004-01-18 7:05 ` Eli Zaretskii
2004-01-18 15:19 ` Daniel Jacobowitz
2004-01-18 17:27 ` Eli Zaretskii
2004-01-18 18:01 ` Andrew Cagney
2004-01-18 19:08 ` Eli Zaretskii
2004-01-31 17:51 ` Daniel Jacobowitz
2004-01-31 17:49 ` Daniel Jacobowitz [this message]
2004-01-22 14:09 ` Andrew Cagney
2004-01-22 22:34 ` Daniel Jacobowitz
2004-01-31 19:19 ` Daniel Jacobowitz
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=20040131174949.GA5154@nevyn.them.org \
--to=drow@mvista.com \
--cc=eliz@elta.co.il \
--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