
B-20
Detailed Debug Operation
Rev. A
Copyright 2000 by LSI Logic Corporation. All rights reserved.
B.8.1 Breakpoints
Entry into debug state from a breakpoint advances the PC by four
addresses, or 16 bytes. Each instruction executed in debug state
advances the PC by one address, or four bytes.
The normal way to exit from debug state after a breakpoint is to remove
the breakpoint and branch back to the previously-breakpointed address.
For example, if the ARM7TDMI-S core entered debug state from a
breakpoint set on a given address and two debug speed instructions
were executed, a branch of –7 addresses must occur (4 for debug entry,
2 for the instructions, and 1 for the final branch).
The following sequence shows the data scanned into Scan Chain 1, most
significant bit first. The value of the first digit goes to the DBGBREAK bit,
and then the instruction data into the remainder of Scan Chain 1:
0 E0802000; ADD R2, R0, R0
1 E1826001; ORR R6, R2, R1
0 EAFFFFF9; B 7 (2’s complement)
After the ARM7TDMI-S core enters debug state, it must execute a
minimum of two instructions before the branch, although these may both
be NOPs (
MOV R0, R0
). For small branches, you could replace the final
branch with a subtract, with the PC as the destination (
SUB PC, PC, #28
in the above example).
B.8.2 Watchpoints
The return to program execution after entry to debug state from a
watchpoint is done in the same way as the procedure described in
Section B.8.1, “Breakpoints,”
above.
Debug entry adds four addresses to the PC, and every instruction adds
one address. The difference from a breakpoint is that the instruction that
caused the watchpoint has executed, and the program should return to
the next instruction.
B.8.3 Watchpoint with Another Exception
If a watchpointed access simultaneously causes a data abort, the
ARM7TDMI-S core enters debug state in abort mode. Entry into debug