B.13.2. Software breakpoints

To make a watchpoint unit cause software breakpoints on instruction fetches of a particular bit pattern:

  1. Program its address mask register to 0xFFFFFFFF, all bits set to 1, so that the address is disregarded.

  2. Program the data value register with the particular bit pattern that has been chosen to represent a software breakpoint.

    If you are programming a Thumb software breakpoint, repeat the 16-bit pattern in both halves of the data value register. For example, if the bit pattern is 0xdeee, program 0xDEEEDEEE. When a 16-bit instruction is fetched, EmbeddedICE compares only the valid half of the data bus against the contents of the data value register. In this way, you can use a single watchpoint register to catch software breakpoints on both the upper and lower halves of the data bus.

  3. Program the data mask register to 0x00000000.

  4. Program the control value register with nOPC = 0.

  5. Program the control mask register with nOPC = 0 and all other bits to 1.

  6. If you wish to make the distinction between User and non-User mode instruction fetches, program the nTRANS bit in the control value and control mask registers accordingly.

  7. If required, program the EXTERN, RANGE, and CHAIN bits in the same way.

Note

You do not have to program the address value register.

Setting the breakpoint

To set the software breakpoint:

  1. Read the instruction at the desired address and store it away.

  2. Write the special bit pattern representing a software breakpoint at the address.

Clearing the breakpoint

To clear the software breakpoint, restore the instruction to the address.

Copyright © 1994-2001. All rights reserved.ARM DDI 0029G
Non-Confidential