8.3.4. Running until the current function returns

To run the image until the current function returns:

  1. Load your application image. The rest of this procedure continues to use the dhrystone.axf image as an example.

    You want to stop execution in the function of interest. To control the point at which the image stops, either:

    • Locate the function in your source code, and use the Run to cursor control to run the image to a line of code in that function.

    • Set a breakpoint in the function and then run the image in the usual way. This is the method used in the rest of this procedure.

  2. Display line 149.

  3. Right-click in the margin to display the context menu.

  4. Set a breakpoint in the Proc_5() function:

    1. Select Create Breakpoint... from the context menu to open the Create Breakpoint dialog box.

    2. Enter Proc_5 in the Location field.

    3. Click OK to set the breakpoint and close the Create Breakpoint dialog box.

  5. Click Run. The program begins execution.

  6. 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 378.

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

    Stopped at 0x000081E4 due to SW Instruction Breakpoint
    Stopped at 0x000081E4: DHRY_1\Proc_5 Line 378
  7. Click the Run until return from current function button on the Debug toolbar. Execution starts from the current PC in the current function (Proc_5 in this example) and runs until it returns.

    For the Dhrystone example, execution stops at the next line of code following the call to the Proc_5 function (line 150 of dhry_1.c).

See also

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