up
The up
command selects and prints the function that called
this one, or the function specified by the frame number in the call stack.
Syntax
up [
frames ]
- frames specifies how many frames up to go in the stack. The default is 1.
Usage
The up
command moves towards the outermost frame, to frames that
have existed longer. To print the function that called the current function, use the
up
command without an argument.
See stack frames for a brief description of frames.
Example
MAIN
CALL func1()
END MAIN
FUNCTION func1() RETURNS ()
DEFINE x INT, s STRING
CALL func2() RETURNING x, s
END FUNCTION
FUNCTION func2() RETURNS (INT,STRING)
RETURN 999, "xxxxxx"
END FUNCTION
$ fglcomp -M prog.4gl && fglrun -d prog.42m
(fgldb) break func2
Breakpoint 1 at 0x00000000: file prog.4gl, line 11.
(fgldb) run
Breakpoint 1, func2() at prog.4gl:11
8 END FUNCTION
9
10 FUNCTION func2() RETURNS (INT,STRING)
-> 11 RETURN 999, "xxxxxx"
12 END FUNCTION
13
(fgldb) up
#1 func1() at prog.4gl:7
4
5 FUNCTION func1() RETURNS ()
6 DEFINE x INT, s STRING
-> 7 CALL func2() RETURNING x, s
8 END FUNCTION
9
10 FUNCTION func2() RETURNS (INT,STRING)
(fgldb) down
#0 func2() at prog.4gl:11
8 END FUNCTION
9
10 FUNCTION func2() RETURNS (INT,STRING)
-> 11 RETURN 999, "xxxxxx"
12 END FUNCTION
13