From patchwork Mon Feb 22 21:22:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] Fix to 'gdb detach' stub Date: Mon, 22 Feb 2010 11:22:37 -0000 From: Daniel Gutson X-Patchwork-Id: 46003 Message-Id: <4B82F59D.8050204@codesourcery.com> To: qemu-devel@nongnu.org [Re-done with git.] With this patch, 'gdb detach' correctly resumes the inferior execution after detaching the debugger. The bug was caused by qemu asking gdb to execute a syscall (isatty) after the detach, and then waiting (forever) for the reply. I fixed this by properly setting gdb_syscall_mode appropriately in the 'detach' packet handling, so subsequent syscalls are solved by qemu rather than gdb. Signed-off-by: Daniel Gutson --- gdbstub.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) break; diff --git a/gdbstub.c b/gdbstub.c index 91c5f68..92bb36d 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1848,6 +1848,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf) case 'D': /* Detach packet */ gdb_breakpoint_remove_all(); + gdb_syscall_mode = GDB_SYS_DISABLED; gdb_continue(s); put_packet(s, "OK");