7.3.1. Using the Stack pane

The Stack pane enables you to monitor the contents of the stack as raw memory, and to make changes to those settings. This might be especially useful for assembly language programmers. The Stack pane shows the contents of the stack at the SP register which is always kept at the top-left of the display area. Use this pane to view changes as they happen in the stack.

The Stack pane enables you to follow the flow of your application through the hierarchical structure by displaying the current state of the stack. This shows you the path that leads from the main entry point to the currently executing function.

To view the Stack pane:

  1. Select File → Reload Image to Target to reload the image dhrystone.axf.

  2. Select View → Pane Views → Stack to view the Stack pane.

  3. Click on the Src tab to view the source file dhry_1.c.

  4. Set a simple breakpoint by double-clicking on line 150.

  5. Click Go to start execution.

  6. Enter 5000 when asked for the number of runs.

    The program starts and then stops when execution reaches the breakpoint at line 150. The red box marks the location of the PC when execution stops.

  7. View the updated Stack pane, shown in Figure 7.7.

    Figure 7.7. Viewing the stack

    Viewing the stack

    The stack pointer, marked by SP, is located at the bottom of the stack. The frame pointer, marked by FP, shows the starting point for the storage of local variables.

  8. Monitor changes in the Stack pane as you step through your program, for example by clicking Hi-level Step Into.

  9. Double-click on the red marker disc to clear the breakpoint at line 150.

The stack is displayed in columns:

Address

The left column contains the memory addresses of the stack.

In some target processors that use a Harvard architecture, a D is appended to show that this is a data address. You must include this letter when specifying such an address as the starting address.

Value

The right column displays the contents of the addresses in the stack.

As with the Memory pane, the memory display in the Stack pane is color-coded for easy viewing and to enable you to monitor changes.

Copyright © 2003, 2004 ARM Limited. All rights reserved.ARM DUI 0234B
Non-Confidential