* 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.
This commit is contained in:
Daniel Jacobowitz 2002-12-11 01:25:19 +00:00
parent 3b01a667ff
commit 8e7d2c1695
4 changed files with 37 additions and 32 deletions

View File

@ -1,3 +1,11 @@
2002-12-06 Daniel Jacobowitz <drow@mvista.com>
* 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.
2002-12-10 Andrew Cagney <ac131313@redhat.com>
* PROBLEMS: Delete reference to PR gdb/725.

View File

@ -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)

View File

@ -1478,24 +1478,9 @@ handle_inferior_event (struct execution_control_state *ecs)
stop_signal = TARGET_SIGNAL_TRAP;
pending_follow.kind = ecs->ws.kind;
/* Ignore fork events reported for the parent; we're only
interested in reacting to forks of the child. Note that
we expect the child's fork event to be available if we
waited for it now. */
if (ptid_equal (inferior_ptid, ecs->ptid))
{
pending_follow.fork_event.saw_parent_fork = 1;
pending_follow.fork_event.parent_pid = PIDGET (ecs->ptid);
pending_follow.fork_event.child_pid = ecs->ws.value.related_pid;
prepare_to_wait (ecs);
return;
}
else
{
pending_follow.fork_event.saw_child_fork = 1;
pending_follow.fork_event.child_pid = PIDGET (ecs->ptid);
pending_follow.fork_event.parent_pid = ecs->ws.value.related_pid;
}
pending_follow.fork_event.saw_child_fork = 1;
pending_follow.fork_event.parent_pid = PIDGET (ecs->ptid);
pending_follow.fork_event.child_pid = ecs->ws.value.related_pid;
stop_pc = read_pc_pid (ecs->ptid);
ecs->saved_inferior_ptid = inferior_ptid;
@ -1703,13 +1688,15 @@ handle_inferior_event (struct execution_control_state *ecs)
/* We had an event in the inferior, but we are not interested
in handling it at this level. The lower layers have already
done what needs to be done, if anything. This case can
occur only when the target is async or extended-async. One
of the circumstamces for this to happen is when the
inferior produces output for the console. The inferior has
not stopped, and we are ignoring the event. */
done what needs to be done, if anything.
One of the possible circumstances for this is when the
inferior produces output for the console. The inferior has
not stopped, and we are ignoring the event. Another possible
circumstance is any event which the lower level knows will be
reported multiple times without an intervening resume. */
case TARGET_WAITKIND_IGNORE:
ecs->wait_some_more = 1;
prepare_to_wait (ecs);
return;
}

View File

@ -112,8 +112,8 @@ enum target_waitkind
inferior. */
TARGET_WAITKIND_SPURIOUS,
/* This is used for target async and extended-async
only. Remote_async_wait() returns this when there is an event
/* An event has occured, but we should wait again.
Remote_async_wait() returns this when there is an event
on the inferior, but the rest of the world is not interested in
it. The inferior has not stopped, but has just sent some output
to the console, for instance. In this case, we want to go back