* [Qemu-devel] User emulation & gdb & sigsegv @ 2008-12-10 23:06 Lionel Landwerlin 2008-12-10 23:18 ` Edgar E. Iglesias 2008-12-17 19:45 ` Daniel Jacobowitz 0 siblings, 2 replies; 5+ messages in thread From: Lionel Landwerlin @ 2008-12-10 23:06 UTC (permalink / raw) To: qemu-devel 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 :) Regards, -- Lione Landwerlin O p e n W i d e 14, rue Gaillon 75002 Paris ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] User emulation & gdb & sigsegv 2008-12-10 23:06 [Qemu-devel] User emulation & gdb & sigsegv Lionel Landwerlin @ 2008-12-10 23:18 ` Edgar E. Iglesias 2008-12-11 21:42 ` Lionel Landwerlin 2008-12-17 19:45 ` Daniel Jacobowitz 1 sibling, 1 reply; 5+ messages in thread From: Edgar E. Iglesias @ 2008-12-10 23:18 UTC (permalink / raw) To: Lionel Landwerlin; +Cc: qemu-devel 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 <edgar.iglesias@axis.com> 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 */ ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] User emulation & gdb & sigsegv 2008-12-10 23:18 ` Edgar E. Iglesias @ 2008-12-11 21:42 ` Lionel Landwerlin 2008-12-12 8:44 ` Edgar E. Iglesias 0 siblings, 1 reply; 5+ messages in thread From: Lionel Landwerlin @ 2008-12-11 21:42 UTC (permalink / raw) To: qemu-devel Le jeudi 11 décembre 2008 à 00:18 +0100, Edgar E. Iglesias a écrit : > 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 <edgar.iglesias@axis.com> > 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 */ > > 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, -- Lione Landwerlin O p e n W i d e 14, rue Gaillon 75002 Paris ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] User emulation & gdb & sigsegv 2008-12-11 21:42 ` Lionel Landwerlin @ 2008-12-12 8:44 ` Edgar E. Iglesias 0 siblings, 0 replies; 5+ messages in thread From: Edgar E. Iglesias @ 2008-12-12 8:44 UTC (permalink / raw) To: qemu-devel, Lionel Landwerlin On Thu, Dec 11, 2008 at 10:42:10PM +0100, Lionel Landwerlin wrote: > Le jeudi 11 décembre 2008 à 00:18 +0100, Edgar E. Iglesias a écrit : > > 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 <edgar.iglesias@axis.com> > > 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 */ > > > > > > 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] User emulation & gdb & sigsegv 2008-12-10 23:06 [Qemu-devel] User emulation & gdb & sigsegv Lionel Landwerlin 2008-12-10 23:18 ` Edgar E. Iglesias @ 2008-12-17 19:45 ` Daniel Jacobowitz 1 sibling, 0 replies; 5+ messages in thread From: Daniel Jacobowitz @ 2008-12-17 19:45 UTC (permalink / raw) To: qemu-devel 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. Hi Lionel - I didn't see this message until today (I read the list only infrequently), but I posted a patch for this exact issue the next day. Let me know if it doesn't work for you, please. -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-12-17 19:45 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-12-10 23:06 [Qemu-devel] User emulation & gdb & sigsegv Lionel Landwerlin 2008-12-10 23:18 ` Edgar E. Iglesias 2008-12-11 21:42 ` Lionel Landwerlin 2008-12-12 8:44 ` Edgar E. Iglesias 2008-12-17 19:45 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).