When the user types a 'b' command to set a breakpoint. The Monitor decides which type of breakpoint to utilize using the following algorithm:
if (is_writeable(addr)) bptype = RAM; else if (is_cacheable(addr) && cpu_has_ilock) bptype = ILOCK; else if (cpu_has_hwbp) bptype = HW; else error();
This information is saved in an array. When execution is started, the Monitor walks through the breakpoint array and implements the breakpoints using the following rules:
Thus, if the memory is inspected, the break instructions will never be seen, as they are only present in memory during execution of the application program.
The only exception to this is if the program hangs in such a way as to require the user to press reset on the target system. In this case the Monitor will "forget" that breakpoints had been set, and so you will see any RAM breakpoints as break instructions in memory. At this point the application program must be re-downloaded to obtain correct execution.
ab_cmd ---->setHwdbpt------+
' | +--------+
setbp -----------+ '''''''|''''''''| |
| | | Bpt[] |
when ------------+ | | |
| '''''|''''''''| |
v ' | +--------+
setTrigger ---+
|
trace (sstep) -------------+
|
c temp --------------------+
|
g . temp ------------------+ [imon95]
|
.................................................................
|
ibpt32 | [serialice1.dll]
| |
v |
ibpt32m -------------------+
|
dbpt32 |
| |
v |
dbpt32m -------------------+
|
| +-----------+
v | |
setbp_target '''''''''''| brkList[] |
| | | |
v | +-----------+
brkInstall |
v
brkRemove
|