09.12.2012 Views

Cortex-A8 Technical Reference Manual - ARM Information Center

Cortex-A8 Technical Reference Manual - ARM Information Center

Cortex-A8 Technical Reference Manual - ARM Information Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

debug.<br />

if ((state->dscr & (1pc - 8;<br />

}<br />

// Step 6. If the method of entry was Watchpoint Occurred, read the WFAR<br />

// register<br />

method_of_debug_entry := ((state->dscr >> 10) & 0xF;<br />

if (method_of_debug_entry == 2'b0010 || method_of_debug_entry == 2'b1010)<br />

{<br />

state->wfar := ReadDebugRegister(6);<br />

}<br />

}<br />

12.11.5 Debug state exit<br />

Debug<br />

When exiting debug state, the program counter must always be written. If the execution state or<br />

CPSR must be changed, this must be done before writing to the PC because writing to the CPSR<br />

can affect the PC.<br />

Having restored the program state, the debugger can restart by writing to bit [1] of the Debug<br />

Run Control Register. It must then poll bit [1] of the Debug Status and Control Register to<br />

determine if the core has restarted.<br />

Example 12-12 shows the code for exit from debug state.<br />

ExitDebugState(PROCESSOR_STATE *state)<br />

{<br />

Example 12-12 Leaving debug state<br />

<strong>ARM</strong> DDI 0344K Copyright © 2006-2010 <strong>ARM</strong> Limited. All rights reserved. 12-77<br />

ID060510 Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!