Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Dave Korn <dave.korn.cygwin@googlemail.com>
Cc: gdb@sourceware.org
Subject: Re: Software-vs-hardware single-step vs. sim/non-sim targets.
Date: Fri, 04 Dec 2009 22:08:00 -0000	[thread overview]
Message-ID: <20091204220825.GA12336@caradoc.them.org> (raw)
In-Reply-To: <4B197BC0.5010708@gmail.com>

On Fri, Dec 04, 2009 at 09:14:40PM +0000, Dave Korn wrote:
>   So is there a way I can get gdb to use (simulated) hardware single stepping
> for the simulator target and software single stepping for the remote target?
> And dynamically switch when the target changes?  Or do I have to compile two
> different builds, only one of which sets the software single step method in
> the gdbarch?
> 
>   I'm trying not to do anything too hacky or break the architectural layering
> in GDB, but can I perhaps examine the current_target in my arch init function
> and frig the value of the single_step hook in the gdbarch that I either lookup
> or allocate before returning it?  Does the arch init function always get
> called when switching between targets or otherwise altering the layers in the
> stratum stack?

Answering the last question first, no, it does not necessarily get called.

There's no obvious easy solution to this, but the basic problem has
been discussed many times.  It's gotten more complicated since I last
thought about it, too, by the addition of support for software
stepping atomic sequences.  There are several mixed-up questions:

(SSS = software single-step; got tired of typing it.)

* Does my architecture code support SSS for anything?

* Does my architecture require SSS for the current instruction or
instruction sequence?

* Does my target support hardware single-step?

IMO the remote protocol hook you need is already present: implement
vCont, even though it's overkill for an embedded single-threaded
processor.  Report that you don't support s or S in the vCont? reply.

Current GDB will choke.  So you have to somehow separate the above
questions, so that when we ask the architecture whether to
single-step, it knows whether the target needs SSS or not.

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2009-12-04 22:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-04 20:58 Dave Korn
2009-12-04 22:08 ` Daniel Jacobowitz [this message]
2009-12-05  3:50   ` Dave Korn
2009-12-05  5:58     ` Daniel Jacobowitz
2009-12-05 21:12 ` Jakob Engblom

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=20091204220825.GA12336@caradoc.them.org \
    --to=drow@false.org \
    --cc=dave.korn.cygwin@googlemail.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