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

📄 debugger-commands.html

📁 一本很好的python的说明书,适合对python感兴趣的人
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>9.1 Debugger Commands </title>
<META NAME="description" CONTENT="9.1 Debugger Commands ">
<META NAME="keywords" CONTENT="lib">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="STYLESHEET" href="lib.css" tppabs="http://www.python.org/doc/current/lib/lib.css">
<LINK REL="next" HREF="node222.html" tppabs="http://www.python.org/doc/current/lib/node222.html">
<LINK REL="previous" href="module-pdb.html" tppabs="http://www.python.org/doc/current/lib/module-pdb.html">
<LINK REL="up" href="module-pdb.html" tppabs="http://www.python.org/doc/current/lib/module-pdb.html">
<LINK REL="next" HREF="node222.html" tppabs="http://www.python.org/doc/current/lib/node222.html">
</head>
<body>
<DIV CLASS="navigation"><table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td><A href="module-pdb.html" tppabs="http://www.python.org/doc/current/lib/module-pdb.html"><img src="previous.gif" tppabs="http://www.python.org/doc/current/icons/previous.gif" border="0" height="32"
  alt="Previous Page" width="32"></A></td>
<td><A href="module-pdb.html" tppabs="http://www.python.org/doc/current/lib/module-pdb.html"><img src="up.gif" tppabs="http://www.python.org/doc/current/icons/up.gif" border="0" height="32"
  alt="Up One Level" width="32"></A></td>
<td><A HREF="node222.html" tppabs="http://www.python.org/doc/current/lib/node222.html"><img src="next.gif" tppabs="http://www.python.org/doc/current/icons/next.gif" border="0" height="32"
  alt="Next Page" width="32"></A></td>
<td align="center" width="100%">Python Library Reference</td>
<td><A href="contents.html" tppabs="http://www.python.org/doc/current/lib/contents.html"><img src="contents.gif" tppabs="http://www.python.org/doc/current/icons/contents.gif" border="0" height="32"
  alt="Contents" width="32"></A></td>
<td><a href="modindex.html" tppabs="http://www.python.org/doc/current/lib/modindex.html" title="Module Index"><img src="modules.gif" tppabs="http://www.python.org/doc/current/icons/modules.gif" border="0" height="32"
  alt="Module Index" width="32"></a></td>
<td><A href="genindex.html" tppabs="http://www.python.org/doc/current/lib/genindex.html"><img src="index.gif" tppabs="http://www.python.org/doc/current/icons/index.gif" border="0" height="32"
  alt="Index" width="32"></A></td>
</tr></table>
<b class="navlabel">Previous:</b> <a class="sectref" href="module-pdb.html" tppabs="http://www.python.org/doc/current/lib/module-pdb.html">9. The Python Debugger</A>
<b class="navlabel">Up:</b> <a class="sectref" href="module-pdb.html" tppabs="http://www.python.org/doc/current/lib/module-pdb.html">9. The Python Debugger</A>
<b class="navlabel">Next:</b> <a class="sectref" HREF="node222.html" tppabs="http://www.python.org/doc/current/lib/node222.html">9.2 How It Works</A>
<br><hr></DIV>
<!--End of Navigation Panel-->

<H1>
<BR>
9.1 Debugger Commands 
</H1>

<P>
The debugger recognizes the following commands.  Most commands can be
abbreviated to one or two letters; e.g. "<tt class="samp">h(elp)</tt>" means that
either "<tt class="samp">h</tt>" or "<tt class="samp">help</tt>" can be used to enter the help
command (but not "<tt class="samp">he</tt>" or "<tt class="samp">hel</tt>", nor "<tt class="samp">H</tt>" or
"<tt class="samp">Help</tt>" or "<tt class="samp">HELP</tt>").  Arguments to commands must be
separated by whitespace (spaces or tabs).  Optional arguments are
enclosed in square brackets ("<tt class="samp">[]</tt>") in the command syntax; the
square brackets must not be typed.  Alternatives in the command syntax
are separated by a vertical bar ("<tt class="samp">|</tt>").

<P>
Entering a blank line repeats the last command entered.  Exception: if
the last command was a "<tt class="samp">list</tt>" command, the next 11 lines are
listed.

<P>
Commands that the debugger doesn't recognize are assumed to be Python
statements and are executed in the context of the program being
debugged.  Python statements can also be prefixed with an exclamation
point ("<tt class="samp">!</tt>").  This is a powerful way to inspect the program
being debugged; it is even possible to change a variable or call a
function.  When an
exception occurs in such a statement, the exception name is printed
but the debugger's state is not changed.

<P>
Multiple commands may be entered on a single line, separated by
"<tt class="samp">;;</tt>".  (A single "<tt class="samp">;</tt>" is not used as it is
the separator for multiple commands in a line that is passed to
the Python parser.)
No intelligence is applied to separating the commands;
the input is split at the first "<tt class="samp">;;</tt>" pair, even if it is in
the middle of a quoted string.

<P>
The debugger supports aliases.  Aliases can have parameters which
allows one a certain level of adaptability to the context under
examination.

<P>
If a file <span class="file">.pdbrc</span>

exists in the user's home directory or in the current directory, it is
read in and executed as if it had been typed at the debugger prompt.
This is particularly useful for aliases.  If both files exist, the one
in the home directory is read first and aliases defined there can be
overridden by the local file.

<P>
<DL>
<DT><STRONG>h(elp) <big>[</big><var>command</var><big>]</big></STRONG></DT>
<DD><P>
Without argument, print the list of available commands.  With a
<var>command</var> as argument, print help about that command.  "<tt class="samp">help
pdb</tt>" displays the full documentation file; if the environment variable
<a class="envvar" name='l2h-1949'>$PAGER</a> is defined, the file is piped through that command
instead.  Since the <var>command</var> argument must be an identifier,
"<tt class="samp">help exec</tt>" must be entered to get help on the "<tt class="samp">!</tt>" command.

<P>
</DD>
<DT><STRONG>w(here)</STRONG></DT>
<DD><P>
Print a stack trace, with the most recent frame at the bottom.  An
arrow indicates the current frame, which determines the context of
most commands.

<P>
</DD>
<DT><STRONG>d(own)</STRONG></DT>
<DD><P>
Move the current frame one level down in the stack trace
(to an newer frame).

<P>
</DD>
<DT><STRONG>u(p)</STRONG></DT>
<DD><P>
Move the current frame one level up in the stack trace
(to a older frame).

<P>
</DD>
<DT><STRONG>b(reak) <big>[</big><big>[</big><var>filename</var>:<big>]</big><var>lineno</var><code><BIG CLASS="XLARGE">|</BIG></code><var>function</var><big>[</big>, <var>condition</var><big>]</big><big>]</big></STRONG></DT>
<DD><P>
With a <var>lineno</var> argument, set a break there in the current
file.  With a <var>function</var> argument, set a break at the first
executable statement within that function.
The line number may be prefixed with a filename and a colon,
to specify a breakpoint in another file (probably one that
hasn't been loaded yet).  The file is searched on <code>sys.path</code>.
Note that each breakpoint is assigned a number to which all the other
breakpoint commands refer.

<P>
If a second argument is present, it is an expression which must
evaluate to true before the breakpoint is honored.

<P>
Without argument, list all breaks, including for each breakpoint,
the number of times that breakpoint has been hit, the current
ignore count, and the associated condition if any.

<P>
</DD>
<DT><STRONG>tbreak <big>[</big><big>[</big><var>filename</var>:<big>]</big><var>lineno</var><code><BIG CLASS="XLARGE">|</BIG></code><var>function</var><big>[</big>, <var>condition</var><big>]</big><big>]</big></STRONG></DT>
<DD><P>
Temporary breakpoint, which is removed automatically when it is
first hit.  The arguments are the same as break.

<P>
</DD>
<DT><STRONG>cl(ear) <big>[</big><var>bpnumber</var> <big>[</big><var>bpnumber ...</var><big>]</big><big>]</big></STRONG></DT>
<DD><P>
With a space separated list of breakpoint numbers, clear those
breakpoints.  Without argument, clear all breaks (but first
ask confirmation).

<P>
</DD>
<DT><STRONG>disable <big>[</big><var>bpnumber</var> <big>[</big><var>bpnumber ...</var><big>]</big><big>]</big></STRONG></DT>
<DD><P>
Disables the breakpoints given as a space separated list of
breakpoint numbers.  Disabling a breakpoint means it cannot cause
the program to stop execution, but unlike clearing a breakpoint, it
remains in the list of breakpoints and can be (re-)enabled.

<P>

⌨️ 快捷键说明

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