interrupt in libcob's exception handling (workaround-patch as gdb command)
This would have the benefit of being able to inspect the program's state when an error occurs.
Ideally it would also be possible to "ignore error" upon request.
I use the following workaround currently:
# stop on runtime error and show current position
break cob_runtime_error
commands
cbacktrace
backtrace
end
The bad thing on this place is that the runtime error message is not yet fully constructed in this place (the user possibly runs fin
to see it in stderr - but then all error handlers would have been called, too).
To "ignore the error" the user can use (after fin
) ret
to leave the error-creating function that would normally invoke exit
which brings GDB back to the COBOL source. Depending on the error the program can be c
ontinued or one has to jump +1
to skip the bad instruction (for example in a CALL
to a not existing program).
Nice would be if the extension could handle that:
Program resulted in error: module 'not there' not found Stop execution?
In case of "n" we'd stand on the last executed COBOL source and can query the program (or continue, or jump, or ...).