Re: warning: garbage in qC reply
Emiliano Testa <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <CAPpZKEzH9heLYRnfUW9e_QrbT1=4YJdGLLBksRkAD2yVKjn3ww@mail.gmail.com> |
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 <[email protected]> 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