Perl调试器自带的help
时间:2007-04-15 来源:xueyan
Help is currently only available for the new 5.8 command set.
No help is available for the old command set.
We assume you know what you're doing if you switch to it. T Stack trace.
s [expr] Single step [in expr].
n [expr] Next, steps over subroutine calls [in expr].
<CR> Repeat last n or s command.
r Return from current subroutine.
c [line|sub] Continue; optionally inserts a one-time-only breakpoint
at the specified position.
l min+incr List incr+1 lines starting at min.
l min-max List lines min through max.
l line List single line.
l subname List first window of lines from subroutine.
l $var List first window of lines from subroutine referenced by $var.
l List next window of lines.
- List previous window of lines.
v [line] View window around line.
. Return to the executed line.
f filename Switch to viewing filename. File must be already loaded.
filename may be either the full name of the file, or a regular
expression matching the full file name:
f /home/me/foo.pl and f oo\. may access the same file.
Evals (with saved bodies) are considered to be filenames:
f (eval 7) and f eval 7\b access the body of the 7th eval
(in the order of execution).
/pattern/ Search forwards for pattern; final / is optional.
?pattern? Search backwards for pattern; final ? is optional.
L [a|b|w] List actions and or breakpoints and or watch-expressions.
S [[!]pattern] List subroutine names [not] matching pattern.
t Toggle trace mode.
t expr Trace through execution of expr.
b Sets breakpoint on current line)
b [line] [condition]
Set breakpoint; line defaults to the current execution line;
condition breaks if it evaluates to true, defaults to '1'.
b subname [condition]
Set breakpoint at first line of subroutine.
b $var Set breakpoint at first line of subroutine referenced by $var.
b load filename Set breakpoint on 'require'ing the given file.
b postpone subname [condition]
Set breakpoint at first line of subroutine after
it is compiled.
b compile subname
Stop after the subroutine is compiled.
B [line] Delete the breakpoint for line.
B * Delete all breakpoints.
a [line] command
Set an action to be done before the line is executed;
line defaults to the current execution line.
Sequence is: check for breakpoint/watchpoint, print line
if necessary, do action, prompt user if necessary,
execute line.
a Does nothing
A [line] Delete the action for line.
A * Delete all actions.
w expr Add a global watch-expression.
w Does nothing
W expr Delete a global watch-expression.
W * Delete all watch-expressions.
V [pkg [vars]] List some (default all) variables in package (default current).
Use ~pattern and !pattern for positive and negative regexps.
X [vars] Same as "V currentpackage [vars]".
x expr Evals expression in list context, dumps the result.
m expr Evals expression in list context, prints methods callable
on the first element of the result.
m class Prints methods callable via the given class.
M Show versions of loaded modules.
i class Prints nested parents of given class.
e Display current thread id.
E Display all thread ids the current one will be identified: <n>.
y [n [Vars]] List lexicals in higher scope <n>. Vars same as V.
P Something to do with assertions... < ? List Perl commands to run before each prompt.
< expr Define Perl command to run before each prompt.
<< expr Add to the list of Perl commands to run before each prompt.
< * Delete the list of perl commands to run before each prompt.
> ? List Perl commands to run after each prompt.
> expr Define Perl command to run after each prompt.
>> expr Add to the list of Perl commands to run after each prompt.
> * Delete the list of Perl commands to run after each prompt.
{ db_command Define debugger command to run before each prompt.
{ ? List debugger commands to run before each prompt.
{{ db_command Add to the list of debugger commands to run before each prompt.
{ * Delete the list of debugger commands to run before each prompt.
! number Redo a previous command (default previous command).
! -number Redo number'th-to-last command.
! pattern Redo last command that started with pattern.
See 'O recallCommand' too.
!! cmd Run cmd in a subprocess (reads from DB::IN, writes to DB::OUT)
See 'O shellBang' too.
source file Execute file containing debugger commands (may nest).
save file Save current debugger session (actual history) to file.
rerun Rerun session to current position.
rerun n Rerun session to numbered command.
rerun -n Rerun session to number'th-to-last command.
H -number Display last number commands (default all).
H * Delete complete history.
p expr Same as "print {DB::OUT} expr" in current package.
|dbcmd Run debugger command, piping DB::OUT to current pager.
||dbcmd Same as |dbcmd but DB::OUT is temporarilly select()ed as well.
= [alias value] Define a command alias, or list current aliases.
command Execute as a perl statement in current package.
R Pure-man-restart of debugger, some of debugger state
and command-line options may be lost.
Currently the following settings are preserved:
history, breakpoints and actions, debugger Options
and the following command-line options: -w, -I, -e. o [opt] ... Set boolean option to true
o [opt?] Query options
o [opt=val] [opt="val"] ...
Set options. Use quotes in spaces in value.
recallCommand, ShellBang chars used to recall command or spawn shell;
pager program for output of "|cmd";
tkRunning run Tk while prompting (with ReadLine);
signalLevel warnLevel dieLevel level of verbosity;
inhibit_exit Allows stepping off the end of the script.
ImmediateStop Debugger should stop as early as possible.
RemotePort Remote hostname:port for remote debugging
The following options affect what happens with V, X, and x commands:
arrayDepth, hashDepth print only first N elements ('' for all);
compactDump, veryCompact change style of array and hash dump;
globPrint whether to print contents of globs;
DumpDBFiles dump arrays holding debugged files;
DumpPackages dump symbol tables of packages;
DumpReused dump contents of "reused" addresses;
quote, HighBit, undefPrint change style of string dump;
bareStringify Do not print the overload-stringified value;
Other options include:
PrintRet affects printing of return value after r command,
frame affects printing messages on subroutine entry/exit.
AutoTrace affects printing messages on possible breaking points.
maxTraceLen gives max length of evals/args listed in stack trace.
ornaments affects screen appearance of the command line.
CreateTTY bits control attempts to create a new TTY on events:
1: on fork() 2: debugger is started inside debugger
4: on startup
During startup options are initialized from $ENV{PERLDB_OPTS}.
You can put additional initialization options TTY, noTTY,
ReadLine, NonStop, and RemotePort there (or use
`R' after you set them). q or ^D Quit. Set $DB::finished = 0 to debug global destruction.
h Summary of debugger commands.
h [db_command] Get help [on a specific debugger command], enter |h to page.
h h Long help for debugger commands
man manpage Runs the external doc viewer man command on the
named Perl manpage, or on man itself if omitted.
Set $DB::doccmd to change viewer.
No help is available for the old command set.
We assume you know what you're doing if you switch to it. T Stack trace.
s [expr] Single step [in expr].
n [expr] Next, steps over subroutine calls [in expr].
<CR> Repeat last n or s command.
r Return from current subroutine.
c [line|sub] Continue; optionally inserts a one-time-only breakpoint
at the specified position.
l min+incr List incr+1 lines starting at min.
l min-max List lines min through max.
l line List single line.
l subname List first window of lines from subroutine.
l $var List first window of lines from subroutine referenced by $var.
l List next window of lines.
- List previous window of lines.
v [line] View window around line.
. Return to the executed line.
f filename Switch to viewing filename. File must be already loaded.
filename may be either the full name of the file, or a regular
expression matching the full file name:
f /home/me/foo.pl and f oo\. may access the same file.
Evals (with saved bodies) are considered to be filenames:
f (eval 7) and f eval 7\b access the body of the 7th eval
(in the order of execution).
/pattern/ Search forwards for pattern; final / is optional.
?pattern? Search backwards for pattern; final ? is optional.
L [a|b|w] List actions and or breakpoints and or watch-expressions.
S [[!]pattern] List subroutine names [not] matching pattern.
t Toggle trace mode.
t expr Trace through execution of expr.
b Sets breakpoint on current line)
b [line] [condition]
Set breakpoint; line defaults to the current execution line;
condition breaks if it evaluates to true, defaults to '1'.
b subname [condition]
Set breakpoint at first line of subroutine.
b $var Set breakpoint at first line of subroutine referenced by $var.
b load filename Set breakpoint on 'require'ing the given file.
b postpone subname [condition]
Set breakpoint at first line of subroutine after
it is compiled.
b compile subname
Stop after the subroutine is compiled.
B [line] Delete the breakpoint for line.
B * Delete all breakpoints.
a [line] command
Set an action to be done before the line is executed;
line defaults to the current execution line.
Sequence is: check for breakpoint/watchpoint, print line
if necessary, do action, prompt user if necessary,
execute line.
a Does nothing
A [line] Delete the action for line.
A * Delete all actions.
w expr Add a global watch-expression.
w Does nothing
W expr Delete a global watch-expression.
W * Delete all watch-expressions.
V [pkg [vars]] List some (default all) variables in package (default current).
Use ~pattern and !pattern for positive and negative regexps.
X [vars] Same as "V currentpackage [vars]".
x expr Evals expression in list context, dumps the result.
m expr Evals expression in list context, prints methods callable
on the first element of the result.
m class Prints methods callable via the given class.
M Show versions of loaded modules.
i class Prints nested parents of given class.
e Display current thread id.
E Display all thread ids the current one will be identified: <n>.
y [n [Vars]] List lexicals in higher scope <n>. Vars same as V.
P Something to do with assertions... < ? List Perl commands to run before each prompt.
< expr Define Perl command to run before each prompt.
<< expr Add to the list of Perl commands to run before each prompt.
< * Delete the list of perl commands to run before each prompt.
> ? List Perl commands to run after each prompt.
> expr Define Perl command to run after each prompt.
>> expr Add to the list of Perl commands to run after each prompt.
> * Delete the list of Perl commands to run after each prompt.
{ db_command Define debugger command to run before each prompt.
{ ? List debugger commands to run before each prompt.
{{ db_command Add to the list of debugger commands to run before each prompt.
{ * Delete the list of debugger commands to run before each prompt.
! number Redo a previous command (default previous command).
! -number Redo number'th-to-last command.
! pattern Redo last command that started with pattern.
See 'O recallCommand' too.
!! cmd Run cmd in a subprocess (reads from DB::IN, writes to DB::OUT)
See 'O shellBang' too.
source file Execute file containing debugger commands (may nest).
save file Save current debugger session (actual history) to file.
rerun Rerun session to current position.
rerun n Rerun session to numbered command.
rerun -n Rerun session to number'th-to-last command.
H -number Display last number commands (default all).
H * Delete complete history.
p expr Same as "print {DB::OUT} expr" in current package.
|dbcmd Run debugger command, piping DB::OUT to current pager.
||dbcmd Same as |dbcmd but DB::OUT is temporarilly select()ed as well.
= [alias value] Define a command alias, or list current aliases.
command Execute as a perl statement in current package.
R Pure-man-restart of debugger, some of debugger state
and command-line options may be lost.
Currently the following settings are preserved:
history, breakpoints and actions, debugger Options
and the following command-line options: -w, -I, -e. o [opt] ... Set boolean option to true
o [opt?] Query options
o [opt=val] [opt="val"] ...
Set options. Use quotes in spaces in value.
recallCommand, ShellBang chars used to recall command or spawn shell;
pager program for output of "|cmd";
tkRunning run Tk while prompting (with ReadLine);
signalLevel warnLevel dieLevel level of verbosity;
inhibit_exit Allows stepping off the end of the script.
ImmediateStop Debugger should stop as early as possible.
RemotePort Remote hostname:port for remote debugging
The following options affect what happens with V, X, and x commands:
arrayDepth, hashDepth print only first N elements ('' for all);
compactDump, veryCompact change style of array and hash dump;
globPrint whether to print contents of globs;
DumpDBFiles dump arrays holding debugged files;
DumpPackages dump symbol tables of packages;
DumpReused dump contents of "reused" addresses;
quote, HighBit, undefPrint change style of string dump;
bareStringify Do not print the overload-stringified value;
Other options include:
PrintRet affects printing of return value after r command,
frame affects printing messages on subroutine entry/exit.
AutoTrace affects printing messages on possible breaking points.
maxTraceLen gives max length of evals/args listed in stack trace.
ornaments affects screen appearance of the command line.
CreateTTY bits control attempts to create a new TTY on events:
1: on fork() 2: debugger is started inside debugger
4: on startup
During startup options are initialized from $ENV{PERLDB_OPTS}.
You can put additional initialization options TTY, noTTY,
ReadLine, NonStop, and RemotePort there (or use
`R' after you set them). q or ^D Quit. Set $DB::finished = 0 to debug global destruction.
h Summary of debugger commands.
h [db_command] Get help [on a specific debugger command], enter |h to page.
h h Long help for debugger commands
man manpage Runs the external doc viewer man command on the
named Perl manpage, or on man itself if omitted.
Set $DB::doccmd to change viewer.
相关阅读 更多 +