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).
Fixed issue due to the following breakage: Python 3.13: dis.findlinestarts may now return line with None.
0.0.5:
Uses pydevd 3.2.2
Support for Python 3.13 (using sys.monitoring for faster debugging as Python 3.12).
pip-installs pydevd from pypi to take advantage of pre-compiled binaries without having to compile locally yourself!
python.pydev.debugger.pydevdCacheDirectory may be used to customize the directory where it should be installed (if not specified it'll be installed inside the extension's directory).
python.pydev.debugger.pydevdPipInstall may be used to customize whether it should actually be pip-installed or if it the version bundled with the extension should be used (which may not have accelerators).
python.pydev.debugger.pydevdPyFile may be used to customize the path to the pydevd.py debugger file (may be used to force using a specific installation of the debugger).
It can also be overridden in a specific launch configuration by setting the pydevdPyDebuggerFile setting in the launch configuration.
0.0.4:
Fixed issue with variable replacing when no editor is active.
When console is not set to a valid value, it'll fallback to integratedTerminal.
Set neverOpen for internal console when launching with console set to integratedTerminal.
Launch templates now have integratedTerminal as the default console.
0.0.3: Properly verifies whether program and cwd are strings and gives a better error message and bundles pydevd 3.1.0.
0.0.2: Properly validating program or module in launch config, completions working in debug console.
0.0.1: Initial integration supporting launch and attach modes (most features should be working already).