Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Orjan Friberg <orjan.friberg@axis.com>
To: gdb-patches@sources.redhat.com
Subject: STEP_SKIPS_DELAY question, sort of
Date: Fri, 21 May 2004 17:14:00 -0000	[thread overview]
Message-ID: <40AE38D0.7010204@axis.com> (raw)

I'm facing a problem with the CRIS target which is related to what 
STEP_SKIPS_DELAY is aiming to solve,.  The problem occurs when 
single-stepping past a breakpoint set on an instruction with a delay 
slot, because execution resumes at the instruction *preceding* the delay 
slot.  Here's an illustration of what happens:

0x0  ba foo  (branch instruction)
0x2  nop     (delay slot)
If there's a breakpoint (implemented in CRIS with a "break" instruction) 
at address 0x0, the following happens when single-stepping (hardware 
assisted):

(1) We end up in the delay slot at address 0x2.
(2) GDB re-inserts the break instruction at address 0x0.
(3) Execution resumes at address 0x0, and we hit the breakpoint again.
Besides STEP_SKIPS_DELAY having a fixed offset of 4 bytes between 
instruction and its associated delay slot, it's concerned with a 
breakpoint being set in the delay slot, which isn't the case here.

Basically, what I'm looking for is a way to say "don't re-insert a 
breakpoint on an instruction that's going to be restarted when we resume 
execution".  I'm thinking other architectures have faced similar issues, 
but I couldn't find anything.

(The alternatives I could think of are (1) fudging the address we report 
as being stopped at, to trick GDB into stepping one more time before 
re-insterting the breakpoint, or (2) automatically single-step past the 
delay slot (without reporting to GDB), both of which may be confusing 
for a user.)

--
Orjan Friberg
Axis Communications


             reply	other threads:[~2004-05-21 17:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-21 17:14 Orjan Friberg [this message]
2004-05-21 20:25 ` Andrew Cagney
2004-05-24  9:15   ` Orjan Friberg
2004-05-24 18:15     ` Andrew Cagney
2004-05-25 11:53       ` Orjan Friberg
2004-05-25 21:14         ` Andrew Cagney
2004-05-26  9:39           ` Orjan Friberg
2004-05-26 17:39             ` Andrew Cagney
2004-06-07 12:12             ` Orjan Friberg
2004-06-07 12:42               ` Orjan Friberg
2004-06-07 13:09                 ` Orjan Friberg
2004-06-07 15:08                   ` Andrew Cagney
2004-06-09  9:48                     ` Orjan Friberg
2004-06-09 16:00                       ` Andrew Cagney
2004-06-14 12:09                         ` Orjan Friberg
2004-06-16 14:53                           ` Orjan Friberg
2004-06-24 18:25                             ` Andrew Cagney
2004-10-01 11:26                         ` Orjan Friberg
2004-10-25 20:18                           ` Andrew Cagney

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=40AE38D0.7010204@axis.com \
    --to=orjan.friberg@axis.com \
    --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