qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Lucien Anti-Spam <lucienmp_antispam@yahoo.com>
To: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Luc Michel <luc.michel@greensocs.com>
Subject: [Qemu-devel] gdb run / pause broken for some debuggers
Date: Thu, 24 Jan 2019 14:25:41 +0000 (UTC)	[thread overview]
Message-ID: <633999897.454680.1548339941611@mail.yahoo.com> (raw)
In-Reply-To: 633999897.454680.1548339941611.ref@mail.yahoo.com

Hi gdbstub maintainers (CC: Luc Michel as he wrote the patch that probably caused this issue)
I have found an issue with IDA Pro when moving to QEMU3.x where RUN/PAUSE has stopped working.
I am pretty sure its to do with this debugger sending no thread-id with the vCont packet action
That is that IDA Pro sends "vCont;c" (action=c, thread-id=none).  
This is defined in the RSP document as "An action with no thread-id matches all threads."
(https://sourceware.org/gdb/current/onlinedocs/gdb/Packets.html#vCont-packet )
In commit e40e5204af8388e605df2325d9b562c05919350e, which added multiprocess support for vCont packets, the new code errors right away if it finds no ":" action\thread-id separator as shown below:
 if (*p++ != ':') {     res = -ENOTSUP;...
The upper function calling gdb_handle_vcont when -EINVAL or -ERANGE will spit out an "E22" error message, but for -ENOTSUP  we do goto-unknown_command label results in IDA Pro thinking the gdbstub is dead.
            res = gdb_handle_vcont(s, p);            if (res) {                if ((res == -EINVAL) || (res == -ERANGE)) {                    put_packet(s, "E22");                ... else goto unknown_command:
Maybe we should extend this to add a "-ENOTSUP" clause so the "E22" is also returned?
This "unknown_command:" branch should probably send a "E nn" packet rather than just a blank "+" ack although here I do admit the spec is very unclear but in most cases they do spec out "E nn" when some part of the command turns to garbage. 
...        unknown_command:            /* put empty packet */           buf[0] = '\0';           put_packet(s, buf);


If people more experienced in this agree I will go ahead and try at a patch for both of these issues.
Cheers,Luc

       reply	other threads:[~2019-01-24 14:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <633999897.454680.1548339941611.ref@mail.yahoo.com>
2019-01-24 14:25 ` Lucien Anti-Spam [this message]
2019-01-25 11:09   ` [Qemu-devel] gdb run / pause broken for some debuggers Luc Michel

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=633999897.454680.1548339941611@mail.yahoo.com \
    --to=lucienmp_antispam@yahoo.com \
    --cc=luc.michel@greensocs.com \
    --cc=qemu-devel@nongnu.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 NNTP newsgroup(s).