12.07.2015 Views

ARM DS-5 Using the Debug Hardware Configuration Utilities

ARM DS-5 Using the Debug Hardware Configuration Utilities

ARM DS-5 Using the Debug Hardware Configuration Utilities

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Debug</strong>ging with your debug hardware unit8.6 Software instruction breakpointsFor processors that do not support hardware instruction breakpoints, or in cases where you haveused up all <strong>the</strong> available hardware breakpoint resources, you can use software instructionbreakpoints. Software breakpoints modify <strong>the</strong> instruction in memory to create a special valuethat causes <strong>the</strong> processor to enter debug state when executed. The value written to memorydepends on <strong>the</strong> processor you are using. For <strong>ARM</strong> processors, one of <strong>the</strong> following schemes isused, depending on <strong>the</strong> architecture and processor revision:• An undefined instruction is written to memory, and a hardware breakpoint resource isused to spot this instruction being executed. The processor enters debug state when <strong>the</strong>hardware breakpoint unit spots <strong>the</strong> undefined instruction entering <strong>the</strong> execute pipelinestage.• An <strong>ARM</strong>v5 BKPT instruction is written to memory, and a hardware breakpoint resource isused to spot <strong>the</strong> instruction being executed. The processor enters debug state when <strong>the</strong>hardware breakpoint unit spots <strong>the</strong> BKPT instruction entering <strong>the</strong> execute pipeline stage.• An <strong>ARM</strong>v5 BKPT instruction is written to memory. When this instruction is executed, <strong>the</strong>processor automatically enters debug state.Where a hardware breakpoint unit is used to spot software instruction breakpoints, only a singlehardware resource is used, no matter how many software instruction breakpoints are set. If youhave difficulty setting software instruction breakpoints, you might have to free up a hardwarebreakpoint resource first.Software breakpoints cannot be used to debug code in Flash or ROM, and can be unreliable inself-modifying code.NoteWhen viewing memory or disassembly, debug hardware reports <strong>the</strong> actual contents of memory.Prior to running, any software breakpoints are written to memory. When <strong>the</strong> processor halts, <strong>the</strong>software breakpoints are removed from memory. On a number of processors, it is not possibleto access memory while running. This means that if you disconnect debug hardware from <strong>the</strong>processor while <strong>the</strong> target is running, <strong>the</strong> breakpoints are left in memory. If <strong>the</strong> processorsubsequently executes one of <strong>the</strong> instructions, <strong>the</strong>n (depending on <strong>the</strong> processor architecture)<strong>the</strong> processor ei<strong>the</strong>r stops at <strong>the</strong> software breakpoint or causes <strong>the</strong> processor to take an undefinedexception.8.6.1 See alsoConcepts• <strong>Hardware</strong> breakpoints on page 8-8• Processor exceptions on page 8-10• Breakpoints and <strong>the</strong> program counter on page 8-11• Interaction between breakpoint handling in <strong>the</strong> debug hardware and your debugger onpage 8-12• Problems setting breakpoints on page 8-14.<strong>ARM</strong> DUI 0498F Copyright © 2010-2012 <strong>ARM</strong>. All rights reserved. 8-9ID021112Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!