DIE AND WARN MANAGEMENT
diesignal
diesignal
is a just-drop-dead die
handler. It's most useful when trying to debug a debugger problem.
It does its best to report the error that occurred, and then forces the program, debugger, and everything to die.
dbwarn
The debugger's own default $SIG{__WARN__}
handler. We load Carp
to be able to get a stack trace, and output the warning message vi DB::dbwarn()
.
dbdie
The debugger's own $SIG{__DIE__}
handler. Handles providing a stack trace by loading Carp
and calling Carp::longmess()
to get it. We turn off single stepping and tracing during the call to Carp::longmess
to avoid debugging it - we just want to use it.
If dieLevel
is zero, we let the program being debugged handle the exceptions. If it's 1, you get backtraces for any exception. If it's 2, the debugger takes over all exception handling, printing a backtrace and displaying the exception via its dbwarn()
routine.
warnlevel()
Set the $DB::warnLevel
variable that stores the value of the warnLevel
option. Calling warnLevel()
with a positive value results in the debugger taking over all warning handlers. Setting warnLevel
to zero leaves any warning handlers set up by the program being debugged in place.
dielevel
Similar to warnLevel
. Non-zero values for dieLevel
result in the DB::dbdie()
function overriding any other die()
handler. Setting it to zero lets you use your own die()
handler.
signalLevel
Number three in a series: set signalLevel
to zero to keep your own signal handler for SIGSEGV
and/or SIGBUS
. Otherwise, the debugger takes over and handles them with DB::diesignal()
.