8.5.2. Stepping into functions

To enter called functions when stepping assembly instructions:

  1. Connect to your target.

  2. Load the required image, for example dhrystone.axf.

  3. Locate the instruction in the Disassembly tab where you want to start stepping. You can either:

    • Scroll through the disassembly view in the Disassembly tab to locate the instruction.

    • Find an instruction corresponding to a line of code in a source file (dhry_1.c in this example).

  4. Display line 149.

  5. Set a breakpoint by double-clicking on the line number in the left margin. The following message is displayed in the Output view:

    binstr \DHRY_1\#149:5
    

    Note

    The number following the colon : might be different to that shown. It is the position within the line where the breakpoint is set. This is significant only when setting a breakpoint on multistatement lines.

  6. Click Run. The program begins execution.

  7. When prompted for the number of runs, enter 1000. The program continues execution and runs up to the breakpoint. A red box shows the location of the PC at line 149.

    The Cmd tab of the Output view shows where execution has stopped, for example:

    Stopped at 0x00008480 due to SW Instruction Breakpoint
    Stopped at 0x00008480: DHRY_1\main Line 149
    
  8. Right-click in the left margin of the source view at line 149 to display the context menu.

  9. Select Locate PC in Disassembly from the context menu.

    The code view changes to the Disassembly tab, and the assembly instruction where the breakpoint is set is displayed. A red box shows the location of the PC (address 0x8480 in this example).

  10. Click the Step by line or instruction into functions button once.

    A red box shows the location of the PC at address 0x81E4. The Proc_5 function has been stepped into.

  11. Click Step by line or instruction into functions several more times, until you are familiar with the operation of this control.

See also

Copyright © 2002-2011 ARM. All rights reserved.ARM DUI 0153N
Non-ConfidentialID052111