The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I needed to run the debugger on a long-running process, and the conditional breakpoint required was too hairy for my poor brain to figure out. After a bit of spelunking in perldoc perldebug and perldoc DB I came up with the code below. There are a few things to be aware of:
In my real-life example, the setting of $DB::single involved opening sockets to remote machine and database lookups, but in essence was doing nothing more than the example below. It might make more sense to say $DB::single = maybe_breakpoint($foo, $bar, $rat,...) and encapsulate the mess in a subroutine. Also note that XML::SAX::PurePerl is really, really slow under the debugger. Do not adjust your terminal, it will respond... eventually :)
In reply to Invoking the debugger on yourself by grinder
|
|