public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Reuben Thomas <rrt@sc3d.org>
To: Reuben Thomas via Gdb <gdb@sourceware.org>
Subject: Remote protocol question: the documentation says '?' is not required,  but maybe it is?
Date: Sun, 19 Jul 2020 20:08:47 +0100	[thread overview]
Message-ID: <CAOnWdohGHQ_vnfkAagGacXKLGsLYcfgJCLxqZWOoqh5G=0SdmA@mail.gmail.com> (raw)

In the GDB manual, section E.1 Overview about the Remote Protocol, there is
the following text:

At a minimum, a stub is required to support the ‘g’ and ‘G’ commands for
> register access, and the ‘m’ and ‘M’ commands for memory access. Stubs
> that only control single-threaded targets can implement run control with
> the ‘c’ (continue), and ‘s’ (step) commands. Stubs that support
> multi-threading targets should support the ‘vCont’ command. All other
> commands are optional.
>

In particular, this suggests that it is not necessary to support the '?'
command, which returns the most recent signal.

My simple remote stub indeed implements only 'g', 'G', 'm', 'M', 'c', 'd'
and 'k'. It also implements '?', and, on startup, sends a 'T' packet.

However, if I remove the implementation of '?', the following conversation
ensues with gdb:

putpacket:
> T0500:f4dff800;01:f4dff800;02:00400000;03:f580a200;04:00001000;05:00000000;06:f5805200;07:00001000;08:00000000;09:ffffffff;
> getpacket:
> qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+
> putpacket:
> getpacket: vMustReplyEmpty
> putpacket:
> getpacket: Hg0
> putpacket:
> getpacket: qTStatus
> putpacket:
> getpacket: ?
> putpacket:
> getpacket: qfThreadInfo
> putpacket:
> getpacket: qL1160000000000000000
> putpacket:
> getpacket: Hc-1
> putpacket:
> getpacket: qC
> putpacket:
> getpacket: qAttached
> putpacket:
> warning: Invalid remote reply:
>

and GDB hangs. It seems that it can't cope with my lack of reply to '?'.

Is this a bug in gdb, or should the documentation be updated? I'm using gdb
from recent master, commit 360f1cd72d; I have patched it to support my
architecture, but I've not touched remote.c or anything else to do with the
remote protocol.

On the other hand, as you can see from my list above, I do not implement
the 's' command, but this does not seem to be a problem. Again, is this an
error in the documentation?

-- 
https://rrt.sc3d.org

             reply	other threads:[~2020-07-19 19:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-19 19:08 Reuben Thomas [this message]
2020-07-21 10:22 ` Christo Crause
2020-07-21 10:29   ` Reuben Thomas
2020-07-21 11:33     ` Maciej W. Rozycki
2020-07-21 16:35       ` Christo Crause
2020-07-21 18:51       ` Reuben Thomas
2020-07-21 19:34         ` Maciej W. Rozycki
2020-07-21 20:24           ` Reuben Thomas
2020-07-21 20:26             ` Reuben Thomas
2020-07-21 20:48               ` Reuben Thomas
2020-07-21 21:19                 ` Maciej W. Rozycki
2020-07-21 21:23                   ` Reuben Thomas

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='CAOnWdohGHQ_vnfkAagGacXKLGsLYcfgJCLxqZWOoqh5G=0SdmA@mail.gmail.com' \
    --to=rrt@sc3d.org \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).