9.3.2. Software breakpoints

To make a watchpoint unit cause software breakpoints (that is, 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 its Address Mask register to 0xFFFFFFFF (all bits set to 1) so that the address is disregarded.

    For a THUMB software breakpoint, the 16‑bit pattern must be repeated in both halves of the Data Value register. For example, if the bit pattern is 0xDFFF, then 0xDFFFDFFF must be programmed. When a 16‑bit instruction is fetched, EmbeddedICE only compares the valid half of the data bus against the contents of the Data Value register. In this way, a single Watchpoint register can be used 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, 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

The address value register need not be programmed.

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 © 1997, 1998 ARM Limited. All rights reserved.DDI 0087E
Non-Confidential