This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch/ob] not_a_breakpoint -> not_a_sw_breakpoint


On Aug 16, 11:37am, Andrew Cagney wrote:


This patch renames the ``not_a_breakpoint'' parameter of bpstat_stop_status() to the more correct ``not_a_sw_breakpoint'' so that it is clear that it is indicating nothing about hardware breakpoints.

This may be a good change, but I don't think it's obvious.  Could
you at least explain the reasoning that lead you to conclude that
the parameter in question indicates nothing about hardware breakpoints?
The variable is used vis:

bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint)
{
[...]
/* Get the address where the breakpoint would have been. The
"not_a_sw_breakpoint" argument is meant to distinguish between a
breakpoint trap event and a trace/singlestep trap event. For a
trace/singlestep trap event, we would not want to subtract
DECR_PC_AFTER_BREAK from the PC. */

bp_addr = *pc - (not_a_sw_breakpoint && !SOFTWARE_SINGLE_STEP_P () ?
0 : DECR_PC_AFTER_BREAK);


Later in the code appears:

if (DECR_PC_AFTER_HW_BREAK != 0)
{
*pc = *pc - DECR_PC_AFTER_HW_BREAK;
write_pc (*pc);
}

if not_a_sw_breakpoint applied to hardware breakpoints then the above decrement would be guarded by not_a_sw_breakpoint.

BTW, an even more correct name is ``not_a_sw_breakpoint_trap''. However, Joel might end up adding something better than that.

I guess nothing is obvious :-(

enjoy,
Andrew



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]