diff options
author | Daniel Jacobowitz <drow@false.org> | 2002-12-11 01:25:19 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2002-12-11 01:25:19 +0000 |
commit | 8e7d2c16952df15b6628a9f2ee985086a408561f (patch) | |
tree | c39b3c5c7dde47826abe888b4e584aabf475d45c /gdb/hppah-nat.c | |
parent | 3b01a667ff2681cff92b24fee4def45f643f74ba (diff) | |
download | gdb-8e7d2c16952df15b6628a9f2ee985086a408561f.zip gdb-8e7d2c16952df15b6628a9f2ee985086a408561f.tar.gz gdb-8e7d2c16952df15b6628a9f2ee985086a408561f.tar.bz2 |
* 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.c | 22 |
1 files changed, 16 insertions, 6 deletions
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) |