aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2004-01-31 19:59:06 +0000
committerDaniel Jacobowitz <drow@false.org>2004-01-31 19:59:06 +0000
commit9709f61c0fccde8b375d86cd8c515431c29f76d3 (patch)
treeabbb033d20c212a408239fa943e5b128e08d3027 /gdb/infrun.c
parent4f1280bb7168b0b4679f185fe35e5abd31acfa36 (diff)
downloadfsf-binutils-gdb-9709f61c0fccde8b375d86cd8c515431c29f76d3.zip
fsf-binutils-gdb-9709f61c0fccde8b375d86cd8c515431c29f76d3.tar.gz
fsf-binutils-gdb-9709f61c0fccde8b375d86cd8c515431c29f76d3.tar.bz2
* breakpoint.c (bpstat_stop_status): Remove not_a_sw_breakpoint
argument, and change first argument to a CORE_ADDR. * breakpoint.h (bpstat_stop_status): Update prototype. * infrun.c (adjust_pc_after_break): Add a new comment. (handle_inferior_event): Update calls to bpstat_stop_status.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c44
1 files changed, 8 insertions, 36 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index da67e4b..5ab604c 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1325,6 +1325,11 @@ adjust_pc_after_break (struct execution_control_state *ecs)
/* If we've hit a breakpoint, we'll normally be stopped with SIGTRAP. If
we aren't, just return.
+
+ We assume that waitkinds other than TARGET_WAITKIND_STOPPED are not
+ affected by DECR_PC_AFTER_BREAK. Other waitkinds which are implemented
+ by software breakpoints should be handled through the normal breakpoint
+ layer.
NOTE drow/2004-01-31: On some targets, breakpoints may generate
different signals (SIGILL or SIGEMT for instance), but it is less
@@ -1584,13 +1589,7 @@ handle_inferior_event (struct execution_control_state *ecs)
stop_pc = read_pc ();
- /* 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);
+ stop_bpstat = bpstat_stop_status (stop_pc);
ecs->random_signal = !bpstat_explains_signal (stop_bpstat);
@@ -1639,13 +1638,7 @@ handle_inferior_event (struct execution_control_state *ecs)
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);
+ stop_bpstat = bpstat_stop_status (stop_pc);
ecs->random_signal = !bpstat_explains_signal (stop_bpstat);
inferior_ptid = ecs->saved_inferior_ptid;
@@ -2035,29 +2028,8 @@ handle_inferior_event (struct execution_control_state *ecs)
else
{
/* See if there is a breakpoint at the current PC. */
+ stop_bpstat = bpstat_stop_status (stop_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.
-
- Therefore, pass TRUE if our reason for stopping is
- something other than hitting a breakpoint. We do this by
- checking that either: we detected earlier a software single
- step trap or, 1) stepping is going on and 2) we didn't hit
- a breakpoint in a signal handler without an intervening stop
- in sigtramp, which is detected by a new stack pointer value
- below any usual function calling stack adjustments. */
- stop_bpstat =
- bpstat_stop_status
- (&stop_pc,
- sw_single_step_trap_p
- || (currently_stepping (ecs)
- && prev_pc != stop_pc - DECR_PC_AFTER_BREAK
- && !(step_range_end
- && INNER_THAN (read_sp (), (step_sp - 16)))));
/* Following in case break condition called a
function. */
stop_print_frame = 1;