Debugging ooRexx is an advanced topic, typically only for the experts. But still sometimes it may be necessary to provide a stack trace for a bug that you have reported. This How-to can help you doing this on Linux.
Debugging requires a debugger named gdb. If you haven't already installed an ooRexx build environment, install gdb using the following command.
sudo apt install gdb
ooRexx can be built in three different versions:
Best results can be achieved when debugging with a DEBUG version, whereas a RELWITHDEBUG version will show less, and a RELEASE version will show least detail.
Try to build your own DEBUG version, or get hold of a DEBUG version from someone else.
Here we assume that a debug version was built in oorexxbuild/debug
and the built binaries are in oorexxbuild/debug/bin
cd oorexxbuild/debug PATH=bin:$PATH gdb bin/rexx (gdb) run a_failing_rexx_program.rex
Wait until the crash occurs, or the program hangs. Then press Ctrl+C to interrupt.
(gdb) set logging file full_stacktrace.log (gdb) set logging on (gdb) info threads (gdb) thread apply all backtrace (gdb) set logging off (gdb) set logging file full_stacktrace_with_variables.log (gdb) set logging on (gdb) thread apply all backtrace full (gdb) set logging off (gdb) quit