dup
Moves up the call stack
Format
dup [ num-levels ]
Arguments
num-levels
Number of levels to move up. The default is 1.
Description
The dup command moves the current stack frame up one or more levels. It also prints the new frame number and function.
Call stack movements are all relative, so dup effectively “moves up” in the call stack. (“Up” is in the direction of main().)
Frame 0 is the most recent—that is, currently executing—frame in the call stack; frame 1 corresponds to the procedure that invoked the currently executing frame, and so on. The call stack’s depth is increased by one each time a program enters a procedure, and decreases by one when the program exits from it. The effect of the dup command is to change the context of commands that follow. For example, moving up one level allows access to variables that are local to the procedure that called the current routine.
Each dup command updates the frame location by adding the appropriate number of levels.
The
dupcommand also modifies the current list location to be the current execution location for the new frame, so a subsequent
dlist command displays the code surrounding this location. Entering the
dup 2 command (while in frame 0) followed by a
dlist command, for instance, displays source lines centered around the location from which the current routine’s parent was invoked. These lines are in frame 2.
Command alias
Alias | Definition | Description |
---|
u | dup | Moves up the call stack |
Examples
dup
Moves up one level in the call stack. As a result, subsequent dlist commands refer to the procedure that invoked this one. After this command executes, it displays information about the new frame; for example:
1 check_fortran_arrays_ PC=0x10001254,
FP=0x7fff2ed0 [arrays.F#48]
dfocus p1 u 5
Moves up five levels in the call stack for each thread involved in process 1. If fewer than five levels exist, the CLI moves up as far as it can.
Related Topics