summaryrefslogtreecommitdiff
path: root/gdb/hppah-nat.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2002-12-11 01:25:19 +0000
committerDaniel Jacobowitz <dan@debian.org>2002-12-11 01:25:19 +0000
commit0a6ba0e204f2d0a29d40c686a8c4e5c85e9fefa0 (patch)
tree7ffc418a6cd320a1145eac8c446b83f53aa3c97a /gdb/hppah-nat.c
parent078ef10707b31d05731117884b91502230fc2f2a (diff)
downloadgdb-0a6ba0e204f2d0a29d40c686a8c4e5c85e9fefa0.tar.gz
* hppah-nat.c (child_wait): Return TARGET_WAITKIND_IGNORE
for the parent's fork event. * infrun.c (handle_inferior_event): Only expect one fork event. Call prepare_to_wait for TARGET_WAITKIND_IGNORE. Update comment. * target.h: Update comment for TARGET_WAITKIND_IGNORE.
Diffstat (limited to 'gdb/hppah-nat.c')
-rw-r--r--gdb/hppah-nat.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/gdb/hppah-nat.c b/gdb/hppah-nat.c
index d5767a9c55f..17614073e22 100644
--- a/gdb/hppah-nat.c
+++ b/gdb/hppah-nat.c
@@ -524,13 +524,23 @@ child_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
return pid_to_ptid (pid);
}
- if (hpux_has_forked (pid, &related_pid)
- && ((pid == PIDGET (inferior_ptid))
- || (related_pid == PIDGET (inferior_ptid))))
+ if (hpux_has_forked (pid, &related_pid))
{
- ourstatus->kind = TARGET_WAITKIND_FORKED;
- ourstatus->value.related_pid = related_pid;
- return pid_to_ptid (pid);
+ /* Ignore the parent's fork event. */
+ if (pid == PIDGET (inferior_ptid))
+ {
+ ourstatus->kind = TARGET_WAITKIND_IGNORE;
+ return inferior_ptid;
+ }
+
+ /* If this is the child's fork event, report that the
+ process has forked. */
+ if (related_pid == PIDGET (inferior_ptid))
+ {
+ ourstatus->kind = TARGET_WAITKIND_FORKED;
+ ourstatus->value.related_pid = pid;
+ return inferior_ptid;
+ }
}
if (hpux_has_vforked (pid, &related_pid)