5.21.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 0xdfff, program 0xdfffdfff. When a 16-bit instruction is fetched, EmbeddedICE-RT 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 PROT[0] = 0.

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

  6. If you want to make the distinction between User and non-User mode instruction fetches, program the PROT[1] bit in the control value, and control mask registers accordingly.

  7. If required, program the DBGEXT, 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.

  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 © 2001 ARM Limited. All rights reserved.ARM DDI 0234B
Non-Confidential