05.02.2013 Views

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

C5.3 Behavior of the PC <strong>and</strong> CPSR in Debug state<br />

Debug event<br />

Debug State<br />

Processing is halted on entry to Debug state, see Entering Debug state on page C5-3. After the processor<br />

has entered Debug state, a read of the PC returns a return address plus an offset. The return address depends<br />

on the type of debug event, <strong>and</strong> the offset depends on the instruction set state of the processor when Debug<br />

state was entered. Table C5-1 shows the values returned by a read of the PC.<br />

PC value, for instruction set state on Debug entry<br />

<strong>ARM</strong><br />

Thumb or<br />

ThumbEE<br />

Jazelle b<br />

Table C5-1 PC value while in Debug state<br />

Meaning of return address<br />

(RA) a obtained from PC read<br />

Breakpoint RA + 8 RA + 4 RA + Offset Breakpointed instruction address<br />

Synchronous<br />

Watchpoint<br />

Asynchronous<br />

Watchpoint<br />

BKPT<br />

instruction<br />

RA + 8 RA + 4 RA + Offset Address of the instruction that<br />

triggered the watchpoint c<br />

RA + 8 RA + 4 RA + Offset Address of the instruction for the<br />

execution to resume d<br />

RA + 8 RA + 4 RA + Offset BKPT instruction address<br />

Vector Catch RA + 8 RA + 4 RA + Offset Vector address<br />

External Debug<br />

Request<br />

RA + 8 RA + 4 RA + Offset Address of the instruction for the<br />

execution to resume<br />

Halt Request RA + 8 RA + 4 RA + Offset Address of the instruction for the<br />

execution to resume<br />

OS Unlock<br />

Catch<br />

RA + 8 RA + 4 RA + Offset Address of the instruction for the<br />

execution to resume<br />

a. Return address (RA) is the address of the first instruction that the processor must execute on exit from Debug state. This<br />

enables program execution to continue from where it stopped.<br />

b. Offset is an IMPLEMENTATION DEFINED value that is constant <strong>and</strong> documented.<br />

c. Returning to RA has the effect of retrying the instruction. This can have implications under the memory order model.<br />

See Synchronous <strong>and</strong> Asynchronous Watchpoint debug events on page C3-18.<br />

d. RA is not the address of the instruction that triggered the watchpoint, but one that was executed some number of<br />

instructions later. The address of the instruction that triggered the watchpoint can be discovered from the value in the<br />

DBGWFAR. See Watchpoint Fault Address Register (DBGWFAR) on page C10-28.<br />

On entry to Debug state, the value of the CPSR is the value that the instruction at the return address would<br />

have been executed with, if it had not been cancelled by the debug event.<br />

<strong>ARM</strong> DDI 0406B Copyright © 1996-1998, 2000, 2004-2008 <strong>ARM</strong> Limited. All rights reserved. C5-7

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!