7.3. Working with the stack

A stack, or run-time stack, is an area of memory used to store function return information and local variables.

Executing a function sets up the stack. As the new function is called, a record is created on the stack including traceback details, and local variables. At this point these arguments and local variables become available to RealView Debugger and can be accessed through the panes and windows of the Code window.

When the function returns the area of the stack occupied by that function is recovered automatically and can then be used for the next function call.

In a typical memory-managed ARM architecture-based processor, the memory model comprises:

The Stack Pointer (SP) points to the bottom of the stack.

Note

Modifying a value in the stack might cause the application program to perform incorrectly or even to abort operation completely.

RealView Debugger can provide the calling sequence of any functions that are still in the execution path because their calling addresses are still on the stack. However, when the function is off the stack, it is lost to RealView Debugger.

This section describes ways of working with the stack:

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