Bug 9684 - gdbserver, attach to stopped processes
Summary: gdbserver, attach to stopped processes
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: server (show other bugs)
Version: 6.50
: P2 enhancement
Target Milestone: 7.5
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: 8967
  Show dependency treegraph
 
Reported: 2008-12-24 18:57 UTC by Pedro Alves
Modified: 2012-02-27 16:31 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Alves 2008-12-24 18:57:31 UTC
linux gdbserver doesn't know how to attach to stopped processes (while native
GDB does).  It should.
Comment 1 Pedro Alves 2012-02-16 15:44:53 UTC
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.
Comment 2 cvs-commit@gcc.gnu.org 2012-02-27 16:19:25 UTC
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
Comment 3 Pedro Alves 2012-02-27 16:31:19 UTC
Patch checked in.