|
Enbugger - Turns the debugger on at runtime. |
Enbugger - Turns the debugger on at runtime.
eval { ... };
if ( $@ ) {
# Oops! there was an error! Enable the debugger now!
require Enbugger;
$DB::single = 2;
}
Enables or disables the debugger at runtime regardless of whether your process was started with debugging on.
The debugger is loaded automatically when Enbugger is loaded. Calling
Enbugger->import also enables single stepping. This is optional
but it seems like a reasonable default.
# Installs the debugger. require Enbugger;
# Enables the debugger Enbugger->import;
Or...
eval 'use Enbugger';
Disables single stepping.
Enbugger->unimport;
Or...
eval 'no Enbugger';
Maybe you don't expect anything to die but on the chance you do, you'd like to do something about.
$SIG{__DIE__} = sub {
require Enbugger;
$DB::single = 3;
};
You could include this snippet in your program and trigger the debugger on SIGUSR1. Then later, when you're wondering what's up with your process, send it SIGUSR1 and it starts the debugger on itself.
$SIG{USR1} = sub {
require Enbugger;
$DB::single = 2;
};
Later:
$ kill -USR1 12345
To install this module type the following:
perl Makefile.PL make make test make install
A C compiler.
Josh ben Jore <jjore@cpan.org>
Copyright (C) 2007 by Josh ben Jore
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
|
Enbugger - Turns the debugger on at runtime. |