@@ -3,8 +3,8 @@ The Python Debugger
33
44To use the debugger in its simplest form:
55
6- >>> import pdb
7- >>> pdb.run('<a statement>')
6+ >>> import pdb
7+ >>> pdb.run('<a statement>')
88
99The debugger's prompt is '(Pdb) '. This will stop in the first
1010function call in <a statement>.
@@ -13,10 +13,10 @@ Alternatively, if a statement terminated with an unhandled exception,
1313you can use pdb's post-mortem facility to inspect the contents of the
1414traceback:
1515
16- >>> <a statement>
17- <exception traceback>
18- >>> import pdb
19- >>> pdb.pm()
16+ >>> <a statement>
17+ <exception traceback>
18+ >>> import pdb
19+ >>> pdb.pm()
2020
2121The commands recognized by the debugger are listed in the next
2222section. Most can be abbreviated as indicated; e.g., h(elp) means
@@ -50,17 +50,17 @@ h(elp)
5050 "help exec" gives help on the ! command
5151
5252w(here)
53- Print a stack trace, with the most recent frame at the bottom.
54- An arrow indicates the "current frame", which determines the
55- context of most commands.
53+ Print a stack trace, with the most recent frame at the bottom.
54+ An arrow indicates the "current frame", which determines the
55+ context of most commands.
5656
5757d(own)
58- Move the current frame one level down in the stack trace
59- (to an older frame).
58+ Move the current frame one level down in the stack trace
59+ (to an older frame).
6060
6161u(p)
62- Move the current frame one level up in the stack trace
63- (to a newer frame).
62+ Move the current frame one level up in the stack trace
63+ (to a newer frame).
6464
6565b(reak) ([file:]lineno | function) [, "condition"]
6666 With a line number argument, set a break there in the current
@@ -74,51 +74,51 @@ b(reak) ([file:]lineno | function) [, "condition"]
7474 hasn't been loaded yet). The file is searched on sys.path.
7575
7676cl(ear) [lineno]
77- With a line number argument, clear that break in the current file.
78- Without argument, clear all breaks (but first ask confirmation).
77+ With a line number argument, clear that break in the current file.
78+ Without argument, clear all breaks (but first ask confirmation).
7979
8080 The line number may be prefixed with a filename and a colon,
8181 to specify a breakpoint in another file (probably one that
8282 hasn't been loaded yet). The file is searched on sys.path.
8383
8484s(tep)
85- Execute the current line, stop at the first possible occasion
86- (either in a function that is called or in the current function).
85+ Execute the current line, stop at the first possible occasion
86+ (either in a function that is called or in the current function).
8787
8888n(ext)
89- Continue execution until the next line in the current function
90- is reached or it returns.
89+ Continue execution until the next line in the current function
90+ is reached or it returns.
9191
9292r(eturn)
93- Continue execution until the current function returns.
93+ Continue execution until the current function returns.
9494
9595c(ont(inue))
96- Continue execution, only stop when a breakpoint is encountered.
96+ Continue execution, only stop when a breakpoint is encountered.
9797
9898l(ist) [first [,last]]
99- List source code for the current file.
100- Without arguments, list 11 lines around the current line
101- or continue the previous listing.
102- With one argument, list 11 lines starting at that line.
103- With two arguments, list the given range;
104- if the second argument is less than the first, it is a count.
99+ List source code for the current file.
100+ Without arguments, list 11 lines around the current line
101+ or continue the previous listing.
102+ With one argument, list 11 lines starting at that line.
103+ With two arguments, list the given range;
104+ if the second argument is less than the first, it is a count.
105105
106106a(rgs)
107- Print the argument list of the current function.
107+ Print the argument list of the current function.
108108
109109p expression
110- Print the value of the expression.
110+ Print the value of the expression.
111111
112112(!) statement
113- Execute the (one-line) statement in the context of
114- the current stack frame.
115- The exclamation point can be omitted unless the first word
116- of the statement resembles a debugger command.
117- To assign to a global variable you must always prefix the
118- command with a 'global' command, e.g.:
119- (Pdb) global list_options; list_options = ['-l']
120- (Pdb)
113+ Execute the (one-line) statement in the context of
114+ the current stack frame.
115+ The exclamation point can be omitted unless the first word
116+ of the statement resembles a debugger command.
117+ To assign to a global variable you must always prefix the
118+ command with a 'global' command, e.g.:
119+ (Pdb) global list_options; list_options = ['-l']
120+ (Pdb)
121121
122122q(uit)
123- Quit from the debugger.
124- The program being executed is aborted.
123+ Quit from the debugger.
124+ The program being executed is aborted.
0 commit comments