13.9. Debug exception

When a Software debug event occurs and Monitor debug-mode is selected and enabled and the core is in a state that permits debug then a Debug exception is taken. Prefetch Abort and Data Abort Vector catch debug events are ignored though. Unlinked context ID and any IMVA mismatch breakpoint debug events are also ignored if the processor is running in a privileged mode and Monitor debug-mode is selected and enabled. If the cause of the Debug exception is a watchpoint debug event, the processor performs the following actions:

The Data Abort handler is responsible for checking the DFSR bit to determine if the routine entry was caused by a debug exception or a Data Abort exception. On entry:

  1. It must first check for the presence of a debug monitor target.

  2. If present, the handler must disable the active watchpoints. This is necessary to prevent corruption of the FAR because of an unexpected watchpoint debug event when servicing a Data Abort exception.

  3. If the cause is a Debug exception the Data Abort handler branches to the debug monitor target.

    Note

    • the watchpointed address can be found in the FAR

    • the address of the instruction that caused the watchpoint debug event can be found in the WFAR

    • the address of the instruction to restart at plus 0x08 can be found in the R14_abt register.

If the cause of the Debug exception is a breakpoint, software breakpoint or vector catch debug event, the processor performs the following actions:

The Prefetch Abort handler is responsible for checking the IFSR bits to find out if the routine entry is caused by a Debug exception or a Prefetch Abort exception. If the cause is a Debug exception it branches to the debug monitor target.

Note

The address of the instruction causing the Software debug event plus 0x04 can be found in the R14_abt register.

Table 13.24 lists the values in the link register after exceptions.

Table 13.24. Values in the link register after exceptions

Cause of the faultARMThumbJazelleReturn address (RA[a]) meaning
BreakpointRA+4RA+4RA+4Breakpointed instruction address
WatchpointRA+8RA+8RA+8Address of the instruction where the execution resumes, a number of instructions after the one that hit the watchpoint
BKPT instructionRA+4RA+4RA+4BKPT instruction address
Vector catchRA+4RA+4RA+4Vector address
Prefetch AbortRA+4RA+4RA+4Address of the instruction where the execution resumes
Data AbortRA+8RA+8RA+8Address of the instruction where the execution resumes

[a] This is the address of the instruction that the processor first executes on Debug state exit. Watchpoints can be imprecise.

RA is not the address of the instruction immediately after the one that hit the watchpoint, the processor might stop a number of instructions later. The address of the instruction that hit the watchpoint is in the CP15 WFAR.


Copyright © 2004-2009 ARM Limited. All rights reserved.ARM DDI 0333H
Non-Confidential