|
The debugger probably contains enough configuration hooks that you won't ever have to modify
it yourself. You may change the behaviour of debugger from within the debugger using its o
command, from the command line via the PERLDB_OPTS environment variable, and from
customization files.
You can do some customization by setting up a .perldb file, which contains
initialization code. For instance, you could make aliases like these (the last one is one people
expect to be there):
$DB::alias{'len'} = 's/^len(.*)/p length($1)/';
$DB::alias{'stop'} = 's/^stop (at|in)/b/';
$DB::alias{'ps'} = 's/^ps\b/p scalar /';
$DB::alias{'quit'} = 's/^quit(\s*)/exit/';
|
|
You can change options from .perldb by using calls like this one;
parse_options("NonStop=1 LineInfo=db.out AutoTrace=1 frame=2");
|
|
The code is executed in the package DB. Note that .perldb is processed
before processing PERLDB_OPTS. If .perldb defines the subroutine afterinit,
that function is called after debugger initialization ends. .perldb may be contained in
the current directory, or in the home directory. Because this file is sourced in by Perl and may
contain arbitrary commands, for security reasons, it must be owned by the superuser or the
current user, and writable by no one but its owner.
If you want to modify the debugger, copy perl5db.pl from the Perl library to another
name and hack it to your heart's content. You'll then want to set your PERL5DB
environment variable to say something like this:
BEGIN { require "myperl5db.pl" }
|
|
As a last resort, you could also use PERL5DB to customize the debugger by
directly setting internal variables or calling debugger functions.
Note that any variables and functions that are not documented in this document (or in perldebguts) are considered for
internal use only, and as such are subject to change without notice.
|