summaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2004-01-31 19:59:06 +0000
committerDaniel Jacobowitz <dan@debian.org>2004-01-31 19:59:06 +0000
commit27c464e28f467665de5de2ac785ffc2b239a4bd3 (patch)
tree3adcf36a7ff2166e70740a5487152aacd1a9748a /gdb/infrun.c
parentb69316e35c19ede00559bbe669f41166cd1a7a78 (diff)
downloadgdb-27c464e28f467665de5de2ac785ffc2b239a4bd3.tar.gz
* 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 da67e4b0662..5ab604c9033 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;