@@ -75,25 +75,34 @@ The debugger's prompt is ``(Pdb)``, which is the indicator that you are in debug
75
75
arguments of the ``p `` command.
76
76
77
77
78
+ .. program :: pdb
79
+
78
80
You can also invoke :mod: `pdb ` from the command line to debug other scripts. For
79
81
example::
80
82
81
- python -m pdb myscript.py
83
+ python -m pdb [-c command] (-m module | pyfile) [args ...]
82
84
83
85
When invoked as a module, pdb will automatically enter post-mortem debugging if
84
86
the program being debugged exits abnormally. After post-mortem debugging (or
85
87
after normal exit of the program), pdb will restart the program. Automatic
86
88
restarting preserves pdb's state (such as breakpoints) and in most cases is more
87
89
useful than quitting the debugger upon program's exit.
88
90
89
- .. versionchanged :: 3.2
90
- Added the ``-c `` option to execute commands as if given
91
- in a :file: `.pdbrc ` file; see :ref: `debugger-commands `.
91
+ .. option :: -c , --command <command >
92
92
93
- .. versionchanged :: 3.7
94
- Added the ``-m `` option to execute modules similar to the way
95
- ``python -m `` does. As with a script, the debugger will pause execution just
96
- before the first line of the module.
93
+ To execute commands as if given in a :file: `.pdbrc ` file; see
94
+ :ref: `debugger-commands `.
95
+
96
+ .. versionchanged :: 3.2
97
+ Added the ``-c `` option.
98
+
99
+ .. option :: -m <module >
100
+
101
+ To execute modules similar to the way ``python -m `` does. As with a script,
102
+ the debugger will pause execution just before the first line of the module.
103
+
104
+ .. versionchanged :: 3.7
105
+ Added the ``-m `` option.
97
106
98
107
Typical usage to execute a statement under control of the debugger is::
99
108
0 commit comments