additional cbacktrace command (working patch)
define cbacktrace
call cob_stack_trace(stderr)
end
document cbacktrace
Print backtrace of all active COBOL runtime elements on stack.
Usage: cbacktrace
end
alias cbt = cbacktrace
alias cwhere = cbacktrace
Note: a MI version should call this with GDB's stream "~" if possible to present the backtrace in the GDB output instead of on stderr.
Note2: GnuCOBOL 3.2 is intended to ship with a less verbose version, executable by:
set $cbacktrace_limit = 0
define cbacktrace
set $count = $cbacktrace_limit
if $argc == 1
set $count = $arg0
end
call cob_backtrace(stderr, $count)
end
document cbacktrace
Print backtrace of all active COBOL runtime elements on stack, or innermost COUNT elements.
Usage: cbacktrace [COUNT]
With a negative argument, print outermost -COUNT elements.
Uses $cbacktrace_limit if no argument is given. A value of zero means unlimited levels.
end
alias cbt = cbacktrace
alias cwhere = cbacktrace
Edited by Simon Sobisch