From 8e7d2c16952df15b6628a9f2ee985086a408561f Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Wed, 11 Dec 2002 01:25:19 +0000 Subject: * 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. --- gdb/hppah-nat.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'gdb/hppah-nat.c') diff --git a/gdb/hppah-nat.c b/gdb/hppah-nat.c index d5767a9..1761407 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) -- cgit v1.1