8.10.1. Breakpoint

Entry to the debug state from a breakpoint advances the PC by 4 addresses, or 16 bytes. Each instruction executed in debug state advances the PC by 1 address, or 4 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 ARM7DMT 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, +1 for the final branch).

The following sequence shows the data scanned into scan chain 1. This is msb (most signifigant bit) first, and so the first digit is the value placed in the BREAKPT bit, followed by the instruction data:

0 E0802000    ; ADD R2, R0, R0
1 E1826001    ; ORR R6, R2, R1
0 EAFFFFF9    ; B -7 (2’s complement)

Once in debug state, a minimum of two instructions must be executed before the branch, although these may both be NOPs, for example:

MOV R0, R0

For small branches, the final branch could be replaced by a subtract with the PC as the destination:

SUB PC, PC, #28
Copyright © 1997, 1998 ARM Limited. All rights reserved.DDI 0087E
Non-Confidential