From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FVTWQ-0003Ut-0M for qemu-devel@nongnu.org; Mon, 17 Apr 2006 09:12:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FVTWP-0003UZ-8N for qemu-devel@nongnu.org; Mon, 17 Apr 2006 09:12:05 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FVTWP-0003UW-2y for qemu-devel@nongnu.org; Mon, 17 Apr 2006 09:12:05 -0400 Received: from [147.11.1.11] (helo=mail.wrs.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FVTX3-0007ce-Oy for qemu-devel@nongnu.org; Mon, 17 Apr 2006 09:12:46 -0400 Received: from ala-mail04.corp.ad.wrs.com (ala-mail04 [147.11.57.145]) by mail.wrs.com (8.13.6/8.13.3) with ESMTP id k3HDC2nX028171 for ; Mon, 17 Apr 2006 06:12:02 -0700 (PDT) Message-ID: <44439421.9060100@windriver.com> Date: Mon, 17 Apr 2006 08:12:01 -0500 From: Jason Wessel MIME-Version: 1.0 References: <1137652046.8132.11.camel@localhost.localdomain> In-Reply-To: <1137652046.8132.11.camel@localhost.localdomain> Content-Type: multipart/mixed; boundary="------------020602000404060809000002" Subject: [Qemu-devel] [PATCH] gdbstub.c fix for SIGINT Reply-To: qemu-devel@nongnu.org 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. --------------020602000404060809000002 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Attached is a patch to add the case for interrupting the gdbstub and sending the correct signal to gdb. The gdb serial protocol states that if you interrupt the stub with a "control-c" in gdb that it should stop with S02 (SIGINT) to indicate that it was interrupted. I also added the tlb flush so that breakpoints can be written in correctly. I found that if I ran a pentium qemu instance and broke in with gdb and planted a breakpoint at do_fork() that it was not immediately hit due to the lack of the flush. With the patch, it reliably stops all the time now when a breakpoint is planted after interrupting the stub. Thanks, Jason. --------------020602000404060809000002 Content-Type: text/plain; name="gdbstub.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gdbstub.c.patch" Index: Changelog =================================================================== RCS file: /sources/qemu/qemu/Changelog,v retrieving revision 1.111 diff -u -r1.111 Changelog --- Changelog 12 Apr 2006 21:09:31 -0000 1.111 +++ Changelog 17 Apr 2006 13:05:57 -0000 @@ -2,6 +2,7 @@ - USB tablet support (Brad Campbell, Anthony Liguori) - win32 host serial support (Kazu) + - Fix SIGINT handler for gdbstub version 0.8.0: Index: gdbstub.c =================================================================== RCS file: /sources/qemu/qemu/gdbstub.c,v retrieving revision 1.34 diff -u -r1.34 gdbstub.c --- gdbstub.c 5 Dec 2005 19:55:19 -0000 1.34 +++ gdbstub.c 17 Apr 2006 13:05:57 -0000 @@ -654,6 +654,9 @@ if (reason == EXCP_DEBUG) { tb_flush(s->env); ret = SIGTRAP; + } else if (reason == EXCP_INTERRUPT) { + tb_flush(s->env); + ret = SIGINT; } else ret = 0; --------------020602000404060809000002--