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.

Address<br />

of object<br />

Table 12-60 shows some examples.<br />

Example 12-9 shows the code for setting a simple unaligned watchpoint.<br />

Debug<br />

Example 12-9 Setting a simple unaligned watchpoint<br />

bool SetSimpleWatchpoint(int watch_num, uint32 address, int size)<br />

{<br />

// Step 1. Disable the watchpoint being set.<br />

WriteDebugRegister(112 + watch_num, 0x0);<br />

// Step 2. Write addresses to the WVRs, leaving the bottom 3 bits zero.<br />

WriteDebugRegister(96 + watch_num, (address & 0xFFFFFF8));<br />

// Step 3. Determine the byte address select value to use.<br />

byte_address_select := (1'b1 3));<br />

}<br />

// Step 6. Return flag to caller indicating if second watchpoint was used.<br />

return (byte_address_select >= 9'b100000000)<br />

}<br />

12.11.3 Single-stepping<br />

Object size<br />

in bytes<br />

Table 12-60 Example byte address masks for watchpointed objects<br />

First address<br />

value<br />

First byte address<br />

mask<br />

Second address<br />

value<br />

0x00008000 1 0x00008000 b00000001 Not required -<br />

0x00008007 1 0x00008000 b10000000 Not required -<br />

0x00009000 2 0x00009000 b00000011 Not required -<br />

0x0000900c 2 0x00009000 b11000000 Not required -<br />

Second byte<br />

address mask<br />

0x0000900d 2 0x00009000 b10000000 0x00009008 b00000001<br />

0x0000A000 4 0x0000A000 b00001111 Not required -<br />

0x0000A003 4 0x0000A000 b01111000 Not required -<br />

0x0000A005 4 0x0000A000 b11100000 0x0000A008 b00000001<br />

0x0000B000 8 0x0000B000 b11111111 Not required -<br />

0x0000B001 8 0x0000B000 b11111110 0x0000B008 b00000001<br />

You can use the breakpoint mismatch bit to implement single-stepping on the processor. Unlike<br />

high-level stepping, single-stepping implements a low-level step that executes a single<br />

instruction at a time. With high-level stepping, the instruction is decoded to determine the<br />

address of the next instruction and a breakpoint is set at that address.<br />

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

ID060510 Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!