Debug in depth
ARM DDI 0165B
Copyright 2000 ARM Limited. All rights reserved.
C-27
C.9
Priorities and exceptions
When a breakpoint or a debug request occurs, the normal flow of the program is
interrupted. Therefore you can treat debug as another type of exception. The interaction
C.9.1
Breakpoint with Prefetch Abort
When a breakpointed instruction fetch causes a Prefetch Abort, the abort is taken and
the breakpoint is disregarded. Normally, Prefetch Aborts occur when, for example, an
access is made to a virtual address that does not physically exist, and the returned data
is therefore invalid. In such a case, the normal action of the operating system is to swap
in the page of memory, and to return to the previously invalid address. This time, when
the instruction is fetched, and providing the breakpoint is activated (it might be
data-dependent), the ARM9E-S enters debug state.
The Prefetch Abort, therefore, takes higher priority than the breakpoint.
C.9.2
Interrupts
When the ARM9E-S enters debug state, interrupts are automatically disabled.
If an interrupt is pending during the instruction prior to entering debug state, the
ARM9E-S enters debug state in the mode of the interrupt. On entry to debug state, the
debugger cannot assume that the ARM9E-S is in the mode expected by your program.
The ARM9E-S must check the PC, the CPSR, and the SPSR to determine accurately the
reason for the exception.
Debug, therefore, takes higher priority than the interrupt, but the ARM9E-S does
recognize that an interrupt has occurred.
C.9.3
Data Aborts
When a Data Abort occurs on a watchpointed access, the ARM9E-S enters debug state
in Abort mode. The watchpoint, therefore, has higher priority than the abort, but the
ARM9E-S remembers that the abort happened.