OSDN Git Service

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)
commitfd69e0928c183d29584a45d94a6d3b4fe1e994b5
treee53b6a5b484b34786246205df6d630af3c7983c7
parent9ad693f3dc7649592a66b585b695601fc4ec8ce0
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