[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 19/30] gdbstub: drop gdbserver_cleanup in favour of gdb_exit
From: |
Alex Bennée |
Subject: |
[PULL 19/30] gdbstub: drop gdbserver_cleanup in favour of gdb_exit |
Date: |
Fri, 15 Jan 2021 13:08:17 +0000 |
Despite it's name it didn't actually clean-up so let us document
gdb_exit() better and use that.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210108224256.2321-9-alex.bennee@linaro.org>
diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
index 492db0f512..ff0b7bc45e 100644
--- a/include/exec/gdbstub.h
+++ b/include/exec/gdbstub.h
@@ -46,7 +46,17 @@ void gdb_do_syscall(gdb_syscall_complete_cb cb, const char
*fmt, ...);
void gdb_do_syscallv(gdb_syscall_complete_cb cb, const char *fmt, va_list va);
int use_gdb_syscalls(void);
void gdb_set_stop_cpu(CPUState *cpu);
-void gdb_exit(int);
+
+/**
+ * gdb_exit: exit gdb session, reporting inferior status
+ * @code: exit code reported
+ *
+ * This closes the session and sends a final packet to GDB reporting
+ * the exit status of the program. It also cleans up any connections
+ * detritus before returning.
+ */
+void gdb_exit(int code);
+
#ifdef CONFIG_USER_ONLY
/**
* gdb_handlesig: yield control to gdb
@@ -187,8 +197,6 @@ static inline uint8_t * gdb_get_reg_ptr(GByteArray *buf,
int len)
*/
int gdbserver_start(const char *port_or_device);
-void gdbserver_cleanup(void);
-
/**
* gdb_has_xml:
* This is an ugly hack to cope with both new and old gdb.
diff --git a/gdbstub.c b/gdbstub.c
index afa553e8fc..bab8476357 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -3547,13 +3547,6 @@ int gdbserver_start(const char *device)
return 0;
}
-void gdbserver_cleanup(void)
-{
- if (gdbserver_state.init) {
- put_packet("W00");
- }
-}
-
static void register_types(void)
{
type_register_static(&char_gdb_type_info);
diff --git a/softmmu/runstate.c b/softmmu/runstate.c
index 636aab0add..6177693a30 100644
--- a/softmmu/runstate.c
+++ b/softmmu/runstate.c
@@ -775,7 +775,7 @@ void qemu_init_subsystems(void)
void qemu_cleanup(void)
{
- gdbserver_cleanup();
+ gdb_exit(0);
/*
* cleaning up the migration object cancels any existing migration
--
2.20.1
- [PULL 25/30] semihosting: Support SYS_HEAPINFO when env->boot_info is not set, (continued)
- [PULL 25/30] semihosting: Support SYS_HEAPINFO when env->boot_info is not set, Alex Bennée, 2021/01/15
- [PULL 13/30] test/guest-debug: echo QEMU command as well, Alex Bennée, 2021/01/15
- [PULL 14/30] configure: gate our use of GDB to 8.3.1 or above, Alex Bennée, 2021/01/15
- [PULL 21/30] target/arm: use official org.gnu.gdb.aarch64.sve layout for registers, Alex Bennée, 2021/01/15
- [PULL 30/30] semihosting: Implement SYS_ISERROR, Alex Bennée, 2021/01/15
- [PULL 29/30] semihosting: Implement SYS_TMPNAM, Alex Bennée, 2021/01/15
- [PULL 07/30] Makefile: wrap cscope in quiet-command calls, Alex Bennée, 2021/01/15
- [PULL 28/30] semihosting: Implement SYS_ELAPSED and SYS_TICKFREQ, Alex Bennée, 2021/01/15
- [PULL 16/30] gdbstub: implement a softmmu based test, Alex Bennée, 2021/01/15
- [PULL 18/30] gdbstub: drop CPUEnv from gdb_exit(), Alex Bennée, 2021/01/15
- [PULL 19/30] gdbstub: drop gdbserver_cleanup in favour of gdb_exit,
Alex Bennée <=
- [PULL 23/30] semihosting: Change common-semi API to be architecture-independent, Alex Bennée, 2021/01/15
- [PULL 08/30] docker: expand debian-amd64 image to include tag tools, Alex Bennée, 2021/01/15
- [PULL 27/30] riscv: Add semihosting support for user mode, Alex Bennée, 2021/01/15
- [PULL 20/30] gdbstub: ensure we clean-up when terminated, Alex Bennée, 2021/01/15
- [PULL 22/30] semihosting: Move ARM semihosting code to shared directories, Alex Bennée, 2021/01/15
- [PULL 15/30] Revert "tests/tcg/multiarch/Makefile.target: Disable run-gdbstub-sha1 test", Alex Bennée, 2021/01/15
- [PULL 10/30] Fix build with new yank feature by adding stubs, Alex Bennée, 2021/01/15
- [PULL 11/30] gitlab: migrate the minimal tools and unit tests from Travis, Alex Bennée, 2021/01/15
- [PULL 09/30] gitlab: move docs and tools build across from Travis, Alex Bennée, 2021/01/15
- [PULL 26/30] riscv: Add semihosting support, Alex Bennée, 2021/01/15