Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Rishi Dixit <dixit_rishi@acmet.com>
Cc: Mailing List <gdb@sourceware.org>
Subject: Re: Resume from Breakpoint - Next Instruction Address or Target 	Address?
Date: Mon, 06 Feb 2006 23:47:00 -0000	[thread overview]
Message-ID: <20060206234711.GA523@nevyn.them.org> (raw)
In-Reply-To: <1138623528.3621.173.camel@rishidixit>

On Mon, Jan 30, 2006 at 05:48:48PM +0530, Rishi Dixit wrote:
> Hi,
> 
> 
> I am studying about breakpoint functionality in GDB. My study is local
> to the MIPS Simulator. While studying the GDB source, I was referring
> the handling of BREAK instruction. 
> 
> This handling checks for the presence of BREAK instruction in a delay
> slot and alters the Program Counter. However, this information is
> overwritten when the CPU registers are saved before triggering a
> Breakpoint exception. 
> 
> I suspected this would lead to a loss of information regarding the
> target address of jump/branch instruction. To confirm this, I made a
> test case and checked the GDB behavior. 

I don't know - you'd have to ask someone more familiar with the
architecture and the simulator - but I think this is a bug in either
the simulator or GDB; the architecture does provide enough information
to handle this case.  See the documentation of the BD bit in the Cause
register.

> My assumption is that since the breakpoint is hit after the jump/branch
> instruction has been executed, the resume should be from the target
> address. 

No, generally we want to resume where we were, not where we're going
to.  The resume should be back on the jump.  I have no idea if GDB
implements that.

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2006-02-06 23:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-30 20:16 Rishi Dixit
2006-02-06 23:47 ` Daniel Jacobowitz [this message]
2006-02-10 12:05   ` Rishi Dixit

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=20060206234711.GA523@nevyn.them.org \
    --to=drow@false.org \
    --cc=dixit_rishi@acmet.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