linux gdbserver doesn't know how to attach to stopped processes (while native
GDB does). It should.
On Fedora 16, running 3.2.3-2.fc16.x86_64, it seems waitpid no longer hangs after attach, if the process was stopped. So no special handling is necessary there. Tested with the attach-stopped.exp test against the native-extended-remote board. Special handling like gdb/linux-nat.c does may be still necessary for older kernels, if someone cares for those.
Module name: src
Changes by: email@example.com 2012-02-27 16:19:19
gdb/gdbserver : ChangeLog linux-low.c
2012-02-27 Pedro Alves <firstname.lastname@example.org>
* linux-low.c (pid_is_stopped): New.
(linux_attach_lwp_1): Handle attaching to 'T (stopped)' processes.
Patch checked in.