File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ The debugger's prompt is ``(Pdb)``, which is the indicator that you are in debug
80
80
You can also invoke :mod: `pdb ` from the command line to debug other scripts. For
81
81
example::
82
82
83
- python -m pdb [-c command] (-m module | pyfile) [args ...]
83
+ python -m pdb [-c command] (-m module | -p pid | pyfile) [args ...]
84
84
85
85
When invoked as a module, pdb will automatically enter post-mortem debugging if
86
86
the program being debugged exits abnormally. After post-mortem debugging (or
@@ -104,6 +104,24 @@ useful than quitting the debugger upon program's exit.
104
104
.. versionchanged :: 3.7
105
105
Added the ``-m `` option.
106
106
107
+ .. option :: -p , --pid <pid >
108
+
109
+ Attach to the process with the specified PID.
110
+
111
+ .. versionadded :: 3.14
112
+
113
+
114
+ To attach to a running Python process for remote debugging, use the ``-p `` or
115
+ ``--pid `` option with the target process's PID::
116
+
117
+ python -m pdb -p 1234
118
+
119
+ .. note ::
120
+
121
+ Attaching to a process that is blocked in a system call or waiting for I/O
122
+ will only work once the next bytecode instruction is executed or when the
123
+ process receives a signal.
124
+
107
125
Typical usage to execute a statement under control of the debugger is::
108
126
109
127
>>> import pdb
You can’t perform that action at this time.
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant
0 commit comments