Skip to content

Commit c1c30aa

Browse files
authored
Update features.rst
1 parent bc0eaa3 commit c1c30aa

File tree

1 file changed

+34
-44
lines changed

1 file changed

+34
-44
lines changed

docs/features.rst

Lines changed: 34 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
Features
44
========
55

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
87
debuggers and vice versa.
98

109
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.
1413
More Exact location information
1514
-------------------------------
1615

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.
2018

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.
2220

2321
See the `deparse <deparse>`_ command for details.
2422

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
2624
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.
2826

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
3028
offset to stop at when there are several choices for a given line
3129
number.
3230

3331

3432
Debugging Python bytecode (no source available)
3533
-----------------------------------------------
3634

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
4036
(e.g. ``PATH``) or for some by looking inside the bytecode for a
4137
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
4339
bytecode lives.
4440

4541
Failing to find source code this way, and in other situations where
@@ -57,7 +53,7 @@ Source-code Syntax Colorization
5753
-------------------------------
5854

5955
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
6157
:ref:`set style <set_style>`. Furthermore, we make use of terminal bold
6258
and emphasized text in debugger output and help text. Of course, you
6359
can also turn this off. Starting with release 0.6.0, you can use your
@@ -84,16 +80,16 @@ Smart Eval
8480
----------
8581

8682
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,
8884
such as the expression part of an *if* statement, you can do that with
8985
``eval?``. See :ref:`eval` for more information.
9086

9187
More Stepping Control
9288
---------------------
9389

94-
Sometimes you want small steps, and sometimes large stepping.
90+
Sometimes you want small steps, and sometimes large steps.
9591

96-
This fundamental issue is handled in a couple ways:
92+
This fundamental issue is handled in a couple of ways:
9793

9894
Step Granularity
9995
................
@@ -127,63 +123,57 @@ definitions probably also added to this tedium.
127123

128124
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.)
129125

130-
Debugger Macros via Python Lambda expressions
126+
Debugger Macros via Python Lambda Expressions
131127
---------------------------------------------
132128

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.
135130

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
137132
to recreate the macro language that is in *gdb*. Simpler and more
138133
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
140135
string returned should be a debugger command.
141136

142137
We also have *aliases* for the extremely simple situation where you
143138
want to give an alias to an existing debugger command. But beware:
144139
some commands, like step_ inspect command suffixes and change their
145140
behavior accordingly.
146141

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.
150144

151145
Byte-code Instruction Introspection
152146
------------------------------------
153147

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:
155149

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
157151
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
159153
the stack frames you are currently stopped at.
160154
* 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
162156
misfeature.)
163157
* 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
165159
*def* or *class* statements (because the caller instruction contains
166160
``MAKE_FUNCTION`` or ``BUILD_CLASS``.)
167161

168162
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.
172164

173165
Some Debugger Command Arguments can be Variables and Expressions
174166
----------------------------------------------------------------
175167

176-
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
179170
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.)
182172

183173
Out-of-Process Debugging
184174
------------------------
185175

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!
187177

188178
Egg, Wheel, and Tarballs
189179
------------------------
@@ -196,17 +186,17 @@ full instructions and installing from git and by other means.
196186
Modularity
197187
----------
198188

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.
200190

201191
Many of the things listed below doesn't directly effect end-users, but
202192
it does eventually by way of more robust and featureful code. And
203193
keeping developers happy is a good thing.(TM)
204194

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.
208198
* 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.
210200

211201
Documentation
212202
-------------

0 commit comments

Comments
 (0)