[RFC PATCH] gdbstub: use a better signal when we halt for IO reasons

Alex Bennée posted 1 patch 1 year ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20231123131905.2640498-1-alex.bennee@linaro.org
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>
gdbstub/internals.h | 1 +
gdbstub/system.c    | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
[RFC PATCH] gdbstub: use a better signal when we halt for IO reasons
Posted by Alex Bennée 1 year ago
The gdb description GDB_SIGNAL_IO is "I/O possible" and by default gdb
will try and restart the guest, getting us nowhere. Report
GDB_SIGNAL_STOP instead which should at least halt the session at the
failure point.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Cc: Luis Machado <luis.machado@arm.com>
---
 gdbstub/internals.h | 1 +
 gdbstub/system.c    | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/gdbstub/internals.h b/gdbstub/internals.h
index 465c24b36e..5c0c725e54 100644
--- a/gdbstub/internals.h
+++ b/gdbstub/internals.h
@@ -24,6 +24,7 @@ enum {
     GDB_SIGNAL_TRAP = 5,
     GDB_SIGNAL_ABRT = 6,
     GDB_SIGNAL_ALRM = 14,
+    GDB_SIGNAL_STOP = 17,
     GDB_SIGNAL_IO = 23,
     GDB_SIGNAL_XCPU = 24,
     GDB_SIGNAL_UNKNOWN = 143
diff --git a/gdbstub/system.c b/gdbstub/system.c
index 783ac140b9..83fd452800 100644
--- a/gdbstub/system.c
+++ b/gdbstub/system.c
@@ -183,7 +183,7 @@ static void gdb_vm_state_change(void *opaque, bool running, RunState state)
         break;
     case RUN_STATE_IO_ERROR:
         trace_gdbstub_hit_io_error();
-        ret = GDB_SIGNAL_IO;
+        ret = GDB_SIGNAL_STOP;
         break;
     case RUN_STATE_WATCHDOG:
         trace_gdbstub_hit_watchdog();
-- 
2.39.2


Re: [RFC PATCH] gdbstub: use a better signal when we halt for IO reasons
Posted by Alex Bennée 12 months ago
Alex Bennée <alex.bennee@linaro.org> writes:

> The gdb description GDB_SIGNAL_IO is "I/O possible" and by default gdb
> will try and restart the guest, getting us nowhere. Report
> GDB_SIGNAL_STOP instead which should at least halt the session at the
> failure point.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Cc: Luis Machado <luis.machado@arm.com>

ping?

This has been broken for awhile so I don't know if its worth putting it
in 8.2 (I have nothing else in my queue right now). However I suspect
people only get confused when they have disks filling up and debugging
stops working.

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro