Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Daniel Jacobowitz <drow@mvista.com>, Kevin Buettner <kevinb@redhat.com>
Cc: gdb@sources.redhat.com
Subject: Re: Is stub support for the 's' packet optional or required?
Date: Tue, 18 Feb 2003 21:03:00 -0000	[thread overview]
Message-ID: <3E52A0A7.5020104@redhat.com> (raw)
In-Reply-To: <20030218165140.GA17229@nevyn.them.org>

> On Tue, Feb 18, 2003 at 09:29:58AM -0700, Kevin Buettner wrote:
> 
>> On Feb 17,  9:04pm, Andrew Cagney wrote:
>> 
> 
>> > If GDB implements software single step, then the `s' packet is never
>> > used.  Consequently, requiring the unconditional implementation of "s"
>> > makes little sense.

Kevin wrote:

>> What about the situation where GDB implements software single step AND
>> the stub implements the 's' packet?  Shouldn't GDB at least attempt to
>> see if the stub supports the 's' packet before deciding to never send
>> it?

It should but the interaction is weird.  remote.c doesn't see the "" 
reply until target_wait() is called.  This means that the target_wait() 
method would need to be modified to handle this.  I guess it could 
record this and then return immedatly with a TARGET_WAITKIND_SPURIOUS. 
Kind of vaguely like how some of the other packets are handled.

But note, I'm guessing.  Just having commands to disable it would be a 
good first draft.

Oh, and yes.  I really have seen targets that neither had h/w single 
step nor had the space to implement s/w single step locally.

> In my humble opinion, SOFTWARE_SINGLE_STEP should affect native code
> and not remote;

No.  The relevant comments read:

# FIXME/cagney/2001-01-18: This should be split in two.  A target method 
that indicates if the target needs software single step.  An ISA method 
to implement it.
#
# FIXME/cagney/2001-01-18: This should be replaced with something that 
inserts breakpoints using the breakpoint system instead of blatting 
memory directly (as with rs6000).
#
# FIXME/cagney/2001-01-18: The logic is backwards.  It should be asking 
if the target can single step.  If not, then implement single step using 
breakpoints.

(All taken with a grain of salt.)

So, from the point of view of GDB's architecture, there is no difference.

 > I'm much too intimidated by the stop and resume logic
 > to actually change it myself, though.  If there were less global state
 > around infrun this might be easier.

Sigh.

>> [For remote MIPS/Linux targets, I've found some cases where GDB's
>> implementation of software singlestep causes some undesirable behavior
>> when doing the 'stepi' operation through some code that's hit by a number
>> of threads.  Yet, when software single step is implemented in the debug
>> agent (and disabled in GDB), the debugging behavior is much more useful
>> (and sensible).]
> 
> 
> Is it just slow, or do different things actually happen?

It is just very slow.

Andrew



  parent reply	other threads:[~2003-02-18 21:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-17 23:50 Kevin Buettner
2003-02-18  2:39 ` Andrew Cagney
2003-02-18 16:30   ` Kevin Buettner
2003-02-18 16:51     ` Daniel Jacobowitz
2003-02-18 20:06       ` Kevin Buettner
2003-02-18 20:23         ` Daniel Jacobowitz
2003-02-18 20:42           ` Kevin Buettner
2003-02-18 21:03       ` Andrew Cagney [this message]
2003-02-18 21:43         ` Kevin Buettner
2003-02-18 23:43           ` 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=3E52A0A7.5020104@redhat.com \
    --to=ac131313@redhat.com \
    --cc=drow@mvista.com \
    --cc=gdb@sources.redhat.com \
    --cc=kevinb@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