5.10.17. Using the call stack

The Call Stack pane enables you to follow the flow of your program by examining the current status of functions and variables. This pane shows you the path that leads from the main entry point to the currently executing function. In the default Code window, the Call Stack pane is the left-hand pane in the middle row (see Figure 4.1).

To monitor your execution path:

  1. Select Target ? Reload Image to Target from the Code window main menu to reload the image.

  2. Click the Run button on the Debug toolbar to execute the image. Enter a large number of runs, for example 50000.

  3. Click Stop Execution to stop the program before it finishes.

    The Call Stack tab, in the Call Stack pane, displays details of the functions currently on the stack and awaiting execution.

  4. Right-click on an entry in the Call Stack pane, to see the Function context menu.

    This menu enables you to carry out operations on the chosen function in the stack, for example to scope to that function.

  5. Click on the Locals tab in the Call Stack pane. This displays a list of the variables that are local to the current function, shown in the example in Figure 5.10.

    Figure 5.10. Local variables in the Call Stack pane

    Local variables in the Call Stack pane

    If a variable is a structure or an array, a plus sign is added to the entry in the Call Stack pane. You can click on this to expand the variable to see all elements of the structure or array.

  6. Right-click on an entry in the Locals tab, to see the Variables context menu.

  7. Click on the Statics tab, to see non-local variables, that is module statics.

Copyright © 2002-2005 ARM Limited. All rights reserved.ARM DUI 0181G