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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

12.11 Using the debug functionality<br />

Debug<br />

This section provides some examples of using the debug functionality, both from the point of<br />

view of a software engineer writing code to run on an <strong>ARM</strong> processor and of a developer<br />

creating debug tools for the processor. In the former case, examples are given in <strong>ARM</strong> assembly<br />

language. In the latter case, the examples are in C pseudo-language, intended to convey the<br />

algorithms to be used. These examples are not intended as source code for a debugger.<br />

The debugger examples use a pair of pseudo-functions such as the following:<br />

uint32 ReadDebugRegister(int reg_num)<br />

{<br />

// read the value of the debug register reg_num at address reg_num > 2<br />

}<br />

12.11.1 Debug communications channel<br />

A basic function for using the debug state is executing an instruction through the ITR.<br />

Example 12-1 shows the sequence for executing an <strong>ARM</strong> instruction through the ITR.<br />

Execute<strong>ARM</strong>Instruction(uint32 instr)<br />

{<br />

// Step 1. Poll DSCR until InstrCompl is set to 1.<br />

repeat<br />

{<br />

dscr := ReadDebugRegister(34);<br />

}<br />

until (dscr & (1

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

Saved successfully!

Ooh no, something went wrong!