Skip to content

Commit f101718

Browse files
committed
Add command-option section...
Also make a pass over docs
1 parent db6b7a4 commit f101718

11 files changed

Lines changed: 251 additions & 81 deletions

File tree

docs/entry-exit.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ and call the debugger on signal *USR1*:
255255
signal.signal(signal.SIGUSR1, signal_handler)
256256
# Go about your business...
257257
258-
However, if you have entered the debugger either by running intially or
258+
However, if you have entered the debugger either by running initially or
259259
previously via a debug() call, trepan has already set up such default
260260
handlers for many of the popular signals, like *SIGINT*. To see what
261261
*trepan3k* has installed use the ``info signals`` command:
@@ -272,7 +272,7 @@ handlers for many of the popular signals, like *SIGINT*. To see what
272272
SIGSYS Yes Yes No No Bad system call
273273
...
274274

275-
Commonly occuring signals like *CHILD* and unmaskable signals like
275+
Commonly occurring signals like *CHILD* and unmaskable signals like
276276
*KILL* are not intercepted.
277277

278278
Set up an exception handler allow remote connections
@@ -372,7 +372,7 @@ example it might look like this:
372372
$
373373
374374
375-
By default, the file `$HOME/.config/trepanpy/profile/profile.py` is
376-
loaded, and that a file exists `trepan3k` starts up. To change this
375+
By default, the file ``$HOME/.config/trepan3k/profile/profile.py`` is
376+
loaded, and that a file exists ``trepan3k`` starts up. To change this
377377
default behavior and *not* have the default profile loaded, use the
378-
option `-n`, or `--nx` in the `trepan3k` invocation.
378+
option ``-n``, or ``--nx`` in the ``trepan3k`` invocation.

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ An Emacs interface is available via realgud_.
2626

2727
features
2828
install
29+
options
2930
entry-exit
3031
syntax
3132
commands

docs/manpages/Makefile

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/manpages/trepan3k.rst

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,77 +3,86 @@
33
trepan3k (Python3 debugger)
44
###########################
55

6-
Synopsis
7-
--------
6+
Trepan3k Synopsis
7+
-----------------
88

99
**trepan3k** [ *debugger-options* ] [ \-- ] [ *python-script* [ *script-options* ...]]
1010

1111

12-
Description
13-
-----------
12+
Trepan3k Description
13+
---------------------
1414

1515
Run the Python3 trepan debugger from the outset.
1616

1717

18-
Options
19-
-------
18+
Trepan3k Options
19+
----------------
20+
21+
:\--version:
22+
show program's version number and exit
2023

2124
:-h, \--help:
2225
Show the help message and exit
2326

24-
:-x, \--trace:
27+
:-X, \--trace:
2528
Show lines before executing them.
2629

2730
:-F, \--fntrace:
2831
Show functions before executing them.
2932

3033
:\--basename:
31-
Filenames strip off basename, (e.g. for regression tests)
34+
Show file path basenames, e.g. for regression tests.
3235

3336
:\--client:
34-
Connect to an existing debugger process started with the `--server` option
37+
Connect to an existing debugger process started with the --server option. See also options -H and -P.
3538

3639
:-x *FILE*, \--command\= *FILE*:
37-
Execute commands from *FILE*
40+
Execute commands from *FILE*.
3841

3942
:\--cd= *DIR*:
40-
Change current directory to *DIR*
43+
Change current directory to *DIR*.
4144

42-
:\-confirm:
43-
Confirm potentially dangerous operations
45+
:\--confirm:
46+
Confirm potentially dangerous operations.
47+
48+
:\--no-confirm:
49+
Do not confirm potentially dangerous operations.
4450

4551
:\--dbg_trepan:
46-
Debug the debugger
52+
Allow debugging the debugger.
4753

4854
:\--different:
49-
Consecutive stops should have different positions
55+
Consecutive debugger stops should have different positions.
56+
57+
:\--edit-mode=EDIT_MODE:
58+
Set debugger-input edit mode, either "emacs" or "vi".
5059

5160
:-e *EXECUTE-CMDS*, \--exec= *EXECUTE-CMDS*:
5261
list of debugger commands to execute. Separate the commands with `;;`
5362

5463
:\--highlight={light|dark|plain}:
55-
Use syntax and terminal highlight output. "plain" is no highlight
64+
Use syntax and terminal highlight output. "plain" is no highlight.
5665

5766
:\--private:
58-
Don't register this as a global debugger
67+
Don't register this as a global debugger.
5968

6069
:\--post-mortem:
61-
Enter debugger on an uncaught (fatal) exception
70+
Enter debugger on an uncaught (fatal) exception.
6271

6372
:-n, \--nx:
64-
Don't execute commands found in any initialization files
73+
Don't execute commands found in any initialization files.
6574

6675
:-o *FILE*, \--output= *FILE*:
67-
Write debugger's output (stdout) to *FILE*
76+
Write debugger's output (stdout) to *FILE*.
6877

6978
:-p *PORT*,\ --port= *PORT*:
7079
Use TCP port number *NUMBER* for out-of-process connections.
7180

7281
:--server:
73-
Out-of-process server connection mode
82+
Out-of-process server connection mode.
7483

7584
:--sigcheck:
76-
Set to watch for signal handler changes
85+
Set to watch for signal handler changes.
7786

7887
:-t *TARGET*, \--target= *TARGET*:
7988
Specify a target to connect to. Arguments should be of form, *protocol*:*address*
@@ -82,7 +91,7 @@ Options
8291
Called from inside ipython
8392

8493
:\--:
85-
Use this to separate debugger options from any options your Python script has
94+
Use this to separate debugger options from any options your Python script has.
8695

8796

8897
See also

docs/options.rst

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
Command-line Options
2+
====================
3+
4+
The abbreviated forms are shown below with ``-`` and long forms are shown
5+
with ``--`` to reflect how they are shown in ``--help``. However, ``trepan3k``,
6+
and ``trepan3kc`` recognizes all of the following conventions for most options:
7+
8+
* ``--`` *option* ``=`` *value*
9+
* ``--`` *option* *value*
10+
* ``-`` *option* ``=`` *value*
11+
* ``-`` *option* *value*
12+
* ``--`` *o* ``=`` *value*
13+
* ``--`` *o* *value*
14+
* ``-`` *o* ``=`` *value*
15+
* ``-`` *o* *value*
16+
17+
``trepan3k``
18+
------------
19+
20+
``trepan3k`` invokes the debugger. Unless options ``--client`` or
21+
``--server`` is used, the debugger runs entirely in the debugged process.
22+
23+
Although you can enter this debugger without a program to be debugged,
24+
if there is a filename argument given, it indicates the program that
25+
will be run under the debugger.
26+
27+
28+
``--version``
29+
Show trepan3k's version number and exit.
30+
31+
``-h``, ``--help``
32+
Show a help message which includes these options and exit.
33+
34+
``-X``, ``--trace``
35+
Show lines before executing them. This option also sets ``--batch``.
36+
37+
``-F``, ``--fntrace``
38+
Show functions before executing them.
39+
40+
``--basename``
41+
In reporting filename, show only the basename. This is useful, for example,
42+
in regression tests
43+
44+
``--client``
45+
Connect to an existing debugger process started with the ``--server`` option. See also options ``H`` and ``P``
46+
47+
``-x`` *debugger-command-path*, ``--command=`` *debugger-command-path*
48+
Execute commands from *debugger-command-path*.
49+
50+
``--cd=`` *directory-path*
51+
Change current directory to *directory-path*.
52+
53+
``--confirm``
54+
Confirm potentially dangerous operations.
55+
56+
``--no-confirm``
57+
Do not confirm potentially dangerous operations.
58+
59+
``--dbg_trepan``
60+
Allow debugging the debugger.
61+
62+
``--different``
63+
Consecutive debugger stops should have different positions.
64+
65+
``--edit-mode=`` { ``emacs`` | ``vi`` }
66+
Set debugger-input edit mode, either "emacs" or "vi", used by GNU readline, lineedit, or toolkit-prompt.
67+
68+
``-e`` *debugger-command-string*, ``--exec=`` *debugger-command-string*
69+
List of debugger commands to execute. Separate the commands with ``;;``
70+
71+
``-H`` *IP-or-hostname*, ``--host=`` *IP-or-hostname*
72+
Connect to *IP* or hostname. Only valid if ``--client`` option is given.
73+
74+
``--highlight=``{``light`` | ``dark``| ``plain``}
75+
Use syntax and terminal highlight output. The value ``plain`` indicates no highlighting
76+
77+
``--private``
78+
Don't register this as a global debugger
79+
80+
``--main``
81+
First stop should be in ``__main__``
82+
83+
``--no-main``
84+
First stop should not be in ``__main__``.
85+
86+
``--post-mortem``
87+
Enter debugger on an uncaught (fatal) exception
88+
89+
``--no-post-mortem``
90+
Don't enter debugger on an uncaught (fatal) exception
91+
92+
93+
``-n``, ``--nx``
94+
Don't execute commands found in any initialization files.
95+
96+
``-o`` *path*, ``--output=`` *path*
97+
Write debugger's output (stdout) to FILE
98+
99+
``-P`` *port-number*, ``--port=`` *port-number*
100+
Use TCP port number *port-number* for out-of-process connections.
101+
102+
``--server``
103+
Out-of-process server connection mode
104+
105+
``--style=`` *pygments-style*
106+
Set output to pygments style; "none" uses 8-color rather than 256-color terminal
107+
108+
``--sigcheck``
109+
Set to watch for signal handler changes
110+
111+
``-t`` *target*, ``--target=`` *target*
112+
Specify a target to connect to. Arguments should be of form, 'protocol address'.
113+
114+
`--from_ipython`` Called from inside ipython
115+
116+
``--annotate=`` *annotate-number*
117+
Use annotations to work inside GNU Emacs.
118+
119+
``--prompt-toolkit``
120+
Try using the Python prompt_toolkit module.
121+
122+
``--no-prompt-toolkit``
123+
Do not use prompt_toolkit
124+
125+
``--``
126+
Use this to separate debugger options from any options your Python script has.
127+
128+
129+
130+
``trepan3kc``
131+
-------------
132+
133+
``trepan3kc`` can be used to connect to an out-of-process or remote process which is in remote-debug TCP/IP mode.
134+
135+
Most of the options below are the same as in the ``trepan3k`` counterpart when the ``--client`` option is given.
136+
137+
138+
``--version``
139+
Show trepan3k's version number and exit.
140+
141+
``-h``, ``--help``
142+
Show a help message which includes these options and exit.
143+
144+
``-H`` *IP-or-hostname*, ``--host=`` *IP-or-hostname*
145+
Connect to *IP* or hostname. Only valid if ``--client`` option is given.
146+
147+
``-P`` *port-number*, ``--port=`` *port-number*
148+
Use TCP port number *port-number* for out-of-process connections.
149+
150+
``--pid=`` *pid*
151+
Use process-id *pid* to get FIFO names for out-of-process connections.

docs/syntax/arange.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
Syntax for Address Ranges
55
=========================
66

7-
Address ranges are used in the `disassemble` command. It is like a
8-
range but we allow addresses. An add
7+
Address ranges are used in the :ref:`disassemble <disassemble>` command. It is like a
8+
range, but we allow addresses.
99

1010
An address range is in one of the following forms:
1111

@@ -16,15 +16,17 @@ An address range is in one of the following forms:
1616
, last # ending line only
1717

1818

19-
A *location* is described elsewhere. *first* and *last* can also be
20-
linespecs but they also may be a number or address (bytecode
21-
offset). And finally *last* can be an (line number) offset.
19+
See :ref:` location <location>` for a full description of a location.
20+
21+
*first* and *last* can also be line specifications (:ref:`linespec
22+
<linespec>`), but they also may be a number or address
23+
(bytecode offset). And finally *last* can be an (line number) offset.
2224

2325
A number is just a decimal number. An offset is a number prefaced with "+" and
2426
indicates the number to increment the line number found in *first*.
2527

26-
Examples
27-
--------
28+
Address-Range Examples
29+
----------------------
2830

2931
::
3032

@@ -35,4 +37,4 @@ Examples
3537

3638
.. seealso::
3739

38-
:ref:`help syntax location <syntax_location>`
40+
:ref:`location <syntax_location>`, :ref:`linespec <linespec>`

docs/syntax/command.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ Debugger Command Syntax
55

66
Command names and arguments are separated with spaces like POSIX shell
77
syntax. Parenthesis around the arguments and commas between them are
8-
not used. If the first non-blank character of a line starts with `#`,
8+
not used. If the first non-blank character of a line starts with ``#``,
99
the command is ignored.
1010

11-
Commands are split at whereever `;;` appears. This process disregards
11+
Commands are split at wherever ``;;`` appears. This process disregards
1212
any quotes or other symbols that have meaning in Python. The strings
1313
after the leading command string are put back on a command queue, and
14-
there should be white space around ';;'.
14+
there should be white space around ``;;``.
1515

1616
Within a single command, tokens are then white-space split. Again,
1717
this process disregards quotes or symbols that have meaning in Python.
@@ -38,7 +38,7 @@ are dispatched to that command.
3838

3939
4. If after all of the above, we still don't find a command, the line
4040
may be evaluated as a Python statement in the current context of the
41-
program at the point it is stoppped. However this is done only if
41+
program at the point it is stopped. However, this is done only if
4242
"auto evaluation" is on. It is on by default.
4343

4444
If :ref:`auto eval <set_autoeval>` is not set on, or if running the

0 commit comments

Comments
 (0)