Debug
ARM DDI 0301H
Copyright © 2004-2009 ARM Limited. All rights reserved.
13-48
ID012310
Non-Confidential, Unrestricted Access
2.
Clear the WCR[0] Enable Watchpoint and the BCRb[0] Enable breakpoint bits in the read
words and write them back to the WCR and BCRb. Now the watchpoint and the
breakpoint are disabled.
3.
Write the DMVA to the WVR register.
4.
Write the context ID to the BVRb register.
5.
Write to the WCR with its fields set as follows:
•
WCR[20] enable linking bit set, to link this WRP with the BRP indicated by
WCR[19:16], BRPb in this example
•
Binary representation of b into WCR[19:6] linked BRP field
•
WCR byte address select, load/store access, Secure access field, and supervisor
access fields as required
•
WCR[0] enable watchpoint bit set.
6.
Write to the BCRb with its fields set as follows:
•
BCRb[22:21] meaning of BVR bit set to b01, to indicate that the value loaded into
BVRb is to be compared against the CP15 Context ID Register.
•
BCRb[20] enable linking bit, set
•
BCR [15:14] Secure access set to b00
•
BCRb[8:5] byte address select set to b1111
•
BCRb[2:1] supervisor access set to b11
•
BCRb[0] enable breakpoint bit set.
13.14.3 Setting software breakpoint debug events (BKPT)
To set a software breakpoint on a particular virtual address, the debug monitor target must
perform the following steps:
1.
Read memory location and save actual instruction.
2.
Write BKPT instruction to the memory location.
3.
Read memory location again to check that the BKPT instruction has been written.
4.
If it has not been written, determine the reason.
Note
Cache coherency issues might arise when writing a BKPT instruction. See
Debugging in a
cached system
on page 13-43.
13.14.4 Using the debug communications channel
To read a word sent by a DBGTAP debugger:
1.
Read the DSCR register.
2.
If DSCR[30] rDTRfull flag is clear, then go to 1.
3.
Read the word from the rDTR, CP14 Debug Register c5.
To write a word for a DBGTAP debugger:
1.
Read the DSCR register.