All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] gdbstub: Fix handling of '!' packet with new infra
@ 2019-08-05 19:09 Ramiro Polla
  2019-08-06 11:26 ` Alex Bennée
  0 siblings, 1 reply; 2+ messages in thread
From: Ramiro Polla @ 2019-08-05 19:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: philmd, Ramiro Polla, alex.bennee, arilou

Since the '!' packet is not handled by the new infrastructure,
gdb_handle_packet() would call run_cmd_parser() with a NULL cmd_parser
value, which would lead to an unsupported packet ("$#00") being sent,
which could confuse the gdb client.

This also has a side-effect of speeding up the initial connection with
gdb.

Fixes: 3e2c12615b52 ("gdbstub: Implement deatch (D pkt) with new infra")
Signed-off-by: Ramiro Polla <ramiro.polla@gmail.com>
---
 gdbstub.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gdbstub.c b/gdbstub.c
index b470aec8ea..d051344488 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -2587,7 +2587,9 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf)
         break;
     }
 
-    run_cmd_parser(s, line_buf, cmd_parser);
+    if (cmd_parser) {
+        run_cmd_parser(s, line_buf, cmd_parser);
+    }
 
     return RS_IDLE;
 }
-- 
2.11.0



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

end of thread, other threads:[~2019-08-06 11:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-05 19:09 [Qemu-devel] [PATCH] gdbstub: Fix handling of '!' packet with new infra Ramiro Polla
2019-08-06 11:26 ` Alex Bennée

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.