gdbstub: ensure we clean-up when terminated
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: <20210108224256.2321-10-alex.bennee@linaro.org>
This commit is contained in:
parent
5ef0317f58
commit
b9e10c6c75
|
@ -1978,6 +1978,7 @@ static void handle_v_kill(GdbCmdContext *gdb_ctx, void *user_ctx)
|
||||||
/* Kill the target */
|
/* Kill the target */
|
||||||
put_packet("OK");
|
put_packet("OK");
|
||||||
error_report("QEMU: Terminated via GDBstub");
|
error_report("QEMU: Terminated via GDBstub");
|
||||||
|
gdb_exit(0);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2539,6 +2540,7 @@ static int gdb_handle_packet(const char *line_buf)
|
||||||
case 'k':
|
case 'k':
|
||||||
/* Kill the target */
|
/* Kill the target */
|
||||||
error_report("QEMU: Terminated via GDBstub");
|
error_report("QEMU: Terminated via GDBstub");
|
||||||
|
gdb_exit(0);
|
||||||
exit(0);
|
exit(0);
|
||||||
case 'D':
|
case 'D':
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue