From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LAYJw-0002U5-DA for qemu-devel@nongnu.org; Wed, 10 Dec 2008 18:18:20 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LAYJu-0002Rt-Cl for qemu-devel@nongnu.org; Wed, 10 Dec 2008 18:18:19 -0500 Received: from [199.232.76.173] (port=37762 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAYJu-0002Rk-4v for qemu-devel@nongnu.org; Wed, 10 Dec 2008 18:18:18 -0500 Received: from bart.se.axis.com ([195.60.68.10]:59561) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LAYJt-000534-RT for qemu-devel@nongnu.org; Wed, 10 Dec 2008 18:18:18 -0500 Received: from bart.se.axis.com (bart.se.axis.com [127.0.0.1]) by bart.se.axis.com (Postfix) with ESMTP id 8E1BD6422C for ; Thu, 11 Dec 2008 00:18:13 +0100 (CET) Received: from axis.com (edgar.se.axis.com [10.93.151.1]) by bart.se.axis.com (Postfix) with ESMTP id 74B7964226 for ; Thu, 11 Dec 2008 00:18:13 +0100 (CET) Date: Thu, 11 Dec 2008 00:18:13 +0100 From: "Edgar E. Iglesias" Subject: Re: [Qemu-devel] User emulation & gdb & sigsegv Message-ID: <20081210231813.GA13638@edgar.se.axis.com> References: <1228950413.3898.6.camel@cocoduo.atr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1228950413.3898.6.camel@cocoduo.atr> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lionel Landwerlin Cc: qemu-devel@nongnu.org On Thu, Dec 11, 2008 at 12:06:53AM +0100, Lionel Landwerlin wrote: > Hello, > > Currently, when using gdb connected to qemu, if a sigsegv is raised, > Qemu just exits. > > How should I modify Qemu to redirect this last signal to the connected > gdb and print a stack trace at least ? > > I tried to call gdb_handlesig(gdbstub.c) from > force_sig(linux-user/signal.c) but Qemu just crashes. > > Any idea is welcome :) Hello, I've got this in my git, IIRC it helped me out in those situations. Cheers commit 1efa40a743e16dbe2803a8d16902bf89850e80a3 Author: Edgar E. Iglesias Date: Mon Sep 29 14:14:24 2008 +0200 Pass default handler signals to gdb aswell. diff --git a/linux-user/signal.c b/linux-user/signal.c index 9640923..b7d22a1 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -365,6 +365,7 @@ int queue_signal(CPUState *env, int sig, target_siginfo_t *info) if (sig != TARGET_SIGCHLD && sig != TARGET_SIGURG && sig != TARGET_SIGWINCH) { + sig = gdb_handlesig(env, sig); force_sig(sig); } else { return 0; /* indicate ignored */