From cb6b02027c32b484c6a9bf3c348333ab6501926b Mon Sep 17 00:00:00 2001 From: Jim Kingdon Date: Wed, 22 Sep 1993 01:16:50 +0000 Subject: [PATCH] * breakpoint.h, breakpoint.c (bpstat_stop_status): Add new argument not_a_breakpoint. * infrun.c (wait_for_inferior): Pass it. Also consolidate the test of whether we are stepping into a CURRENTLY_STEPPING macro. --- gdb/ChangeLog | 10 ++++++++- gdb/breakpoint.c | 17 ++++++++++----- gdb/infrun.c | 54 +++++++++++++++++++++++------------------------- 3 files changed, 47 insertions(+), 34 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5726f0a7d7..3008322e39 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,8 +1,16 @@ +Tue Sep 21 17:48:14 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * breakpoint.h, breakpoint.c (bpstat_stop_status): Add new argument + not_a_breakpoint. + * infrun.c (wait_for_inferior): Pass it. Also consolidate the + test of whether we are stepping into a CURRENTLY_STEPPING macro. + Tue Sep 21 17:22:34 1993 K. Richard Pixley (rich@sendai.cygnus.com) * breakpoint.c (bpstat_stop_status), infcmd.c (step_1), - infrun.c (wait_for_inferior): collapse SHIFT_INST_REGS ifdef and insert macro. + infrun.c (wait_for_inferior): collapse SHIFT_INST_REGS ifdef + and insert macro. * m88k-tdep.c: include ieee-float.h. new global target_is_m88110. new const struct ext_format_m88110 for float format. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 6facde0666..faa3da4cf3 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -1003,14 +1003,18 @@ print_it_noop (bs) return -1; } +/* Get a bpstat associated with having just stopped at address *PC + and frame address FRAME_ADDRESS. Update *PC to point at the + breakpoint (if we hit a breakpoint). NOT_A_BREAKPOINT is nonzero + if this is known to not be a real breakpoint (it could still be a + watchpoint, though). */ + /* Determine whether we stopped at a breakpoint, etc, or whether we don't understand this stop. Result is a chain of bpstat's such that: if we don't understand the stop, the result is a null pointer. - if we understand why we stopped, the result is not null, and - the first element of the chain contains summary "stop" and - "print" flags for the whole chain. + if we understand why we stopped, the result is not null. Each element of the chain refers to a particular breakpoint or watchpoint at which we have stopped. (We may have stopped for @@ -1021,11 +1025,11 @@ print_it_noop (bs) */ - bpstat -bpstat_stop_status (pc, frame_address) +bpstat_stop_status (pc, frame_address, not_a_breakpoint) CORE_ADDR *pc; FRAME_ADDR frame_address; + int not_a_breakpoint; { register struct breakpoint *b; CORE_ADDR bp_addr; @@ -1049,6 +1053,9 @@ bpstat_stop_status (pc, frame_address) if (b->type != bp_watchpoint && b->address != bp_addr) continue; + if (b->type != bp_watchpoint && not_a_breakpoint) + continue; + /* Come here if it's a watchpoint, or if the break address matches */ bs = bpstat_alloc (b, bs); /* Alloc a bpstat to explain stop */ diff --git a/gdb/infrun.c b/gdb/infrun.c index 3656c98ed9..b3484a157c 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -481,6 +481,13 @@ wait_for_inferior () sal = find_pc_line(prev_pc, 0); current_line = sal.line; + /* Are we stepping? */ +#define CURRENTLY_STEPPING() ((step_resume_breakpoint == NULL \ + && !handling_longjmp \ + && (step_range_end \ + || trap_expected)) \ + || bpstat_should_step ()) + while (1) { /* Clean up saved state that will become invalid. */ @@ -696,25 +703,24 @@ wait_for_inferior () else { /* See if there is a breakpoint at the current PC. */ + stop_bpstat = bpstat_stop_status + (&stop_pc, stop_frame_address, #if DECR_PC_AFTER_BREAK - /* Notice the case of stepping through a jump - that lands just after a breakpoint. - Don't confuse that with hitting the breakpoint. - What we check for is that 1) stepping is going on - and 2) the pc before the last insn does not match - the address of the breakpoint before the current pc. */ - if (prev_pc == stop_pc - DECR_PC_AFTER_BREAK - || !step_range_end - || step_resume_breakpoint != NULL - || handling_longjmp /* FIXME */) -#endif /* DECR_PC_AFTER_BREAK not zero */ - { - stop_bpstat = - bpstat_stop_status (&stop_pc, stop_frame_address); - /* Following in case break condition called a - function. */ - stop_print_frame = 1; - } + /* Notice the case of stepping through a jump + that lands just after a breakpoint. + Don't confuse that with hitting the breakpoint. + What we check for is that 1) stepping is going on + and 2) the pc before the last insn does not match + the address of the breakpoint before the current pc. */ + (prev_pc != stop_pc - DECR_PC_AFTER_BREAK + && CURRENTLY_STEPPING ()) +#else /* DECR_PC_AFTER_BREAK zero */ + 0 +#endif /* DECR_PC_AFTER_BREAK zero */ + ); + /* Following in case break condition called a + function. */ + stop_print_frame = 1; } if (stop_signal == SIGTRAP) @@ -1207,10 +1213,7 @@ step_into_function: /* We took a signal (which we are supposed to pass through to the inferior, else we'd have done a break above) and we haven't yet gotten our trap. Simply continue. */ - resume ((step_range_end && step_resume_breakpoint == NULL) - || (trap_expected && step_resume_breakpoint == NULL) - || bpstat_should_step (), - stop_signal); + resume (CURRENTLY_STEPPING (), stop_signal); } else { @@ -1267,12 +1270,7 @@ step_into_function: } #endif /* SHIFT_INST_REGS */ - resume ((step_resume_breakpoint == NULL - && !handling_longjmp - && (step_range_end - || trap_expected)) - || bpstat_should_step (), - stop_signal); + resume (CURRENTLY_STEPPING (), stop_signal); } } -- 2.34.1