From patchwork Fri Feb 26 17:13:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Gutson X-Patchwork-Id: 46361 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 77377B7080 for ; Sat, 27 Feb 2010 04:35:56 +1100 (EST) Received: from localhost ([127.0.0.1]:52800 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nl45I-0005LD-KL for incoming@patchwork.ozlabs.org; Fri, 26 Feb 2010 12:34:40 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nl3lS-0006yX-NJ for qemu-devel@nongnu.org; Fri, 26 Feb 2010 12:14:10 -0500 Received: from [199.232.76.173] (port=54877 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nl3lS-0006yN-7Q for qemu-devel@nongnu.org; Fri, 26 Feb 2010 12:14:10 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nl3lR-0008W3-IF for qemu-devel@nongnu.org; Fri, 26 Feb 2010 12:14:10 -0500 Received: from mx20.gnu.org ([199.232.41.8]:39875) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Nl3lR-0008Vf-A1 for qemu-devel@nongnu.org; Fri, 26 Feb 2010 12:14:09 -0500 Received: from mail.codesourcery.com ([38.113.113.100]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nl3lQ-0000FY-4f for qemu-devel@nongnu.org; Fri, 26 Feb 2010 12:14:08 -0500 Received: (qmail 8242 invoked from network); 26 Feb 2010 17:14:04 -0000 Received: from unknown (HELO ?192.168.9.129?) (daniel@127.0.0.2) by mail.codesourcery.com with ESMTPA; 26 Feb 2010 17:14:04 -0000 Message-ID: <4B88014E.5040806@codesourcery.com> Date: Fri, 26 Feb 2010 14:13:50 -0300 From: Daniel Gutson Organization: CodeSourcery User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: qemu-devel@nongnu.org, kwolf@redhat.com, daniel.gutson@gmail.com X-detected-operating-system: by mx20.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: Subject: [Qemu-devel] Re: Re: [PATCH] Fix to 'gdb detach' stub X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Hello Kevin, please let me know if this works. If so, please remember that I'd need somebody to commit this for me, since I don't have write-access. Undoing line wrap and tabs. Thanks! Daniel. [old same text.] 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(-) 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;