This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Fix attaching to Linux stopped processes
On Mon, Sep 18, 2006 at 11:53:31AM +0200, Jan Kratochvil wrote:
> > Is this new in kernel.org? Or is it a Red Hat kernel patch? Where
> > did it come from?
>
> Thanks for checking it.
> OK, the patch was originally for GDB on Red Hat "kernel-2.6.17-1.2647.fc6".
>
> Still it is reproducible even on both linux-2.6.17.13 and linux-2.6.18-rc4, you
> just need to "kill -CONT $pid" the inferior as gdb(1) will hang during
> attaching to it. Screenshot (sorry for graphics):
> http://www.jankratochvil.net/priv/gdb.png
Oh right - I've seen this crash before.
> Also the patch looks right to me - after `PT_ATTACH' it is appropriate that
> `WSTOPSIG (status)' will report the original signal that stopped process,
> (WSTOPSIG (status) == SIGSTOP) <=> (process was in running/sleeping mode).
The part I was dubious about was the zero if already stopped by
sigstop. In any case, I agree. The patch to linux-nat.c is OK
to apply.
I'm not sure about the testcase though :-( I don't think it'll work
without the RH patched kernel, will it?
--
Daniel Jacobowitz
CodeSourcery