From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LAtIW-0005Bf-AF for qemu-devel@nongnu.org; Thu, 11 Dec 2008 16:42:16 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LAtIV-0005AK-73 for qemu-devel@nongnu.org; Thu, 11 Dec 2008 16:42:15 -0500 Received: from [199.232.76.173] (port=39433 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAtIV-0005A4-2l for qemu-devel@nongnu.org; Thu, 11 Dec 2008 16:42:15 -0500 Received: from soufre.accelance.net ([213.162.48.15]:56797) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LAtIU-0004IM-Ce for qemu-devel@nongnu.org; Thu, 11 Dec 2008 16:42:14 -0500 Received: from [192.168.0.3] (potipota.net [88.168.176.51]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by soufre.accelance.net (Postfix) with ESMTP id A33894506F for ; Thu, 11 Dec 2008 22:42:12 +0100 (CET) Subject: Re: [Qemu-devel] User emulation & gdb & sigsegv From: Lionel Landwerlin In-Reply-To: <20081210231813.GA13638@edgar.se.axis.com> References: <1228950413.3898.6.camel@cocoduo.atr> <20081210231813.GA13638@edgar.se.axis.com> Content-Type: text/plain; charset=utf-8 Date: Thu, 11 Dec 2008 22:42:10 +0100 Message-Id: <1229031730.3898.28.camel@cocoduo.atr> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Le jeudi 11 d=C3=A9cembre 2008 =C3=A0 00:18 +0100, Edgar E. Iglesias a =C3= =A9crit : > On Thu, Dec 11, 2008 at 12:06:53AM +0100, Lionel Landwerlin wrote: > > Hello, > >=20 > > Currently, when using gdb connected to qemu, if a sigsegv is raised, > > Qemu just exits. > >=20 > > How should I modify Qemu to redirect this last signal to the connecte= d > > gdb and print a stack trace at least ? > >=20 > > I tried to call gdb_handlesig(gdbstub.c) from > > force_sig(linux-user/signal.c) but Qemu just crashes. > >=20 > > Any idea is welcome :) >=20 > Hello, >=20 > I've got this in my git, IIRC it helped me out in those situations. >=20 > Cheers >=20 > commit 1efa40a743e16dbe2803a8d16902bf89850e80a3 > Author: Edgar E. Iglesias > Date: Mon Sep 29 14:14:24 2008 +0200 >=20 > Pass default handler signals to gdb aswell. >=20 > 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_sig= info_t *info) > if (sig !=3D TARGET_SIGCHLD && > sig !=3D TARGET_SIGURG && > sig !=3D TARGET_SIGWINCH) { > + sig =3D gdb_handlesig(env, sig); > force_sig(sig); > } else { > return 0; /* indicate ignored */ >=20 >=20 In fact this patch just make qemu crash too. Have you tested this patch on the current svn ? What cpu did you use to test it ? Regards, --=20 =EF=BB=BFLione Landwerlin =20 =EF=BB=BF O p e n W i d e 14, rue Gaillon 75002 Paris