Fix attaching to cloned processes. This fixes PR gdb/61.
authorMark Kettenis <kettenis@gnu.org>
Sun, 14 Oct 2001 11:30:37 +0000 (11:30 +0000)
committerMark Kettenis <kettenis@gnu.org>
Sun, 14 Oct 2001 11:30:37 +0000 (11:30 +0000)
commitcacab7c47722fd1c63c95d4c4a5b761ba6823632
tree1db8ef95227453d7235bfb4398a40632ece33a9d
parent9fa87a061b790901650cffd1bb6ae59fb531a9d4
Fix attaching to cloned processes.  This fixes PR gdb/61.
* lin-lwp.c (struct lwp_info): Add new member `cloned'.
(is_cloned) Removed.
(lin_lwp_attach_lwp): Don't call stop_wait_callback.  Instead call
waitpid explicitly.  Mark the LWP as cloned if waitpid fails and
retry with __WCLONE flag.
(lin_lwp_attach): Likewise.  Warn if attaching to a cloned process.
(detach_callback): Replace use of is_cloned with explicit check on
LWP id and process id.
(stop_wait_callback): Replace use of is_cloned with check if LWP
is marked as cloned.
[CHILD_WAIT] (child_wait): New function.
(lin_lwp_wait): Replace use of is_cloned with check if LWP is
marked as cloned.  Mark newly detected LWPs as cloned if detected
by waitpid with __WCLONE flag.
(kill_wait_callback): Replace use of is_cloned with check if LWP
is marked as cloned.
* config/i386/nm-linux.h (struct target_waitstatus): Add forward
declaration.
(child_wait): Add prototype.
(CHILD_WAIT): Define.
gdb/ChangeLog
gdb/config/i386/nm-linux.h
gdb/lin-lwp.c