You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/features.rst
+34-44Lines changed: 34 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,7 @@
3
3
Features
4
4
========
5
5
6
-
Since this debugger is similar to other_ trepanning_ debuggers_ and *gdb*
7
-
in general, knowledge gained by learning this is transferable to those
6
+
Since this debugger is similar to other_ trepanning_ debuggers_ and *gdb* in general, knowledge gained by learning this is transferable to those
8
7
debuggers and vice versa.
9
8
10
9
There's a lot of cool stuff here that's not in the stock
@@ -14,32 +13,29 @@ Python debugger *pdb*, or in any other Python debugger that I know about.
14
13
More Exact location information
15
14
-------------------------------
16
15
17
-
Python reports line information on the granularity of a line. To get
18
-
more precise information, we can (de)parse into Python the byte code
19
-
around a bytecode offset such as the place you are stopped at.
16
+
Python reports line information on the granularity of a line. To get more precise information, we can (de)parse into Python the bytecode
17
+
around a bytecode offset, such as the place you are stopped at.
20
18
21
-
So far as I know, there is no other debugger that decompile code at runtime.
19
+
So far as I know, there is no other debugger that decompiles code at runtime.
22
20
23
21
See the `deparse <deparse>`_ command for details.
24
22
25
-
We use information in the line number table in byte to understand
23
+
We use information in the line number table in bytes to understand
26
24
which lines are breakpointable, and in which module or function the
27
-
line appears in. Use `info line <_info_line>`_ to see this information.
25
+
line appears. Use `info line <_info_line>`_ to see this information.
28
26
29
-
In the future we may allow specifying an offset to indicate which
27
+
In the future, we may allow specifying an offset to indicate which
30
28
offset to stop at when there are several choices for a given line
31
29
number.
32
30
33
31
34
32
Debugging Python bytecode (no source available)
35
33
-----------------------------------------------
36
34
37
-
You can pass the debugger the name of Python bytecode and many times,
38
-
the debugger will merrily proceed. This debugger tries very hard find
39
-
the source code. Either by using the current executable search path
35
+
You can pass the debugger the name of Python bytecode, and many times, the debugger will merrily proceed. This debugger tries very hard to find the source code. Either by using the current executable search path
40
36
(e.g. ``PATH``) or for some by looking inside the bytecode for a
41
37
filename in the main code object (``co_filename``) and applying that
42
-
with a search path which takes into account directory where the
38
+
with a search path that takes into account the directory where the
43
39
bytecode lives.
44
40
45
41
Failing to find source code this way, and in other situations where
@@ -57,7 +53,7 @@ Source-code Syntax Colorization
57
53
-------------------------------
58
54
59
55
Terminal source code is colorized via pygments_ . And with that you
60
-
can set the pygments color style, e.g. "colorful", "paraiso-dark". See
56
+
can set the pygments color style, e.g., "colorful", "paraiso-dark". See
61
57
:ref:`set style <set_style>`. Furthermore, we make use of terminal bold
62
58
and emphasized text in debugger output and help text. Of course, you
63
59
can also turn this off. Starting with release 0.6.0, you can use your
@@ -84,16 +80,16 @@ Smart Eval
84
80
----------
85
81
86
82
If you want to evaluate the current source line before it is run in
87
-
the code, use ``eval``. To evaluate text of a common fragment of line,
83
+
the code, use ``eval``. To evaluate the text of a common fragment of a line,
88
84
such as the expression part of an *if* statement, you can do that with
89
85
``eval?``. See :ref:`eval` for more information.
90
86
91
87
More Stepping Control
92
88
---------------------
93
89
94
-
Sometimes you want small steps, and sometimes large stepping.
90
+
Sometimes you want small steps, and sometimes large steps.
95
91
96
-
This fundamental issue is handled in a couple ways:
92
+
This fundamental issue is handled in a couple of ways:
97
93
98
94
Step Granularity
99
95
................
@@ -127,63 +123,57 @@ definitions probably also added to this tedium.
127
123
128
124
Because we're really handling return events, we can show you the return value. (*pdb* has an "undocumented" *retval* command that doesn't seem to work.)
129
125
130
-
Debugger Macros via Python Lambda expressions
126
+
Debugger Macros via Python Lambda Expressions
131
127
---------------------------------------------
132
128
133
-
There are debugger macros. In *gdb*, there is a *macro* debugger
134
-
command to extend debugger commands.
129
+
There are debugger macros. In *gdb*, there is a *macro* debugger command to extend debugger commands.
135
130
136
-
However Python has its own rich programming language so it seems silly
131
+
However, Python has its own rich programming language, so it seems silly
137
132
to recreate the macro language that is in *gdb*. Simpler and more
138
133
powerful is just to use Python here. A debugger macro here is just a
139
-
lambda expression which returns a string or a list of strings. Each
134
+
lambda expression that returns a string or a list of strings. Each
140
135
string returned should be a debugger command.
141
136
142
137
We also have *aliases* for the extremely simple situation where you
143
138
want to give an alias to an existing debugger command. But beware:
144
139
some commands, like step_ inspect command suffixes and change their
145
140
behavior accordingly.
146
141
147
-
We also envision a number of other ways to allow extension of this
148
-
debugger either through additional modules, or user-supplied debugger
149
-
command directories.
142
+
We also envision a number of other ways to allow the extension of this
143
+
debugger either through additional modules or through user-supplied debugger command directories.
150
144
151
145
Byte-code Instruction Introspection
152
146
------------------------------------
153
147
154
-
We do more in the way of looking at the byte codes to give better information. Through this we can provide:
148
+
We do more in the way of looking at the byte codes to give better information. Through this, we can provide:
155
149
156
-
* a *skip* command. It is like the *jump* command, but you don't have
150
+
* A *skip* command. It is like the *jump* command, but you don't have
157
151
to deal with line numbers.
158
-
* disassembly of code fragments. You can now disassemble relative to
152
+
* Disassembly of code fragments. You can now disassemble relative to
159
153
the stack frames you are currently stopped at.
160
154
* Better interpretation of where you are when inside *execfile* or
161
-
*exec*. (But really though this is probably a Python compiler
155
+
*exec*. (But really, though this is probably a Python compiler
162
156
misfeature.)
163
157
* Check that breakpoints are set only where they make sense.
164
-
* A more accurate determination of if you are at a function-defining
158
+
* A more accurate determination of whether you are at a function-defining
165
159
*def* or *class* statements (because the caller instruction contains
166
160
``MAKE_FUNCTION`` or ``BUILD_CLASS``.)
167
161
168
162
Even without "deparsing" mentioned above, the ability to disassemble
169
-
where the PC is currently located (see `info pc <info_pc>`_), by line
170
-
number range or byte-offset range lets you tell exactly where you are
171
-
and code is getting run.
163
+
where the PC is currently located (see `info pc <info_pc>`_), by line number range or byte-offset range lets you tell exactly where you are and the code is getting run.
172
164
173
165
Some Debugger Command Arguments can be Variables and Expressions
Commands that take integer arguments like *up*, *list* or
177
-
*disassemble* allow you to use a Python expression which may include
178
-
local or global variables that evaluates to an integer. This
168
+
Commands that take integer arguments like *up*, *list*, or *disassemble* allow you to use a Python expression which may include
169
+
local or global variables that evaluate to an integer. This
179
170
eliminates the need in *gdb* for special "dollar" debugger
180
-
variables. (Note however because of *shlex* parsing ,expressions can't
181
-
have embedded blanks.)
171
+
variables. (Note, however, because of *shlex* parsing, expressions can't have embedded blanks.)
182
172
183
173
Out-of-Process Debugging
184
174
------------------------
185
175
186
-
You can now debug your program in a different process or even a different computer on a different network!
176
+
You can now debug your program in a different process or even on a different computer on a different network!
187
177
188
178
Egg, Wheel, and Tarballs
189
179
------------------------
@@ -196,17 +186,17 @@ full instructions and installing from git and by other means.
196
186
Modularity
197
187
----------
198
188
199
-
The Debugger plays nice with other trace hooks. You can have several debugger objects.
189
+
The Debugger plays nicely with other trace hooks. You can have several debugger objects.
200
190
201
191
Many of the things listed below doesn't directly effect end-users, but
202
192
it does eventually by way of more robust and featureful code. And
203
193
keeping developers happy is a good thing.(TM)
204
194
205
-
* Commands and subcommands are individual classes now, not methods in a class. This means they now have properties like the context in which they can be run, minimum abbreviation name or alias names. To add a new command you basically add a file in a directory.
206
-
* I/O is it's own layer. This simplifies interactive readline behavior from reading commands over a TCP socket.
207
-
* An interface is it's own layer. Local debugging, remote debugging, running debugger commands from a file (``source``) are different interfaces. This means, for example, that we are able to give better error reporting if a debugger command file has an error.
195
+
* Commands and subcommands are individual classes now, not methods in a class. This means they now have properties like the context in which they can be run, a minimum abbreviation name, or alias names. To add a new command, you basically add a file in a directory.
196
+
* I/O is its own layer. This simplifies interactive readline behavior from reading commands over a TCP socket.
197
+
* An interface is its own layer. Local debugging, remote debugging, and running debugger commands from a file (``source``) are different interfaces. This means, for example, that we are able to give better error reporting if a debugger command file has an error.
208
198
* There is an experimental Python-friendly interface for front-ends
209
-
* more testable. Much more unit and functional tests. More of *pydb*'s integration test will eventually be added.
199
+
* more testable. Much more unit and functional tests. More of *pydb*'s integration tests will eventually be added.
0 commit comments