Breakpoints are used to suspend execution when certain conditions are met.
Breakpoints are normally set in code, so that when a given instruction is reached, the breakpoint occurs and the debugger is called. The breakpoint occurs before the instruction is executed. These breakpoints are set by replacing the first byte of the instruction at the breakpoint address with an INT 3 instruction (0xCC), remembering the replaced byte. When a breakpoint occurs, the byte is restored so that the instruction can be executed.
Breakpoints can also be set such that the debugger will be invoked on a data reference. In this case, the breakpoint happens after the data reference. Data reference breakpoints are implemented using the processor's four debug registers, and may not be used when an ICE (In-Circuit Emulator) is in use on the system.
Commands may be given to the debugger to be executed when a breakpoint is encountered. If the debugger is in control after the breakpoint (in other words, the breakpoint commands did not call quit), the debugger displays the breakpoint value and name.
Use the breakpoint commands to set, list, and clear breakpoints:
bc addr|*|DRn /* Breakpoint clear */ bl [name] /* Breakpoint list */ bp [[rwi][b|s|l]|x]] address [condition value] /* Breakpoint set */ bp mod address /* Modify breakpoint commands */ bp name address /* Breakpoint set with name */ bp [en|dis] address /* (En)able or (Dis)able previously set breakpoint */