This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [gdbserver] Fix attaching notices
- From: Daniel Jacobowitz <drow at false dot org>
- To: Pedro Alves <pedro at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 7 Jul 2008 13:55:10 -0400
- Subject: Re: [gdbserver] Fix attaching notices
- References: <200806280011.12868.pedro@codesourcery.com>
On Sat, Jun 28, 2008 at 12:11:12AM +0100, Pedro Alves wrote:
> Hi,
>
> This patch fixes several issues I noticed with attaching
> to processes with gdbserver's --multi support, on several
> host/target combinations:
>
> Linux host -> Linux gdbserver
>
> There's code in gdbserver to pretend the initial SIGSTOP
> was a SIGTRAP, that's been put there so
> "gdbserver --attach PID"; "target remote", doesn't see
> the SIGSTOP. This smudging should not be done when
> handling a vAttach, otherwise, the user is presented
> with:
>
> (gdb) tar extended-remote :9999
> Remote debugging using :9999
> (gdb) attach 32762
> Attached to Thread 32762
> [New Thread 32762]
>
> Program received signal SIGTRAP, Trace/breakpoint trap.
> 0x00007fc30f5d0b30 in ?? ()
>
> ... a bogus SIGTRAP.
Did you reproduce this with an unmodified GDB or a patched one? I
can't reproduce it - I was curious since I did test vAttach and I
don't remember seeing these SIGTRAPs.
Actually, wait... trying another GDB I see that this problem has
appeared on the GDB side between 6.8 and HEAD. 6.8 doesn't print out
the message about a SIGTRAP.
> [Switching to Thread 2232]
> Stopped due to shared library event
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This part looks fine.
--
Daniel Jacobowitz
CodeSourcery