perldebug.html
来自「perl教程」· HTML 代码 · 共 1,321 行 · 第 1/4 页
HTML
1,321 行
<dd>
<p>List subroutine names [not] matching the regex.</p>
</dd>
</li>
<dt><strong><a name="item_t">t</a></strong>
<dd>
<p>Toggle trace mode (see also the <a href="#item_autotrace"><code>AutoTrace</code></a> option).</p>
</dd>
</li>
<dt><strong><a name="item_t_expr">t expr</a></strong>
<dd>
<p>Trace through execution of <code>expr</code>.
See <a href="../../lib/Pod/perldebguts.html#frame_listing_output_examples">Frame Listing Output Examples in the perldebguts manpage</a> for examples.</p>
</dd>
</li>
<dt><strong><a name="item_b">b</a></strong>
<dd>
<p>Sets breakpoint on current line</p>
</dd>
</li>
<dt><strong><a name="item_b__5bline_5d__5bcondition_5d">b [line] [condition]</a></strong>
<dd>
<p>Set a breakpoint before the given line. If a condition
is specified, it's evaluated each time the statement is reached: a
breakpoint is taken only if the condition is true. Breakpoints may
only be set on lines that begin an executable statement. Conditions
don't use <code>if</code>:</p>
</dd>
<dd>
<pre>
b 237 $x > 30
b 237 ++$count237 < 11
b 33 /pattern/i</pre>
</dd>
</li>
<dt><strong><a name="item_b_subname__5bcondition_5d">b subname [condition]</a></strong>
<dd>
<p>Set a breakpoint before the first line of the named subroutine. <em>subname</em> may
be a variable containing a code reference (in this case <em>condition</em>
is not supported).</p>
</dd>
</li>
<dt><strong><a name="item_b_postpone_subname__5bcondition_5d">b postpone subname [condition]</a></strong>
<dd>
<p>Set a breakpoint at first line of subroutine after it is compiled.</p>
</dd>
</li>
<dt><strong><a name="item_b_load_filename">b load filename</a></strong>
<dd>
<p>Set a breakpoint before the first executed line of the <em>filename</em>,
which should be a full pathname found amongst the %INC values.</p>
</dd>
</li>
<dt><strong><a name="item_b_compile_subname">b compile subname</a></strong>
<dd>
<p>Sets a breakpoint before the first statement executed after the specified
subroutine is compiled.</p>
</dd>
</li>
<dt><strong><a name="item_b_line">B line</a></strong>
<dd>
<p>Delete a breakpoint from the specified <em>line</em>.</p>
</dd>
</li>
<dt><strong><a name="item_b__2a">B *</a></strong>
<dd>
<p>Delete all installed breakpoints.</p>
</dd>
</li>
<dt><strong><a name="item_a__5bline_5d_command">a [line] command</a></strong>
<dd>
<p>Set an action to be done before the line is executed. If <em>line</em> is
omitted, set an action on the line about to be executed.
The sequence of steps taken by the debugger is</p>
</dd>
<dd>
<pre>
1. check for a breakpoint at this line
2. print the line if necessary (tracing)
3. do any actions associated with that line
4. prompt user if at a breakpoint or in single-step
5. evaluate line</pre>
</dd>
<dd>
<p>For example, this will print out $foo every time line
53 is passed:</p>
</dd>
<dd>
<pre>
a 53 print "DB FOUND $foo\n"</pre>
</dd>
</li>
<dt><strong><a name="item_a_line">A line</a></strong>
<dd>
<p>Delete an action from the specified line.</p>
</dd>
</li>
<dt><strong><a name="item_a__2a">A *</a></strong>
<dd>
<p>Delete all installed actions.</p>
</dd>
</li>
<dt><strong><a name="item_w_expr">w expr</a></strong>
<dd>
<p>Add a global watch-expression. We hope you know what one of these
is, because they're supposed to be obvious.</p>
</dd>
</li>
<dt><strong><a name="item_w_expr">W expr</a></strong>
<dd>
<p>Delete watch-expression</p>
</dd>
</li>
<dt><strong><a name="item_w__2a">W *</a></strong>
<dd>
<p>Delete all watch-expressions.</p>
</dd>
</li>
<dt><strong><a name="item_o">o</a></strong>
<dd>
<p>Display all options</p>
</dd>
</li>
<dt><strong><a name="item_o_booloption__2e_2e_2e">o booloption ...</a></strong>
<dd>
<p>Set each listed Boolean option to the value <code>1</code>.</p>
</dd>
</li>
<dt><strong><a name="item_o_anyoption_3f__2e_2e_2e">o anyoption? ...</a></strong>
<dd>
<p>Print out the value of one or more options.</p>
</dd>
</li>
<dt><strong><a name="item_o_option_3dvalue__2e_2e_2e">o option=value ...</a></strong>
<dd>
<p>Set the value of one or more options. If the value has internal
whitespace, it should be quoted. For example, you could set <code>o
pager="less -MQeicsNfr"</code> to call <strong>less</strong> with those specific options.
You may use either single or double quotes, but if you do, you must
escape any embedded instances of same sort of quote you began with,
as well as any escaping any escapes that immediately precede that
quote but which are not meant to escape the quote itself. In other
words, you follow single-quoting rules irrespective of the quote;
eg: <code>o option='this isn\'t bad'</code> or <code>o option="She said, \"Isn't
it?\""</code>.</p>
</dd>
<dd>
<p>For historical reasons, the <code>=value</code> is optional, but defaults to
1 only where it is safe to do so--that is, mostly for Boolean
options. It is always better to assign a specific value using <code>=</code>.
The <code>option</code> can be abbreviated, but for clarity probably should
not be. Several options can be set together. See <a href="#configurable_options">Configurable Options</a>
for a list of these.</p>
</dd>
</li>
<dt><strong><a name="item__3c__3f__3e">< ?
></a></strong>
<dd>
<p>List out all pre-prompt Perl command actions.</p>
</dd>
</li>
<dt><strong><a name="item__3c__5b_command__5d__3e">< [ command ]
></a></strong>
<dd>
<p>Set an action (Perl command) to happen before every debugger prompt.
A multi-line command may be entered by backslashing the newlines.</p>
</dd>
</li>
<dt><strong><a name="item__3c__2a__3e">< *
></a></strong>
<dd>
<p>Delete all pre-prompt Perl command actions.</p>
</dd>
</li>
<dt><strong><a name="item__3c_3c_command__3e"><< command
></a></strong>
<dd>
<p>Add an action (Perl command) to happen before every debugger prompt.
A multi-line command may be entered by backwhacking the newlines.</p>
</dd>
</li>
<dt><strong><a name="item__3e__3f__3e_3e">> ?
>></a></strong>
<dd>
<p>List out post-prompt Perl command actions.</p>
</dd>
</li>
<dt><strong><a name="item__3e_command__3e_3e">> command
>></a></strong>
<dd>
<p>Set an action (Perl command) to happen after the prompt when you've
just given a command to return to executing the script. A multi-line
command may be entered by backslashing the newlines (we bet you
couldn't've guessed this by now).</p>
</dd>
</li>
<dt><strong><a name="item__3e__2a__3e_3e">> *
>></a></strong>
<dd>
<p>Delete all post-prompt Perl command actions.</p>
</dd>
</li>
<dt><strong><a name="item__3e_3e_command__3e__3e_3e_3e">>> command
> >>></a></strong>
<dd>
<p>Adds an action (Perl command) to happen after the prompt when you've
just given a command to return to executing the script. A multi-line
command may be entered by backslashing the newlines.</p>
</dd>
</li>
<dt><strong><a name="item__7b__3f">{ ?</a></strong>
<dd>
<p>List out pre-prompt debugger commands.</p>
</dd>
</li>
<dt><strong><a name="item__7b__5b_command__5d">{ [ command ]</a></strong>
<dd>
<p>Set an action (debugger command) to happen before every debugger prompt.
A multi-line command may be entered in the customary fashion.</p>
</dd>
<dd>
<p>Because this command is in some senses new, a warning is issued if
you appear to have accidentally entered a block instead. If that's
what you mean to do, write it as with <code>;{ ... }</code> or even
<a href="../../lib/Pod/perlfunc.html#item_do"><code>do { ... }</code></a>.</p>
</dd>
</li>
<dt><strong><a name="item__7b__2a">{ *</a></strong>
<dd>
<p>Delete all pre-prompt debugger commands.</p>
</dd>
</li>
<dt><strong><a name="item__7b_7b_command">{{ command</a></strong>
<dd>
<p>Add an action (debugger command) to happen before every debugger prompt.
A multi-line command may be entered, if you can guess how: see above.</p>
</dd>
</li>
<dt><strong><a name="item__21_number">! number</a></strong>
<dd>
<p>Redo a previous command (defaults to the previous command).</p>
</dd>
</li>
<dt><strong><a name="item__21__2dnumber">! -number</a></strong>
<dd>
<p>Redo number'th previous command.</p>
</dd>
</li>
<dt><strong><a name="item__21_pattern">! pattern</a></strong>
<dd>
<p>Redo last command that started with pattern.
See <code>o recallCommand</code>, too.</p>
</dd>
</li>
<dt><strong><a name="item__21_21_cmd">!! cmd</a></strong>
<dd>
<p>Run cmd in a subprocess (reads from DB::IN, writes to DB::OUT) See
<code>o shellBang</code>, also. Note that the user's current shell (well,
their <code>$ENV{SHELL}</code> variable) will be used, which can interfere
with proper interpretation of exit status or signal and coredump
information.</p>
</dd>
</li>
<dt><strong><a name="item_source_file">source file</a></strong>
<dd>
<p>Read and execute debugger commands from <em>file</em>.
<em>file</em> may itself contain <code>source</code> commands.</p>
</dd>
</li>
<dt><strong><a name="item_h__2dnumber">H -number</a></strong>
<dd>
<p>Display last n commands. Only commands longer than one character are
listed. If <em>number</em> is omitted, list them all.</p>
</dd>
</li>
<dt><strong><a name="item_q_or__5ed">q or ^D</a></strong>
<dd>
<p>Quit. ("quit" doesn't work for this, unless you've made an alias)
This is the only supported way to exit the debugger, though typing
<a href="../../lib/Pod/perlfunc.html#item_exit"><code>exit</code></a> twice might work.</p>
</dd>
<dd>
<p>Set the <a href="#item_inhibit_exit"><code>inhibit_exit</code></a> option to 0 if you want to be able to step
off the end the script. You may also need to set $finished to 0
if you want to step through global destruction.</p>
</dd>
</li>
<dt><strong><a name="item_r">R</a></strong>
<dd>
<p>Restart the debugger by <a href="../../lib/Pod/perlfunc.html#item_exec"><code>exec()</code></a>ing a new session. We try to maintain
your history across this, but internal settings and command-line options
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?