13.14.2. Examining the Stack

To examine the Stack, select View → Stack from the Code window main menu. The Stack view is opened as a floating view, shown in Figure 13.41.

Figure 13.41. 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.

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, the address is prefixed with D: to show that this is a data address. You must include this prefix when specifying such an address as the starting address, as follows:

D:address

Value

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

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

Demonstration

The following procedure uses the example Dhrystone image to demonstrate the use of the Stack view:

  1. Click the Locate PC button on the Debug toolbar to view the source file dhry_1.c.

  2. Set a default breakpoint by double-clicking on line 301.

  3. Click Run to start execution.

  4. Enter 5000 when asked for the number of runs. The program starts and then stops when execution reaches the breakpoint at line 301. The red box marks the location of the PC when execution stops.

  5. Monitor changes in the Stack view as you step through your program, for example by clicking Step on the Debug toolbar.

  6. Double-click on the red marker disc to clear the breakpoint at line 301.

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