This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
PATCH: Fork event updates, part the eighth
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Thu, 12 Dec 2002 18:55:58 -0500
- Subject: PATCH: Fork event updates, part the eighth
This just removes some now-dead code in infrun. Committed. The only
interesting bit is the little at the end which removes another legacy of two
separate VFORKED events.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2002-12-12 Daniel Jacobowitz <drow@mvista.com>
* infrun.c (pending_follow): Remove saw_parent_fork, saw_child_fork,
and saw_child_exec.
(follow_fork, init_wait_for_inferior, handle_inferior_event): Remove
references to saw_parent_fork, saw_child_fork, and saw_child_exec.
(stop_stepping): Remove outdated check for child vfork events.
Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.86
diff -u -p -r1.86 infrun.c
--- infrun.c 11 Dec 2002 22:34:47 -0000 1.86
+++ infrun.c 12 Dec 2002 22:30:38 -0000
@@ -355,10 +355,7 @@ static struct
struct
{
int parent_pid;
- int saw_parent_fork;
int child_pid;
- int saw_child_fork;
- int saw_child_exec;
}
fork_event;
char *execd_pathname;
@@ -393,9 +390,6 @@ follow_fork ()
/* follow_mode = follow_fork_mode_...; */
}
- pending_follow.fork_event.saw_parent_fork = 0;
- pending_follow.fork_event.saw_child_fork = 0;
-
return target_follow_fork (follow_child);
}
@@ -870,9 +864,6 @@ init_wait_for_inferior (void)
/* The first resume is not following a fork/vfork/exec. */
pending_follow.kind = TARGET_WAITKIND_SPURIOUS; /* I.e., none. */
- pending_follow.fork_event.saw_parent_fork = 0;
- pending_follow.fork_event.saw_child_fork = 0;
- pending_follow.fork_event.saw_child_exec = 0;
/* See wait_for_inferior's handling of SYSCALL_ENTRY/RETURN events. */
number_of_threads_in_syscalls = 0;
@@ -1338,7 +1329,6 @@ handle_inferior_event (struct execution_
stop_signal = TARGET_SIGNAL_TRAP;
pending_follow.kind = ecs->ws.kind;
- 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;
@@ -1379,7 +1369,6 @@ handle_inferior_event (struct execution_
triggers...) */
if (ptid_equal (ecs->ptid, inferior_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;
}
@@ -1389,7 +1378,6 @@ handle_inferior_event (struct execution_
Else, give any vfork catchpoints a chance to trigger now. */
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;
target_post_startup_inferior (pid_to_ptid
@@ -2820,30 +2808,6 @@ stop_stepping (struct execution_control_
{
if (target_has_execution)
{
- /* Are we stopping for a vfork event? We only stop when we see
- the child's event. However, we may not yet have seen the
- parent's event. And, inferior_ptid is still set to the
- parent's pid, until we resume again and follow either the
- parent or child.
-
- To ensure that we can really touch inferior_ptid (aka, the
- parent process) -- which calls to functions like read_pc
- implicitly do -- wait on the parent if necessary. */
- if ((pending_follow.kind == TARGET_WAITKIND_VFORKED)
- && !pending_follow.fork_event.saw_parent_fork)
- {
- ptid_t parent_ptid;
-
- do
- {
- if (target_wait_hook)
- parent_ptid = target_wait_hook (pid_to_ptid (-1), &(ecs->ws));
- else
- parent_ptid = target_wait (pid_to_ptid (-1), &(ecs->ws));
- }
- while (!ptid_equal (parent_ptid, inferior_ptid));
- }
-
/* Assuming the inferior still exists, set these up for next
time, just like we did above if we didn't break out of the
loop. */