public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* warning: garbage in qC reply
@ 2018-11-19 16:34 Mathieu Tarral
  2018-11-19 17:04 ` Emiliano Testa
  0 siblings, 1 reply; 2+ messages in thread
From: Mathieu Tarral @ 2018-11-19 16:34 UTC (permalink / raw)
  To: gdb

Hi,

I'm writing a new GDB stub in Python, and while implementing
each command that is sent to me by the GDB client during
the attach phase, I'm facing an issue with the qC command:

GDB is asking me to set the current thread-id to -1, with Hc-1
and immediately after it query the current thread id, with qC
I return -1 with QC-1, and I get a warning:

Sending packet: $Hc-1#09...Ack
Packet received: OK
Sending packet: $qC#b4...Ack
Packet received: QC-1
warning: garbage in qC reply

Is -1 an invalid thread-id syntax for qC ?

Thanks !
--
Mathieu Tarral

Sent with ProtonMail Secure Email.


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

* Re: warning: garbage in qC reply
  2018-11-19 16:34 warning: garbage in qC reply Mathieu Tarral
@ 2018-11-19 17:04 ` Emiliano Testa
  0 siblings, 0 replies; 2+ messages in thread
From: Emiliano Testa @ 2018-11-19 17:04 UTC (permalink / raw)
  To: mathieu.tarral; +Cc: gdb

Hi Mathieu,
GDB is asking you to apply the next continue or step command to all threads
when it sends Hc-1:

from:
https://sourceware.org/gdb/onlinedocs/gdb/Packets.html#thread_002did-syntax

"Several packets and replies include a thread-id field to identify a
thread. Normally these are positive numbers with a target-specific
interpretation, formatted as big-endian hex strings. A thread-id can also
be a literal ‘-1’ to indicate all threads, or ‘0’ to pick any thread. "

So when receiving the Qc command your stub should reply with the currently
selected thread id, not -1.

Hope this helps

Emiliano



On Mon, 19 Nov 2018 at 16:34, Mathieu Tarral <mathieu.tarral@protonmail.com>
wrote:

> Hi,
>
> I'm writing a new GDB stub in Python, and while implementing
> each command that is sent to me by the GDB client during
> the attach phase, I'm facing an issue with the qC command:
>
> GDB is asking me to set the current thread-id to -1, with Hc-1
> and immediately after it query the current thread id, with qC
> I return -1 with QC-1, and I get a warning:
>
> Sending packet: $Hc-1#09...Ack
> Packet received: OK
> Sending packet: $qC#b4...Ack
> Packet received: QC-1
> warning: garbage in qC reply
>
> Is -1 an invalid thread-id syntax for qC ?
>
> Thanks !
> --
> Mathieu Tarral
>
> Sent with ProtonMail Secure Email.
>
>
>

-- 
Emiliano Testa
Undo software engineer

22 Station Road
Cambridge
CB1 2JD
United Kingdom

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

end of thread, other threads:[~2018-11-19 17:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-19 16:34 warning: garbage in qC reply Mathieu Tarral
2018-11-19 17:04 ` Emiliano Testa

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