The function being debugged may be the leaf node of a series of function calls.
After examining values in the current subroutine it may turn out that the
problem occurred in earlier pieces of code. Use dbup
and dbdown
to move up and down through the series of function calls to locate where
variables first took on the wrong values. dbstack
shows the entire
series of function calls and at what level debugging is currently taking place.
n
¶-completenames
¶[stack, idx] =
dbstack (…)
¶Display or return current debugging function stack information.
With optional argument n, omit the n innermost stack frames.
Although accepted, the argument -completenames is silently ignored. Octave always returns absolute filenames.
The arguments n and -completenames can both be specified and may appear in any order.
The optional return argument stack is a struct array with the following fields:
The name of the m-file where the function code is located.
The name of the function with a breakpoint.
The line number of an active breakpoint.
The column number of the line where the breakpoint begins.
The return argument idx specifies which element of the stack struct array is currently active.
n
¶In debugging mode, move up the execution stack n frames.
If n is omitted, move up one frame.