From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: andrew.stubbs@st.com
Cc: mark.kettenis@xs4all.nl, gdb@sourceware.org
Subject: Re: Breakpoints in delay slots
Date: Sun, 22 Oct 2006 19:47:00 -0000 [thread overview]
Message-ID: <200610221947.k9MJlGAw011372@elgar.sibelius.xs4all.nl> (raw)
In-Reply-To: <45388BF9.90604@st.com> (message from Andrew STUBBS on Fri, 20 Oct 2006 09:42:33 +0100)
> Date: Fri, 20 Oct 2006 09:42:33 +0100
> From: Andrew STUBBS <andrew.stubbs@st.com>
>
> > My solution would be to emulate what MIPS does. So in the exception
> > handler for the illegal slot exception, check whether you've hit a
> > breakpoint. If so report SIGTRAP back to GDB and make sure that if
> > you get a continue from GDB, you back up the instruction pointer to
> > the branch instruction preceding the delay slot. This will require
> > you to implement sh_single_step_through_delay().
>
> How does one fix the problem that GDB doesn't associate the trap with
> the breakpoint? Not only will it tell the user there was an unexpected
> trap, ignore any conditions or commands, and show the source location as
> somewhere else, but it won't take any measures to avoid the breakpoint
> on the restart.
Ah, looks like I wasn't quite clear about this. You'll have your stub
(or OS kernel) report the address of the delay slot as where it
stopped (such that gdb will do the right thing for hitting the
breakpoint). But the stub will remember that it actually hit a
breakpoint in a delay slot. Later when gdb asks the stub to continue,
you make it back up to the address of the branch instruction before
you let it run again.
Mark
next prev parent reply other threads:[~2006-10-22 19:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-18 10:59 Andrew STUBBS
2006-10-18 14:04 ` Daniel Jacobowitz
2006-10-18 18:51 ` Michael Snyder
2006-10-19 9:52 ` Andrew STUBBS
2006-10-19 23:20 ` Michael Snyder
2006-10-19 19:51 ` Mark Kettenis
2006-10-20 8:42 ` Andrew STUBBS
2006-10-22 19:47 ` Mark Kettenis [this message]
2006-10-20 8:51 ` Andrew STUBBS
2006-10-20 14:26 ` Daniel Jacobowitz
2006-10-20 21:18 ` Jim Blandy
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=200610221947.k9MJlGAw011372@elgar.sibelius.xs4all.nl \
--to=mark.kettenis@xs4all.nl \
--cc=andrew.stubbs@st.com \
--cc=gdb@sourceware.org \
/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