[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 09/20] gdbstub: ensure we clean-up when terminated
From: |
Alex Bennée |
Subject: |
[PATCH v1 09/20] gdbstub: ensure we clean-up when terminated |
Date: |
Fri, 8 Jan 2021 22:42:45 +0000 |
If you kill the inferior from GDB we end up leaving our socket lying
around. Fix this by calling gdb_exit() first.
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: <20201214153012.12723-7-alex.bennee@linaro.org>
Message-Id: <20201218112707.28348-9-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
gdbstub.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gdbstub.c b/gdbstub.c
index bab8476357..8c301edf32 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1978,6 +1978,7 @@ static void handle_v_kill(GdbCmdContext *gdb_ctx, void
*user_ctx)
/* Kill the target */
put_packet("OK");
error_report("QEMU: Terminated via GDBstub");
+ gdb_exit(0);
exit(0);
}
@@ -2539,6 +2540,7 @@ static int gdb_handle_packet(const char *line_buf)
case 'k':
/* Kill the target */
error_report("QEMU: Terminated via GDBstub");
+ gdb_exit(0);
exit(0);
case 'D':
{
--
2.20.1
- [PATCH v1 00/20] gdbstub, semihosting and test/tool updates (pre PR), Alex Bennée, 2021/01/08
- [PATCH v1 01/20] tests/docker: Remove Debian 9 remnant lines, Alex Bennée, 2021/01/08
- [PATCH v1 02/20] test/guest-debug: echo QEMU command as well, Alex Bennée, 2021/01/08
- [PATCH v1 03/20] configure: gate our use of GDB to 8.3.1 or above, Alex Bennée, 2021/01/08
- [PATCH v1 04/20] Revert "tests/tcg/multiarch/Makefile.target: Disable run-gdbstub-sha1 test", Alex Bennée, 2021/01/08
- [PATCH v1 06/20] gdbstub: add support to Xfer:auxv:read: packet, Alex Bennée, 2021/01/08
- [PATCH v1 07/20] gdbstub: drop CPUEnv from gdb_exit(), Alex Bennée, 2021/01/08
- [PATCH v1 05/20] gdbstub: implement a softmmu based test, Alex Bennée, 2021/01/08
- [PATCH v1 09/20] gdbstub: ensure we clean-up when terminated,
Alex Bennée <=
- [PATCH v1 08/20] gdbstub: drop gdbserver_cleanup in favour of gdb_exit, Alex Bennée, 2021/01/08
- [PATCH v1 11/20] Makefile: add GNU global tags support, Alex Bennée, 2021/01/08
- [PATCH v1 10/20] target/arm: use official org.gnu.gdb.aarch64.sve layout for registers, Alex Bennée, 2021/01/08
- [PATCH v1 12/20] semihosting: Move ARM semihosting code to shared directories, Alex Bennée, 2021/01/08