From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LB3dU-0001RX-RQ for qemu-devel@nongnu.org; Fri, 12 Dec 2008 03:44:36 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LB3dT-0001P2-Cc for qemu-devel@nongnu.org; Fri, 12 Dec 2008 03:44:36 -0500 Received: from [199.232.76.173] (port=49107 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LB3dT-0001Ov-8q for qemu-devel@nongnu.org; Fri, 12 Dec 2008 03:44:35 -0500 Received: from bart.se.axis.com ([195.60.68.10]:53325) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LB3dS-0001xs-O0 for qemu-devel@nongnu.org; Fri, 12 Dec 2008 03:44:35 -0500 Received: from bart.se.axis.com (bart.se.axis.com [127.0.0.1]) by bart.se.axis.com (Postfix) with ESMTP id 836DB641C5 for ; Fri, 12 Dec 2008 09:44:32 +0100 (CET) Received: from axis.com (edgar.se.axis.com [10.93.151.1]) by bart.se.axis.com (Postfix) with ESMTP id 764A46415C for ; Fri, 12 Dec 2008 09:44:32 +0100 (CET) Date: Fri, 12 Dec 2008 09:44:32 +0100 From: "Edgar E. Iglesias" Subject: Re: [Qemu-devel] User emulation & gdb & sigsegv Message-ID: <20081212084432.GA26464@edgar.se.axis.com> References: <1228950413.3898.6.camel@cocoduo.atr> <20081210231813.GA13638@edgar.se.axis.com> <1229031730.3898.28.camel@cocoduo.atr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1229031730.3898.28.camel@cocoduo.atr> 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, Lionel Landwerlin On Thu, Dec 11, 2008 at 10:42:10PM +0100, Lionel Landwerlin wrote: > Le jeudi 11 d=E9cembre 2008 =E0 00:18 +0100, Edgar E. Iglesias a =E9cri= t : > > 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 connec= ted > > > 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_s= iginfo_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 >=20 > In fact this patch just make qemu crash too. > Have you tested this patch on the current svn ? Nope, it's on my git with other patches, don't know if there are dependencies. Feel free to have a look at git://repo.or.cz/qemu/cris-port.git if you're interested. No guarantees that it will help though :) > What cpu did you use to test it ? I run it on CRIS all the time. Regards