aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-nat.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2005-03-02 15:07:49 +0000
committerDaniel Jacobowitz <drow@false.org>2005-03-02 15:07:49 +0000
commitd35870480f8ee486d74be91cf0b4e99f413cf65a (patch)
tree80c28f28886059591db0ee5a97d16bc71c455e9f /gdb/linux-nat.c
parent632d447c675f7b287be781f576daf661e5eb5c54 (diff)
downloadfsf-binutils-gdb-d35870480f8ee486d74be91cf0b4e99f413cf65a.zip
fsf-binutils-gdb-d35870480f8ee486d74be91cf0b4e99f413cf65a.tar.gz
fsf-binutils-gdb-d35870480f8ee486d74be91cf0b4e99f413cf65a.tar.bz2
* linux-nat.c (linux_supports_tracevforkdone, child_follow_fork):
Use LWP IDs.
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r--gdb/linux-nat.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index f2b2243..57843c5 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -1,6 +1,6 @@
/* GNU/Linux native-dependent code common to multiple platforms.
- Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GDB.
@@ -293,9 +293,12 @@ linux_supports_tracevforkdone (int pid)
void
linux_enable_event_reporting (ptid_t ptid)
{
- int pid = ptid_get_pid (ptid);
+ int pid = ptid_get_lwp (ptid);
int options;
+ if (pid == 0)
+ pid = ptid_get_pid (ptid);
+
if (! linux_supports_tracefork (pid))
return;
@@ -340,7 +343,9 @@ child_follow_fork (int follow_child)
get_last_target_status (&last_ptid, &last_status);
has_vforked = (last_status.kind == TARGET_WAITKIND_VFORKED);
- parent_pid = ptid_get_pid (last_ptid);
+ parent_pid = ptid_get_lwp (last_ptid);
+ if (parent_pid == 0)
+ parent_pid = ptid_get_pid (last_ptid);
child_pid = last_status.value.related_pid;
if (! follow_child)