Skip to content

Commit

Permalink
gdbstub: use a better signal when we halt for IO reasons
Browse files Browse the repository at this point in the history
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.

Reviewed-by: Luis Machado <luis.machado@arm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20231201093633.2551497-2-alex.bennee@linaro.org>
  • Loading branch information
stsquad committed Dec 1, 2023
1 parent abf635d commit 5dcf633
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions gdbstub/internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gdbstub/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 5dcf633

Please sign in to comment.