From 66bbe3e9b46112ec2fe35a7d6e79d8a9bb39d14a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Tue, 3 Oct 2023 09:14:24 +0200 Subject: softmmu: pass the main loop status to gdb "Wxx" packet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Alistair Francis Message-ID: <20231003071427.188697-3-chigot@adacore.com> Signed-off-by: Alistair Francis --- system/main.c | 2 +- system/runstate.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'system') diff --git a/system/main.c b/system/main.c index 694388b..9b91d21 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 363a5ea..ea9d6c2 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 -- cgit v1.1