Run a python program (path/to/script.py) (set program in the launch configuration)
Run a python module (python -m <module>) (set module in the launch configuration)
Attach to a python program waiting for a connection
The python program must call import pydevd;pydevd.settrace(host="", port=port, protocol="dap")
An attach launch configuration with an attach mode must be run
Start a server which waits for incoming connections
An attach launch configuration with a server mode must be run
The python program must call import pydevd;pydevd.settrace(host="127.0.0.1", port=port, protocol="dap")
Why use this debugger?
pydevd is one of the fastest debuggers available, and while it was integrations through other extensions/IDEs (such as debugpy and even PyCharm,
this extension is done by its author and is kept up-to date with the latest changes).
In Python 3.12 uses new APIs for very low overhead debugging.
In other Python versions it can also leverage the python frame eval for fast debugging (although it falls back to tracing once a breakpoint is hit).
Supports many features such as:
Line breakpoints
Expression
Hit Count
Log message
Exception breakpoints
Step in
Step into target
Jump to line (Set next line execution)
Step over
Step Return
Change variable
Debug Console evaluation
View variables
Customize variables
Auto attach to subprocesses
Start attach in server mode
Attach to waiting program
Launch in run or debug mode
How to use this debugger
After installing, create a run configuration that has the "type": "pydevd" with a "request": "attach" or "request": "launch" and launch it.
If you have PyDev for VSCode installed, it'll be the engine used to do launches for test cases (and any other python-related launch).
Notes
Currently launches will use python.pydev.pythonExecutable as the python executable (contributed by the PyDev for VSCode extension)
unless a pythonExecutable is given in the launch configuration.
The "request": "test-template" is actually only used in PyDev for VSCode when doing a test-case launch (if customization
for the test launch is required).
The "request": "run-file-template" is actually only used in PyDev for VSCode for customizing the launch done from the related custom command to
run the current file (may also be used from other places such as code lenses).