public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Remote protocol question: the documentation says '?' is not required,  but maybe it is?
@ 2020-07-19 19:08 Reuben Thomas
  2020-07-21 10:22 ` Christo Crause
  0 siblings, 1 reply; 12+ messages in thread
From: Reuben Thomas @ 2020-07-19 19:08 UTC (permalink / raw)
  To: Reuben Thomas via Gdb

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-07-21 21:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-19 19:08 Remote protocol question: the documentation says '?' is not required, but maybe it is? Reuben Thomas
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

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