mbox series

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

Message ID 20230818090224.409192-1-chigot@adacore.com (mailing list archive)
Headers show
Series Risc-V/gdb: replace exit(0) with proper shutdown | expand

Message

Clément Chigot Aug. 18, 2023, 9:02 a.m. UTC
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.

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     | 11 +++++++++++
 gdbstub/user.c        |  2 ++
 hw/char/riscv_htif.c  | 12 +++++++++++-
 hw/misc/sifive_test.c |  4 +++-
 5 files changed, 28 insertions(+), 4 deletions(-)