@@ -13,20 +13,19 @@ \chapter{The Python Debugger}
1313under program control.
1414
1515The debugger is extensible --- it is actually defined as a class
16- \code {Pdb}. This is currently undocumented but easily understood by
17- reading the source. The extension interface uses the (also
18- undocumented) modules \code {bdb} and \code {cmd}.
19- \ttindex {Pdb}
20- \ttindex {bdb}
21- \ttindex {cmd}
16+ \class {Pdb}.
17+ \withsubitem {(class in pdb)}{\ttindex {Pdb}}
18+ This is currently undocumented but easily understood by reading the
19+ source. The extension interface uses the (also undocumented) modules
20+ \module {bdb}\refstmodindex {bdb} and \module {cmd}\refstmodindex {cmd}.
2221
2322A primitive windowing version of the debugger also exists --- this is
24- module \code {wdb}, which requires STDWIN (see the chapter on STDWIN
25- specific modules).
26- \index {stdwin}
27- \ttindex {wdb}
23+ module \module {wdb}, which requires \module {stdwin} (see the chapter
24+ on STDWIN specific modules).
25+ \refbimodindex {stdwin}
26+ \refstmodindex {wdb}
2827
29- The debugger's prompt is `` \code {(Pdb) }'' .
28+ The debugger's prompt is \samp {(Pdb) }.
3029Typical usage to run a program under control of the debugger is:
3130
3231\begin {verbatim }
@@ -41,10 +40,13 @@ \chapter{The Python Debugger}
4140> <string>(1)?()
4241(Pdb)
4342\end {verbatim }
44- %
45- \code {pdb.py} can also be invoked as
43+
44+ \file {pdb.py} can also be invoked as
4645a script to debug other scripts. For example:
47- \code {python /usr/local/lib/python1.4/pdb.py myscript.py}
46+
47+ \begin {verbatim }
48+ python /usr/local/lib/python1.5/pdb.py myscript.py
49+ \end {verbatim }
4850
4951Typical usage to inspect a crashed program is:
5052
@@ -64,7 +66,7 @@ \chapter{The Python Debugger}
6466-> print spam
6567(Pdb)
6668\end {verbatim }
67- %
69+
6870The module defines the following functions; each enters the debugger
6971in a slightly different way:
7072
@@ -224,11 +226,12 @@ \section{Debugger Commands}
224226of the statement resembles a debugger command.
225227To set a global variable, you can prefix the assignment
226228command with a `` \code {global}'' command on the same line, e.g.:
229+
227230\begin {verbatim }
228231(Pdb) global list_options; list_options = ['-l']
229232(Pdb)
230233\end {verbatim }
231- %
234+
232235\item [q(uit)]
233236
234237Quit from the debugger.
@@ -245,18 +248,10 @@ \section{How It Works}
245248\item there can also a local trace function (see later)
246249\end {itemize }
247250
248- Trace functions have three arguments: (\var {frame}, \var {event}, \var {arg})
249-
250- \begin {description }
251-
252- \item [\var {frame}] is the current stack frame
253-
254- \item [\var {event}] is a string: \code {'call'}, \code {'line'}, \code {'return'}
255- or \code {'exception'}
256-
257- \item [\var {arg}] is dependent on the event type
258-
259- \end {description }
251+ Trace functions have three arguments: \var {frame}, \var {event}, and
252+ \var {arg}. \var {frame} is the current stack frame. \var {event} is a
253+ string: \code {'call'}, \code {'line'}, \code {'return'} or
254+ \code {'exception'}. \var {arg} depends on the event type.
260255
261256The global trace function is invoked (with \var {event} set to
262257\code {'call'}) whenever a new local scope is entered; it should return
0 commit comments