[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 6/6] gdbstub: ensure we clean-up when terminated
From: |
Alex Bennée |
Subject: |
[PATCH v1 6/6] gdbstub: ensure we clean-up when terminated |
Date: |
Mon, 14 Dec 2020 15:30:12 +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>
---
gdbstub.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gdbstub.c b/gdbstub.c
index 7172f063a1..61fe2360e3 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 0/6] gdbstub (auxv, tests, cleanup), Alex Bennée, 2020/12/14
- [PATCH v1 3/6] gdbstub: add support to Xfer:auxv:read: packet, Alex Bennée, 2020/12/14
- [PATCH v1 4/6] gdbstub: drop CPUEnv from gdb_exit(), Alex Bennée, 2020/12/14
- [PATCH v1 6/6] gdbstub: ensure we clean-up when terminated,
Alex Bennée <=
- [PATCH v1 5/6] gdbstub: drop gdbserver_cleanup in favour of gdb_exit, Alex Bennée, 2020/12/14
- [PATCH v1 1/6] test/guest-debug: echo QEMU command as well, Alex Bennée, 2020/12/14