[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 45/54] softmmu: pass the main loop status to gdb "Wxx" packet
|
From: |
Alistair Francis |
|
Subject: |
[PULL 45/54] softmmu: pass the main loop status to gdb "Wxx" packet |
|
Date: |
Thu, 12 Oct 2023 14:10:42 +1000 |
From: Clément Chigot <chigot@adacore.com>
gdb_exit function aims to close gdb sessions and sends the exit code of
the current execution. It's being called by qemu_cleanup once the main
loop is over.
Until now, the exit code sent was always 0. Now that hardware can
shutdown this main loop with custom exit codes, these codes must be
transfered to gdb as well.
Signed-off-by: Clément Chigot <chigot@adacore.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20231003071427.188697-3-chigot@adacore.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
include/sysemu/sysemu.h | 2 +-
system/main.c | 2 +-
system/runstate.c | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 25be2a692e..73a37949c2 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -101,7 +101,7 @@ bool defaults_enabled(void);
void qemu_init(int argc, char **argv);
int qemu_main_loop(void);
-void qemu_cleanup(void);
+void qemu_cleanup(int);
extern QemuOptsList qemu_legacy_drive_opts;
extern QemuOptsList qemu_common_drive_opts;
diff --git a/system/main.c b/system/main.c
index 694388bd7f..9b91d21ea8 100644
--- a/system/main.c
+++ b/system/main.c
@@ -35,7 +35,7 @@ int qemu_default_main(void)
int status;
status = qemu_main_loop();
- qemu_cleanup();
+ qemu_cleanup(status);
return status;
}
diff --git a/system/runstate.c b/system/runstate.c
index 363a5ea8dd..ea9d6c2a32 100644
--- a/system/runstate.c
+++ b/system/runstate.c
@@ -834,9 +834,9 @@ void qemu_init_subsystems(void)
}
-void qemu_cleanup(void)
+void qemu_cleanup(int status)
{
- gdb_exit(0);
+ gdb_exit(status);
/*
* cleaning up the migration object cancels any existing migration
--
2.41.0
- [PULL 35/54] target/riscv/kvm: do not use riscv_cpu_add_misa_properties(), (continued)
- [PULL 35/54] target/riscv/kvm: do not use riscv_cpu_add_misa_properties(), Alistair Francis, 2023/10/12
- [PULL 36/54] target/riscv/cpu.c: export set_misa(), Alistair Francis, 2023/10/12
- [PULL 37/54] target/riscv/tcg: introduce tcg_cpu_instance_init(), Alistair Francis, 2023/10/12
- [PULL 38/54] target/riscv/cpu.c: make misa_ext_cfgs[] 'const', Alistair Francis, 2023/10/12
- [PULL 39/54] target/riscv/tcg: move riscv_cpu_add_misa_properties() to tcg-cpu.c, Alistair Francis, 2023/10/12
- [PULL 40/54] target/riscv/cpu.c: export isa_edata_arr[], Alistair Francis, 2023/10/12
- [PULL 41/54] target/riscv/cpu: move priv spec functions to tcg-cpu.c, Alistair Francis, 2023/10/12
- [PULL 42/54] target/riscv: add riscv_cpu_get_name(), Alistair Francis, 2023/10/12
- [PULL 43/54] target/riscv/tcg-cpu.c: add extension properties for all cpus, Alistair Francis, 2023/10/12
- [PULL 46/54] hw/misc/sifive_test.c: replace exit calls with proper shutdown, Alistair Francis, 2023/10/12
- [PULL 45/54] softmmu: pass the main loop status to gdb "Wxx" packet,
Alistair Francis <=
- [PULL 47/54] hw/char: riscv_htif: replace exit calls with proper shutdown, Alistair Francis, 2023/10/12
- [PULL 44/54] softmmu: add means to pass an exit code when requesting a shutdown, Alistair Francis, 2023/10/12
- [PULL 48/54] gdbstub: replace exit calls with proper shutdown for softmmu, Alistair Francis, 2023/10/12
- [PULL 49/54] target/riscv/kvm: improve 'init_multiext_cfg' error msg, Alistair Francis, 2023/10/12
- [PULL 50/54] target/riscv/kvm: support KVM_GET_REG_LIST, Alistair Francis, 2023/10/12
- [PULL 51/54] target/riscv/tcg: remove RVG warning, Alistair Francis, 2023/10/12
- [PULL 52/54] target/riscv: Use env_archcpu for better performance, Alistair Francis, 2023/10/12
- [PULL 53/54] target/riscv: deprecate capital 'Z' CPU properties, Alistair Francis, 2023/10/12
- [PULL 54/54] target/riscv: Fix vfwmaccbf16.vf, Alistair Francis, 2023/10/12
- Re: [PULL 00/54] riscv-to-apply queue, Stefan Hajnoczi, 2023/10/13