From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4315 invoked by alias); 15 Dec 2002 20:07:38 -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 4308 invoked from network); 15 Dec 2002 20:07:37 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 15 Dec 2002 20:07:37 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18NgvZ-0002Ki-00 for ; Sun, 15 Dec 2002 16:08:01 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18Nf40-0005mg-00 for ; Sun, 15 Dec 2002 15:08:36 -0500 Date: Sun, 15 Dec 2002 12:17:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: PATCH: Fork event updates, part the tenth Message-ID: <20021215200836.GA22182@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/msg00458.txt.bz2 Right now, there are four calls to bpstat_stop_status in infrun.c. Three of them are for catchpoints; right now, catchpoints should not be affected by DECR_PC_AFTER_BREAK, because they aren't breakpoints. Hopefully DECR_PC_AFTER_BREAK will be gone from this code if anyone ever has a target where they _are_ breakpoints. So, since a catchpoint is not a software breakpoint, we can just pass "1" for NOT_A_SW_BREAKPOINT. This prevents an incorrect PC decrement on i386-linux with the upcoming fork catchpoint patches. Committed. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer 2002-12-15 Daniel Jacobowitz * infrun.c (handle_inferior_event): Assume that catchpoints are not affected by DECR_PC_AFTER_BREAK. Index: infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.88 diff -u -p -r1.88 infrun.c --- infrun.c 13 Dec 2002 21:57:40 -0000 1.88 +++ infrun.c 15 Dec 2002 20:03:39 -0000 @@ -1335,17 +1335,15 @@ handle_inferior_event (struct execution_ stop_pc = read_pc_pid (ecs->ptid); ecs->saved_inferior_ptid = inferior_ptid; inferior_ptid = ecs->ptid; - /* The second argument of bpstat_stop_status is meant to help - distinguish between a breakpoint trap and a singlestep trap. - This is only important on targets where DECR_PC_AFTER_BREAK - is non-zero. The prev_pc test is meant to distinguish between - singlestepping a trap instruction, and singlestepping thru a - jump to the instruction following a trap instruction. */ - - stop_bpstat = bpstat_stop_status (&stop_pc, - currently_stepping (ecs) && - prev_pc != - stop_pc - DECR_PC_AFTER_BREAK); + + /* 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; @@ -1386,17 +1384,15 @@ handle_inferior_event (struct execution_ } stop_pc = read_pc (); - /* The second argument of bpstat_stop_status is meant to help - distinguish between a breakpoint trap and a singlestep trap. - This is only important on targets where DECR_PC_AFTER_BREAK - is non-zero. The prev_pc test is meant to distinguish between - singlestepping a trap instruction, and singlestepping thru a - jump to the instruction following a trap instruction. */ - - stop_bpstat = bpstat_stop_status (&stop_pc, - currently_stepping (ecs) && - prev_pc != - stop_pc - DECR_PC_AFTER_BREAK); + + /* 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); goto process_event_stop_test; @@ -1435,17 +1431,15 @@ handle_inferior_event (struct execution_ stop_pc = read_pc_pid (ecs->ptid); ecs->saved_inferior_ptid = inferior_ptid; inferior_ptid = ecs->ptid; - /* The second argument of bpstat_stop_status is meant to help - distinguish between a breakpoint trap and a singlestep trap. - This is only important on targets where DECR_PC_AFTER_BREAK - is non-zero. The prev_pc test is meant to distinguish between - singlestepping a trap instruction, and singlestepping thru a - jump to the instruction following a trap instruction. */ - - stop_bpstat = bpstat_stop_status (&stop_pc, - currently_stepping (ecs) && - prev_pc != - stop_pc - DECR_PC_AFTER_BREAK); + + /* 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;