10.7.1. Changing scope to a specific entry in the Call Stack

To change scope to a specific entry in the Call Stack:

  1. Connect to your target.

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

  3. Click the Locate PC button on the Debug toolbar to view the source file that contains the PC scope (dhry_1.c in this example).

  4. Locate the point in your code where you want to stop execution. In this example, set a breakpoint in the Proc_8() function, as follows:

    1. Display line 167 in dhry_1.c.

    2. Right-click on the Proc_8 function name to display the context menu.

    3. Select Create Breakpoint... from the context menu to display the Create Breakpoint dialog box.

    4. Enter Proc_8 in the Location field.

    5. Click OK.

  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 yellow arrow and red box shows the location of the PC at line 93. Figure 10.5 shows an example.

    Figure 10.5. Stopped at breakpoint in Proc_8() function

    Stopped at breakpoint in Proc_8() function

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

    Stopped at 0x00008FA4 due to SW Instruction Breakpoint
    Stopped at 0x00008FA4: DHRY_1\main Line 93
    
  7. Display the Call Stack view if it is not already visible. Figure 10.6 shows the Call Stack view for this example. The scope is located at line 93 in dhry_2.c.

    Figure 10.6. Call Stack view

    Call Stack view

  8. Double-click on an entry in the Call Stack view. RealView Debugger:

    • changes scope to the corresponding line of code.

    • displays a message in the Output view showing the new context.

    In this example, double-click on the int main(void) Line #169 entry:

    • The new scope is located at line 169 in dhry_1.c

    • The following message is displayed in the Cmd tab of the Output view:

      Scoped at level 1: (0x00008520): DHRY_1\main Line 169
      
    • A blue arrow and blue box shows the location of the scope. Figure 10.7 shows an example.

      Figure 10.7. Scoped to a Call Stack entry

      Scoped to a Call Stack entry

See also

Copyright © 2002-2009 ARM Limited. All rights reserved.ARM DUI 0153K
Non-Confidential