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.
CVSROOT: /cvs/src Module name: src Changes by: palves@sourceware.org 2012-02-27 16:19:19 Modified files: gdb/gdbserver : ChangeLog linux-low.c Log message: 2012-02-27 Pedro Alves <palves@redhat.com> PR server/9684 * linux-low.c (pid_is_stopped): New. (linux_attach_lwp_1): Handle attaching to 'T (stopped)' processes. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/gdbserver/ChangeLog.diff?cvsroot=src&r1=1.556&r2=1.557 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/gdbserver/linux-low.c.diff?cvsroot=src&r1=1.193&r2=1.194
Patch checked in.