diff options
author | Mark Kettenis <kettenis@gnu.org> | 2001-10-14 11:30:37 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2001-10-14 11:30:37 +0000 |
commit | cacab7c47722fd1c63c95d4c4a5b761ba6823632 (patch) | |
tree | 1db8ef95227453d7235bfb4398a40632ece33a9d /gdb/config | |
parent | 9fa87a061b790901650cffd1bb6ae59fb531a9d4 (diff) | |
download | binutils-gdb-cacab7c47722fd1c63c95d4c4a5b761ba6823632.tar.gz |
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.
Diffstat (limited to 'gdb/config')
-rw-r--r-- | gdb/config/i386/nm-linux.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/config/i386/nm-linux.h b/gdb/config/i386/nm-linux.h index ab42ee59e56..089cb1ba47c 100644 --- a/gdb/config/i386/nm-linux.h +++ b/gdb/config/i386/nm-linux.h @@ -87,6 +87,11 @@ extern int cannot_store_register (int regno); /* Override child_resume in `infptrace.c'. */ #define CHILD_RESUME +/* Override child_wait in `inftarg.c'. */ +struct target_waitstatus; +extern ptid_t child_wait (ptid_t ptid, struct target_waitstatus *ourstatus); +#define CHILD_WAIT + /* FIXME: kettenis/2000-09-03: This should be moved to ../nm-linux.h once we have converted all Linux targets to use the new threads stuff (without the #undef of course). */ |