aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2002-12-15 20:15:56 +0000
committerDaniel Jacobowitz <drow@false.org>2002-12-15 20:15:56 +0000
commitdeb3b17b03a6206093dd96039999c9043cb27c41 (patch)
treed345c58f19dc881d6c0d17f3131829aed5e352c7
parent675bf4cbc866316506d5aff06471c3580ba289fa (diff)
downloadgdb-deb3b17b03a6206093dd96039999c9043cb27c41.zip
gdb-deb3b17b03a6206093dd96039999c9043cb27c41.tar.gz
gdb-deb3b17b03a6206093dd96039999c9043cb27c41.tar.bz2
* infrun.c (handle_inferior_event): Merge TARGET_WAITKIND_FORKED
and TARGET_WAITKIND_VFORKED cases.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/infrun.c52
2 files changed, 6 insertions, 51 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 994556d..e1fe332 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2002-12-15 Daniel Jacobowitz <drow@mvista.com>
+ * infrun.c (handle_inferior_event): Merge TARGET_WAITKIND_FORKED
+ and TARGET_WAITKIND_VFORKED cases.
+
+2002-12-15 Daniel Jacobowitz <drow@mvista.com>
+
* infrun.c (handle_inferior_event): Assume that catchpoints
are not affected by DECR_PC_AFTER_BREAK.
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 2aaab67..043607a 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1326,63 +1326,13 @@ handle_inferior_event (struct execution_control_state *ecs)
/* The following are the only cases in which we keep going;
the above cases end in a continue or goto. */
case TARGET_WAITKIND_FORKED:
+ case TARGET_WAITKIND_VFORKED:
stop_signal = TARGET_SIGNAL_TRAP;
pending_follow.kind = ecs->ws.kind;
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;
- inferior_ptid = ecs->ptid;
-
- /* Assume that catchpoints are not really software breakpoints. If
- some future target implements them using software breakpoints then
- that target is responsible for fudging DECR_PC_AFTER_BREAK. Thus
- we pass 1 for the NOT_A_SW_BREAKPOINT argument, so that
- bpstat_stop_status will not decrement the PC. */
-
- stop_bpstat = bpstat_stop_status (&stop_pc, 1);
-
- ecs->random_signal = !bpstat_explains_signal (stop_bpstat);
- inferior_ptid = ecs->saved_inferior_ptid;
- goto process_event_stop_test;
-
- /* If this a platform which doesn't allow a debugger to touch a
- vfork'd inferior until after it exec's, then we'd best keep
- our fingers entirely off the inferior, other than continuing
- it. This has the unfortunate side-effect that catchpoints
- of vforks will be ignored. But since the platform doesn't
- allow the inferior be touched at vfork time, there's really
- little choice. */
- case TARGET_WAITKIND_VFORKED:
- stop_signal = TARGET_SIGNAL_TRAP;
- pending_follow.kind = ecs->ws.kind;
-
- /* Is this a vfork of the parent? If so, then give any
- vfork catchpoints a chance to trigger now. (It's
- dangerous to do so if the child canot be touched until
- it execs, and the child has not yet exec'd. We probably
- should warn the user to that effect when the catchpoint
- triggers...) */
- if (ptid_equal (ecs->ptid, inferior_ptid))
- {
- pending_follow.fork_event.parent_pid = PIDGET (ecs->ptid);
- pending_follow.fork_event.child_pid = ecs->ws.value.related_pid;
- }
-
- /* If we've seen the child's vfork event but cannot really touch
- the child until it execs, then we must continue the child now.
- Else, give any vfork catchpoints a chance to trigger now. */
- else
- {
- 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
- (pending_follow.fork_event.
- child_pid));
- }
-
stop_pc = read_pc ();
/* Assume that catchpoints are not really software breakpoints. If