Skip to contentSkip to conversation

Risc-V/gdb: replace exit(0) with proper shutdown

PATCH Superseded Clément Chigot 1 participant 1 message Aug 23, 2023

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover Risc-V/gdb: replace exit(0) with proper shutdown

This serie replaces some of the call to exit(0) in hardware used by Risc-V boards or made when gdb is requested to exit. Otherwise, the gdb connection can be too abruptly disconnected resulting in the last gdb packet "Wxx" being not sent.

As qemu_system_shutdown_request doesn't allow to pass the exit code, only perform the above modification on a sucessful exit.

Difference with v1:
- avoid sending a shutdown request in gdb_exit if one has already been set.

Clément Chigot (3):
hw/misc/sifive_test.c: replace exit(0) with proper shutdown hw/char: riscv_htif: replace exit(0) with proper shutdown
gdbstub: replace exit(0) with proper shutdown

 gdbstub/gdbstub.c     |  3 +--
 gdbstub/softmmu.c     | 13 +++++++++++++
 gdbstub/user.c        |  2 ++
 hw/char/riscv_htif.c  | 12 +++++++++++-
 hw/misc/sifive_test.c |  4 +++-
 5 files changed, 30 insertions(+), 4 deletions(-)
Signature · 1 line
2.25.1