]> Git Repo - qemu.git/commitdiff
gdbstub: Fix handling of '!' packet with new infra
authorRamiro Polla <[email protected]>
Mon, 5 Aug 2019 19:09:01 +0000 (21:09 +0200)
committerAlex Bennée <[email protected]>
Wed, 28 Aug 2019 09:11:06 +0000 (10:11 +0100)
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 <[email protected]>
Message-Id: <20190805190901[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
gdbstub.c

index b92ba59e4dffd89ced2eefb3eb3949ac9c73c6ed..5c067594baef02b49b20fefdbd523eaa8ecaa8ac 100644 (file)
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -2588,7 +2588,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;
 }
This page took 0.022397 seconds and 4 git commands to generate.