Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Gareth McMullin <gareth@blacksphere.co.nz>
To: Michael Eager <eager@eagerm.com>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: Remote Serial Protocol -- reply to '?' when target running
Date: Tue, 09 Aug 2016 19:15:00 -0000	[thread overview]
Message-ID: <CAL8qUbravGiVaMO-kD9VHAa7j+riLoS7aKhi+3MweFqDhdJ6ag@mail.gmail.com> (raw)
In-Reply-To: <57AA13FC.2000707@eagerm.com>

On Wed, Aug 10, 2016 at 5:33 AM, Michael Eager <eager@eagerm.com> wrote:
>
> When gdb connects to a remote target, it asks about
> features, and then sends a '?' packet, asking why the
> target is stopped.  When the target connection is through
> a JTAG pod, the pod may be able to respond to the feature
> request, but not be able to determine what the current state of
> the target is, likely because it is not stopped.  What should a
> JTAG pod reply in this case?
>
> The GDB Remote Protocol doc doesn't seem to be entirely consistent.
>
> The description for '?' is
>   Indicate the reason the target halted. The reply is the
>   same as for step and continue.
>
> The description for Stop Reply Packet says the following:
>   The ‘C’, ‘c’, ‘S’, ‘s’, ‘vCont’, ‘vAttach’, ‘vRun’, ‘vStopped’,
>   and ‘?’ packets can receive any of the below as a reply. Except
>   for ‘?’ and ‘vStopped’, that reply is only returned when the
>   target halts.
>
> This suggests that the target can reply to '?' even if it is not
> stopped, which seems to contradict the description for '?'.  But
> none of the listed replies seem to be appropriate.  None of the
> replies look like "Don't bother me, I'm busy".
>
> How should the JTAG pod respond?  What do most do in this situation?

I can't comment on others, but the Black Magic debug project that I maintain [1]
implements the extended-remote prototcol, and initially responds to
'?' with 'W00' indicating
the target exited (there is no attached target).  The user initiates a
scan for connected
targets with 'monitor jtag_scan' from GDB, and then uses the GDB
'attach' command
to connect, sending the 'vAttach' packet.  This interrupts the target
and the reply comes
back as 'T05'.

[1] https://github.com/blacksphere/blackmagic


      parent reply	other threads:[~2016-08-09 19:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-09 17:34 Michael Eager
2016-08-09 18:41 ` taylor, david
     [not found]   ` <57AA2A19.2030509@eagerm.com>
2016-08-09 19:28     ` taylor, david
2016-08-09 19:33       ` Michael Eager
2016-08-09 19:15 ` Gareth McMullin [this message]

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=CAL8qUbravGiVaMO-kD9VHAa7j+riLoS7aKhi+3MweFqDhdJ6ag@mail.gmail.com \
    --to=gareth@blacksphere.co.nz \
    --cc=eager@eagerm.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