Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Dave Korn <dave.korn.cygwin@googlemail.com>
To: Dave Korn <dave.korn.cygwin@googlemail.com>, gdb@sourceware.org
Subject: Re: Software-vs-hardware single-step vs. sim/non-sim targets.
Date: Sat, 05 Dec 2009 03:50:00 -0000	[thread overview]
Message-ID: <4B19DC20.907@gmail.com> (raw)
In-Reply-To: <20091204220825.GA12336@caradoc.them.org>

Daniel Jacobowitz wrote:

[ out-of-order:
> There's no obvious easy solution to this, but the basic problem has
> been discussed many times.

  Sorry for making you go over old ground; it's not easy to get good search
results with terms as general as "hardware software single step gdb"; I
wouldn't be offended if you replied with just a couple of words for better
search terms or URLs to earlier threads. ]

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

> 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.

  Hmm, okay, so the arch doesn't get re-inited between detaching from one
target and attaching to the next.  But I'd bet (and I mean bet, I haven't
looked yet, but I can't imagine how the whole thing hangs together if it
doesn't work this way) that the infrun state machine does get thoroughly and
properly reset and all in-memory breakpoints restored during the
detach/reattach sequence.  So in theory it should all be ok if
gdbarch_software_single_step_p() returned different values dynamically, so
long as they're constant during any given run of the inferior.  Maybe it would
work to turn that into an arch hook, with a default that works like the
current version by simply testing if the single_step hook is set, but allow
for a dynamically-varying version to be installed by arches that choose.  I'll
look a bit at how well that would work.

  (Ah, gdbarch_software_single_step_p makes an instructive search term, there
seems to have been some discussion about what to do round the time when the
macro version got replaced by a hook.  Haven't yet found anything that looks
like a firm resolution to it though.)

    cheers,
      DaveK


  reply	other threads:[~2009-12-05  3:50 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
2009-12-05  3:50   ` Dave Korn [this message]
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=4B19DC20.907@gmail.com \
    --to=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