Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Christo Crause <christo.crause@gmail.com>
To: Reuben Thomas <rrt@sc3d.org>
Cc: Reuben Thomas via Gdb <gdb@sourceware.org>
Subject: Re: Remote protocol question: the documentation says '?' is not required, but maybe it is?
Date: Tue, 21 Jul 2020 12:22:20 +0200	[thread overview]
Message-ID: <CAGOmfbFWD=_KOpEuD1P=fow+A9fy_gCd1BxP46aMT2dQjXsiMw@mail.gmail.com> (raw)
In-Reply-To: <CAOnWdohGHQ_vnfkAagGacXKLGsLYcfgJCLxqZWOoqh5G=0SdmA@mail.gmail.com>

On Sun, Jul 19, 2020 at 9:09 PM Reuben Thomas via Gdb <gdb@sourceware.org>
wrote:

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

Reading E.3 suggests that the stop reply packet (S or T) is only expected
after gdb issued one of a few specific commands.  So my interpretation (I'm
no expert on the topic) is that your unsolicited T packet is confusing gdb.
It seems as if your debug log is from your gdbserver perspective, can you
also check the communication received on gdb side (set debug remote 1),
this may highlight the reply gdb is complaining about.


  reply	other threads:[~2020-07-21 10:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-19 19:08 Reuben Thomas
2020-07-21 10:22 ` Christo Crause [this message]
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='CAGOmfbFWD=_KOpEuD1P=fow+A9fy_gCd1BxP46aMT2dQjXsiMw@mail.gmail.com' \
    --to=christo.crause@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=rrt@sc3d.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