frame (gdb mode only)

Show or change the current function scope.

Syntax

frame [expr]

Parameters

expr

The frame to use as the starting point.

Description

This command shows or changes the current function scope.

A running application maintains a call stack that contains information about its functions that have been called. Each item in the stack is a call frame, and each frame contains both the information needed to return to its caller and the information needed to provide the local variables of the function.

When your program starts, the call stack has only one frame, that of the function main. Each function call pushes a new frame onto the stack, and each function return removes the frame for that function from the stack. Recursive functions can generate many frames.

The expr parameter can be a frame number or an address. Frame 0 is the frame that is currently executing, frame 1 is the caller of frame 0, and so on. The frame with the highest number is for main.

You may find it useful to specify an address if a bug has damaged the stack frame chaining, making it impossible for the debugger to properly assign numbers to frames. You may also find it useful when your application switches between multiple stacks.

Example

The following example shows the current function scope. Specifically, it shows that the debuggee is currently executing the main function at line 18, where the debuggee sets the value of the variable local_thing.

(idb)  frame
#0  0x08048427 in main () at /site/c_code/hello.c:18
18        float local_thing = 1.5;
(idb) 

See Also


Submit feedback on this help topic

Copyright © 2001-2011, Intel Corporation. All rights reserved.