Software instruction breakpoints

For processors that do not support hardware instruction breakpoints, or in cases where you have used up all the available hardware breakpoint resources, you can use software instruction breakpoints. Software breakpoints modify the instruction in memory to create a special value that causes the processor to enter debug state when executed. The value written to memory depends on the processor you are using. For ARM processors, one of the following schemes is used, depending on the architecture and processor revision:

Where a hardware breakpoint unit is used to spot software instruction breakpoints, only a single hardware resource is used, no matter how many software instruction breakpoints are set. If you have difficulty setting software instruction breakpoints, you might have to free up a hardware breakpoint resource first.

Software breakpoints cannot be used to debug code in Flash or ROM, and can be unreliable in self-modifying code.


When viewing memory or disassembly, debug hardware reports the actual contents of memory. Prior to running, any software breakpoints are written to memory. When the processor halts, the software breakpoints are removed from memory. On a number of processors, it is not possible to access memory while running. This means that if you disconnect debug hardware from the processor while the target is running, the breakpoints are left in memory. If the processor subsequently executes one of the instructions, then (depending on the processor architecture) the processor either stops at the software breakpoint or causes the processor to take an undefined exception.

Show/hideSee also

Copyright © 2010-2011 ARM. All rights reserved.ARM DUI 0498D