⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 perldebug.pod

📁 MSYS在windows下模拟了一个类unix的终端
💻 POD
📖 第 1 页 / 共 3 页
字号:
Set an action (Perl command) to happen before every debugger prompt.A multi-line command may be entered by backslashing the newlines.  B<WARNING> If C<command> is missing, all actions are wiped out!=item << commandAdd an action (Perl command) to happen before every debugger prompt.A multi-line command may be entered by backwhacking the newlines.=item > ?List out post-prompt Perl command actions.=item > commandSet an action (Perl command) to happen after the prompt when you'vejust given a command to return to executing the script.  A multi-linecommand may be entered by backslashing the newlines (we bet youcouldn't've guessed this by now).  B<WARNING> If C<command> ismissing, all actions are wiped out!=item >> commandAdds an action (Perl command) to happen after the prompt when you'vejust given a command to return to executing the script.  A multi-linecommand may be entered by backslashing the newlines.=item { ?List out pre-prompt debugger commands.=item { [ command ]Set an action (debugger command) to happen before every debugger prompt.A multi-line command may be entered in the customary fashion.  B<WARNING> If C<command> is missing, all actions are wiped out!Because this command is in some senses new, a warning is issued ifyou appear to have accidentally entered a block instead.  If that'swhat you mean to do, write it as with C<;{ ... }> or even C<do { ... }>.=item {{ commandAdd an action (debugger command) to happen before every debugger prompt.A multi-line command may be entered, if you can guess how: see above.=item ! numberRedo a previous command (defaults to the previous command).=item ! -numberRedo number'th previous command.=item ! patternRedo last command that started with pattern.See C<O recallCommand>, too.=item !! cmdRun cmd in a subprocess (reads from DB::IN, writes to DB::OUT) SeeC<O shellBang>, also.  Note that the user's current shell (well,their C<$ENV{SHELL}> variable) will be used, which can interferewith proper interpretation of exit status or signal and coredumpinformation.=item H -numberDisplay last n commands.  Only commands longer than one character arelisted.  If I<number> is omitted, list them all.=item q or ^DQuit.  ("quit" doesn't work for this, unless you've made an alias)This is the only supported way to exit the debugger, though typingC<exit> twice might work.Set the C<inhibit_exit> option to 0 if you want to be able to stepoff the end the script.  You may also need to set $finished to 0 if you want to step through global destruction.=item RRestart the debugger by C<exec()>ing a new session.  We try to maintainyour history across this, but internal settings and command-line optionsmay be lost.The following setting are currently preserved: history, breakpoints,actions, debugger options, and the Perl command-lineoptions B<-w>, B<-I>, and B<-e>.=item |dbcmdRun the debugger command, piping DB::OUT into your current pager.=item ||dbcmdSame as C<|dbcmd> but DB::OUT is temporarily C<select>ed as well.=item = [alias value]Define a command alias, like    = quit qor list current aliases.=item commandExecute command as a Perl statement.  A trailing semicolon will besupplied.  If the Perl statement would otherwise be confused for aPerl debugger, use a leading semicolon, too.=item m exprList which methods may be called on the result of the evaluatedexpression.  The expression may evaluated to a reference to a blessed object, or to a package name.=item man [manpage]Despite its name, this calls your system's default documentationviewer on the given page, or on the viewer itself if I<manpage> isomitted.  If that viewer is B<man>, the current C<Config> informationis used to invoke B<man> using the proper MANPATH or S<B<-M>I<manpath>> option.  Failed lookups of the form C<XXX> that matchknown manpages of the form I<perlXXX> will be retried.  This letsyou type C<man debug> or C<man op> from the debugger.On systems traditionally bereft of a usable B<man> command, thedebugger invokes B<perldoc>.  Occasionally this determination isincorrect due to recalcitrant vendors or rather more felicitously,to enterprising users.  If you fall into either category, justmanually set the $DB::doccmd variable to whatever viewer to viewthe Perl documentation on your system.  This may be set in an rcfile, or through direct assignment.  We're still waiting for aworking example of something along the lines of:    $DB::doccmd = 'netscape -remote http://something.here/';=back=head2 Configurable OptionsThe debugger has numerous options settable using the C<O> command,either interactively or from the environment or an rc file.(./.perldb or ~/.perldb under Unix.)=over 12=item C<recallCommand>, C<ShellBang>The characters used to recall command or spawn shell.  Bydefault, both are set to C<!>, which is unfortunate.=item C<pager>Program to use for output of pager-piped commands (those beginningwith a C<|> character.)  By default, C<$ENV{PAGER}> will be used.Because the debugger uses your current terminal characteristicsfor bold and underlining, if the chosen pager does not pass escapesequences through unchanged, the output of some debugger commandswill not be readable when sent through the pager.=item C<tkRunning>Run Tk while prompting (with ReadLine).=item C<signalLevel>, C<warnLevel>, C<dieLevel>Level of verbosity.  By default, the debugger leaves your exceptionsand warnings alone, because altering them can break correctly runningprograms.  It will attempt to print a message when uncaught INT, BUS, orSEGV signals arrive.  (But see the mention of signals in L<BUGS> below.)To disable this default safe mode, set these values to something higherthan 0.  At a level of 1, you get backtraces upon receiving any kindof warning (this is often annoying) or exception (this isoften valuable).  Unfortunately, the debugger cannot discern fatalexceptions from non-fatal ones.  If C<dieLevel> is even 1, then yournon-fatal exceptions are also traced and unceremoniously altered if theycame from C<eval'd> strings or from any kind of C<eval> within modulesyou're attempting to load.  If C<dieLevel> is 2, the debugger doesn'tcare where they came from:  It usurps your exception handler and printsout a trace, then modifies all exceptions with its own embellishments.This may perhaps be useful for some tracing purposes, but tends to hopelesslydestroy any program that takes its exception handling seriously.=item C<AutoTrace>Trace mode (similar to C<t> command, but can be put intoC<PERLDB_OPTS>).=item C<LineInfo>File or pipe to print line number info to.  If it is a pipe (say,C<|visual_perl_db>), then a short message is used.  This is themechanism used to interact with a slave editor or visual debugger,such as the special C<vi> or C<emacs> hooks, or the C<ddd> graphicaldebugger.=item C<inhibit_exit>If 0, allows I<stepping off> the end of the script.=item C<PrintRet>Print return value after C<r> command if set (default).=item C<ornaments>Affects screen appearance of the command line (see L<Term::ReadLine>).There is currently no way to disable these, which can rendersome output illegible on some displays, or with some pagers.This is considered a bug.=item C<frame>Affects the printing of messages upon entry and exit from subroutines.  IfC<frame & 2> is false, messages are printed on entry only. (Printingon exit might be useful if interspersed with other messages.)If C<frame & 4>, arguments to functions are printed, plus contextand caller info.  If C<frame & 8>, overloaded C<stringify> andC<tie>d C<FETCH> is enabled on the printed arguments.  If C<frame& 16>, the return value from the subroutine is printed.The length at which the argument list is truncated is governed by thenext option:=item C<maxTraceLen>Length to truncate the argument list when the C<frame> option'sbit 4 is set.=backThe following options affect what happens with C<V>, C<X>, and C<x>commands:=over 12=item C<arrayDepth>, C<hashDepth>Print only first N elements ('' for all).=item C<compactDump>, C<veryCompact>Change the style of array and hash output.  If C<compactDump>, short arraymay be printed on one line.=item C<globPrint>Whether to print contents of globs.=item C<DumpDBFiles>Dump arrays holding debugged files.=item C<DumpPackages>Dump symbol tables of packages.=item C<DumpReused>Dump contents of "reused" addresses.=item C<quote>, C<HighBit>, C<undefPrint>Change the style of string dump.  The default value for C<quote>is C<auto>; one can enable double-quotish or single-quotish formatby setting it to C<"> or C<'>, respectively.  By default, characterswith their high bit set are printed verbatim.=item C<UsageOnly>Rudimentary per-package memory usage dump.  Calculates totalsize of strings found in variables in the package.  This does notinclude lexicals in a module's file scope, or lost in closures.=backAfter the rc file is read, the debugger reads the C<$ENV{PERLDB_OPTS}>environment variable and parses this as the remainder of a `O ...'line as one might enter at the debugger prompt.  You may place theinitialization options C<TTY>, C<noTTY>, C<ReadLine>, and C<NonStop>there.If your rc file contains:  parse_options("NonStop=1 LineInfo=db.out AutoTrace");then your script will run without human intervention, putting traceinformation into the file I<db.out>.  (If you interrupt it, you'dbetter reset C<LineInfo> to F</dev/tty> if you expect to see anything.)=over 12=item C<TTY>The TTY to use for debugging I/O.=item C<noTTY>If set, the debugger goes into C<NonStop> mode and will not connect to a TTY.  Ifinterrupted (or if control goes to the debugger via explicit setting of$DB::signal or $DB::single from the Perl script), it connects to a TTYspecified in the C<TTY> option at startup, or to a tty found atruntime using the C<Term::Rendezvous> module of your choice.This module should implement a method named C<new> that returns an objectwith two methods: C<IN> and C<OUT>.  These should return filehandles to usefor debugging input and output correspondingly.  The C<new> method shouldinspect an argument containing the value of C<$ENV{PERLDB_NOTTY}> atstartup, or C<"/tmp/perldbtty$$"> otherwise.  This file is not inspected for proper ownership, so security hazards are theoretically

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -