From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5748 invoked by alias); 15 Dec 2002 20:17:00 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 5739 invoked from network); 15 Dec 2002 20:16:59 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 15 Dec 2002 20:16:59 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18Nh4c-0002Lh-00 for ; Sun, 15 Dec 2002 16:17:22 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18NfD4-0005tL-00 for ; Sun, 15 Dec 2002 15:17:58 -0500 Date: Sun, 15 Dec 2002 12:40:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: PATCH: Fork event updates, part the eleventh Message-ID: <20021215201758.GA22617@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.1i X-SW-Source: 2002-12/txt/msg00459.txt.bz2 The differences between the FORKED and VFORKED cases were all dead code now, so we can bring them together. Committed. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer 2002-12-15 Daniel Jacobowitz * infrun.c (handle_inferior_event): Merge TARGET_WAITKIND_FORKED and TARGET_WAITKIND_VFORKED cases. Index: infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.89 diff -u -p -r1.89 infrun.c --- infrun.c 15 Dec 2002 20:08:02 -0000 1.89 +++ infrun.c 15 Dec 2002 20:14:42 -0000 @@ -1326,62 +1326,12 @@ handle_inferior_event (struct execution_ /* 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 ();