5.3.2. 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, RealView ICE reports the actual contents of memory. Prior to running, any software breakpoints are written to memory. When the core halts, the software breakpoints are removed from memory. On a number of cores, it is not possible to access memory while running, and means that if you disconnect RealView-ICE from the core while the target is running, the breakpoints are left in memory. If the core subsequently executes one of the instructions, then (depending on the core architecture) the core either stops at the software breakpoint or causes the core to take an undefined exception.

Copyright © 2002, 2004-2008 ARM Limited. All rights reserved.ARM DUI 0155J