File: pydb.1.in

package info (click to toggle)
pydb 1.26-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 2,460 kB
  • ctags: 1,061
  • sloc: python: 4,200; perl: 2,479; sh: 873; lisp: 866; makefile: 634; ansic: 16
file content (282 lines) | stat: -rw-r--r-- 8,270 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
.\"$Id: pydb.1.in,v 1.15 2008/06/10 01:05:35 rockyb Exp $
.TH pydb 1 
.\"===================================================================
.SH NAME
pydb \(em enhanced Python debugger
.\"===================================================================
.SH SYNOPSIS
.B pydb 
[debugger-options] 
python-script 
[script-options...]
.\"===================================================================
.SH DESCRIPTION
This manual page documents briefly the
.BR pydb
command.
.PP
.B pydb
is an extended Python debugger. It extends the Python standard
debugger pdb and is suited for use with the graphical debugger DDD.
The purpose of a debugger such as this one is to allow you to see what is
going on ``inside'' another program while it executes\(em\&or what another
program was doing at the moment it crashed.

.PP
We follow gdb's command set unless there's good reason not to.

.PP
pydb can do four main kinds of things (plus other things in support of
these) to help you catch bugs in the act:

.TP
\ \ \ \(bu Start or restart your Python script, specifying arguments that might affect its behavior.

.TP
\ \ \ \(bu Make your program stop at various points possibly determined by
specified conditions.

.TP
\ \ \ \(bu Examine what has happened when your program has stopped.

.TP
\ \ \ \(bu Change things in your program, so you can experiment with correcting the effects of one bug and go on to learn about another.
.PP

Here are some of the most frequently-needed commands:

.\"-------------------------------------------------------------------
.TP
.B break \fR[\|\fIfile\fB:\fIline\fR\fR|\fIfunction\fR]
\&
Set a breakpoint at \c
.I function\c
\& or at the specified file and line.
.PP
.\"-------------------------------------------------------------------
.TP
.B clear \fR[\|\fIfile\fB:\fIline\fR\fR|\fIfunction\fR]
\&
Clear a breakpoint at \c
.I function\c
\& or at the specified file and line. If line number is specified, all
breakpoints in that line are cleared. If a function is specified,
breakpoints at beginning of function are cleared.  With no argument,
clears all breakpoints in the line that the selected frame is
executing in. See also the 
.B delete
command which clears breakpoints by number.
.PP
.\"-------------------------------------------------------------------
.TP
.B continue \fR[\fIline\fR]
\&
Continue running your program until the next breakpoint or until the
end of the program. If a line number is given set a one-time
breakpoint at that line. 
.PP
.\"-------------------------------------------------------------------
.TP
.B delete \fR[\fIbreakpoint-numbers\fR]
\& 
Delete breakpoints by number. To delete all breakpoints, give no
breakpoint number.  See also the 
.B clear
command which clears breakpoints by line/file number.
.PP
.\"-------------------------------------------------------------------
.TP
.B disassemble \fR[\fIlocation\fR]
\& 
Disassemble Python instructions at the point you are currently stopped
at. If location is a line number, do not show instructions before
line. Location can also be a class, method, function, code or string
argument.
.PP
.\"-------------------------------------------------------------------
.TP
.BI examine " expr"\c
\&
Give type/object and value information about expression.
.TP
.PP
.BI finish\c
\& 
Run until the completion of the current function or method.
.PP
.TP
.BI frame " frame-number" 
\&
Set the stack frame to \fIframe-number\fR for purposes of examinine local variables. For positioning relative to the current frame, use 
.B up
or 
.B down.
.PP
.\"-------------------------------------------------------------------
.TP
.B help \fR[\|\fIname\fR\|]
Show information about pydb command \c
.I name\c
\&, or general information
about using pydb.
.PP
.\"-------------------------------------------------------------------
.TP
.B info \fR[\|\fIname\fR\|]
\&
Get the various information usually about the debugged program.
.PP
.\"-------------------------------------------------------------------
.TP
.B list \fR[\|\fIfile\fB:\fIline\fR|\fIfunction]
type the text of the program in the vicinity of where it is presently stopped
or at the specified function or file and line.
.PP
.\"-------------------------------------------------------------------
.TP
.B next \fR[\|\fIcount\fR\|]
Execute next program line(s) (after stopping); step \c
.I over\c
\& any
function calls in the line.
.PP
.\"-------------------------------------------------------------------
.TP
.BI pp " expr"\c
\&
Pretty print the value of an expression.
.PP
.\"-------------------------------------------------------------------
.TP
.BI print " expr"\c
\&
Display the value of an expression.
.PP
.\"-------------------------------------------------------------------
.TP
.BI source " filename"\c
\&
Read and execute the lines in file \fIfilename\fR as a series of debugger 
commands. An error in any command terminates execution of the command
file and control is returned to the console.
.PP
.\"-------------------------------------------------------------------
.TP
.B quit
\&
Exit from the debugger.
.PP
.\"-------------------------------------------------------------------
.TP
.B run \fR[\|\fIarglist\fR\|]
(Re)start your program (with \c
.I arglist\c
\&, if specified). If you want the debugger to get reloaded, use
.B restart
instead.
.PP
.\"-------------------------------------------------------------------
.TP
.B set
Modify parts of the debugger environment.
.PP
.TP
.B shell \fIcommand\fR
Run a shell command.
.PP
.\"-------------------------------------------------------------------
.TP
.B show
See the debugger environment settings
.PP
.\"-------------------------------------------------------------------
.TP
.B step \fR[\|\fIcount\fR\|]
Execute next program line(s) (after stopping); step \c
.I into\c
\& any
function calls in the line.
.PP
.\"-------------------------------------------------------------------
.TP
.B where \fR[\|\fIcount\fR\|]
Display all or \fIcount\fR items of the program stack.
.PP
For full details on pydb, see \c
http://bashdb.sourceforge.net/pydb/pydb/index.html
.\"===================================================================
.SH OPTIONS
.PP
.TP 10
.B \-\-version
show the version number and exit
.TP
.B \-h | \-\-help
show invocation help and exit
.TP
.B \-X | \-\-trace
Show lines before executing them. This option also sets
.B \-\-batch.
.TP
.B \-X | \-\-fntrace
Show functions before executing them. This option also sets
.B \-\-batch
.TP
.B \-\-batch
Don't run interactive commands on debugger entry
.TP
.B \-\-basename
Report file locations as only the base filename, and omit the
directory name. This is useful in running regression tests.
.TP
.B \-x | \-\-command=FILE
Execute commands from FILE.
.TP
.B \-\-cd=DIR
Change current directory to DIR.
.TP
.B \-\-error=FILE
Write debugger's error output (stderr) to FILE
.TP
.TP
.B \-e | \-\-exec
Run debugger commands command-list. Commands should be separated by
";;"-the same as you would do inside the debugger. You may need to
quote this option to prevent command shell interpretation, e.g. 
.B \-\-exec
"break 20;; continue"
.TP
.B \-n | \-\-nx
Don't execute commands found in any initialization files
.TP
.B \-o FILE | \-\-output=FILE
Write debugger's output (stdout) to FILE
.TP
.B \-\-sigcheck
Set to watch for signal handler changes.
.TP
.B -T, --threading
Start off with threading debug support.
.TP
.B \-A LEVEL | \-\-annotate=LEVEL
Set gdb-like annotation_level. The annotation level is used by
front-ends to get posted about program information when things change
without having to poll for the information.
.PD
.\"===================================================================
.SH "SEE ALSO"
.Sp 
http://bashdb.sourceforge.net/pydb/
.PP
.Sp
http://bashdb.sourceforge.net/pydb/lib/index.html
.\"===================================================================
.SH AUTHOR
pydb was written by Richard Wolff <rwolff@noao.edu> (now retired)
based on the standard Python debugger pdb.py. Over the many years, pdb.py and
pydb.py have diverged. It was subsequently revised and
expanded to be more like gdb by Rocky Bernstein <rocky@gnu.org>

The first version of this manual page was written by Gregor Hoffleit
<flight@debian.org> for the Debian project (but may be used by
others).