summary refs log tree commit diff stats
path: root/gdbstub/gdbstub.c
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2023-08-10 16:36:39 +0100
committerRichard Henderson <richard.henderson@linaro.org>2023-08-10 11:04:34 -0700
commit3869eb7eee6f6c00d51e8ce8fd71a769f3e0bf3e (patch)
tree1e92b12bac0611eaad9d9fd79189cf65bd45b328 /gdbstub/gdbstub.c
parentdad1036f43b55c68eb76e73ef771b252ec764b14 (diff)
downloadfocaccia-qemu-3869eb7eee6f6c00d51e8ce8fd71a769f3e0bf3e.tar.gz
focaccia-qemu-3869eb7eee6f6c00d51e8ce8fd71a769f3e0bf3e.zip
gdbstub: more fixes for client Ctrl-C handling
The original fix caused problems with spurious characters on other
system emulation. So:

  - instead of spamming output make the warning a trace point
  - ensure we only allow a stop reply if it was 0x3

Suggested-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <456ed3318421dd7946bdfb5ceda7e05332da368c.1690910333.git.quic_mathbern@quicinc.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230810153640.1879717-8-alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'gdbstub/gdbstub.c')
-rw-r--r--gdbstub/gdbstub.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
index e74ecc78cc..20b6fe03fb 100644
--- a/gdbstub/gdbstub.c
+++ b/gdbstub/gdbstub.c
@@ -2059,9 +2059,10 @@ void gdb_read_byte(uint8_t ch)
          * here, but it does expect a stop reply.
          */
         if (ch != 0x03) {
-            warn_report("gdbstub: client sent packet while target running\n");
+            trace_gdbstub_err_unexpected_runpkt(ch);
+        } else {
+            gdbserver_state.allow_stop_reply = true;
         }
-        gdbserver_state.allow_stop_reply = true;
         vm_stop(RUN_STATE_PAUSED);
     } else
 #endif