From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NjfEc-0002iG-3U for qemu-devel@nongnu.org; Mon, 22 Feb 2010 15:50:30 -0500 Received: from [199.232.76.173] (port=43211 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NjfEb-0002i6-Hj for qemu-devel@nongnu.org; Mon, 22 Feb 2010 15:50:29 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NjfEa-0001Ud-RC for qemu-devel@nongnu.org; Mon, 22 Feb 2010 15:50:29 -0500 Received: from mx20.gnu.org ([199.232.41.8]:30618) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NjfEa-0001UX-DX for qemu-devel@nongnu.org; Mon, 22 Feb 2010 15:50:28 -0500 Received: from mail.codesourcery.com ([38.113.113.100]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NjfEY-00009x-UR for qemu-devel@nongnu.org; Mon, 22 Feb 2010 15:50:27 -0500 Message-ID: <4B82EE07.80904@codesourcery.com> Date: Mon, 22 Feb 2010 17:50:15 -0300 From: Daniel Gutson MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040300060404080909070905" Subject: [Qemu-devel] [PATCH] Fix to 'gdb detach' stub List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------040300060404080909070905 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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. I tested this manually. Please commit it for me if accepted, since I don't have write privileges. Thanks! Daniel. 2010-02-22 Daniel Gutson * gdbstub.c (gdb_handle_packet): set gdb_syscall_mode properly. -- Daniel Gutson CodeSourcery www.codesourcery.com --------------040300060404080909070905 Content-Type: text/x-diff; name="gdbstub.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gdbstub.patch" 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"); break; --------------040300060404080909070905--