Closed oldljh closed 1 year ago
It does, however it has 2 shortcomings vs using debugpy
:
I'm curious though, what is your use case? i.e.: is there a particular reason for wanting to use PyDev.Debugger instead of debugpy (the engine on both is the pydev debugger, the only difference is that debugpy does massage the API a bit so that it's easier to use the DAP directly).
Regarding starting pydevd in dap mode, I need to take a look and add some documentation on how to do that (it'd be definitely be possible, but I need to add better docs for doing that).
Actually I just want to know how to use pydev.Debugger in order to develop a special purpose ide based on it. You said it's a DAP debugger backend, I started thinking debugpy was the frontend but it wasn't. Does github have an open source frontend program that uses pydev.Debugger as a backend? Although vscode is open source, it is too complicated to understand how frontend uses DAP to interact with pydev.Debugger.
In this case my suggestion would be to take a look into the debugger integration tests. It does all the scaffolding and acts as a pseudo-client for testing -- see: https://github.com/fabioz/PyDev.Debugger/blob/main/tests_python/test_debugger_json.py.
The debugger actually has more than one message format it supports (I still recommend using the DAP approach though as DAP messages are better documented at https://microsoft.github.io/debug-adapter-protocol/specification).
The command line would end up being something as
python -u /path/to/pydevd.py --client 127.0.0.1 --port 55987 --debug-mode debugpy-dap --json-dap-http --file file_to_launch.py
Note that you need to open the --port
before and the debugger will connect to that port.
It'll differ a bit from the default protocol because:
p.s.: In this case you can actually automatically attach to new sub processes (it'll just try to create a new session that'll attach to the port specified initially).
thank you very much!
I'm closing this as I think there's nothing really actionable to do, but fell free to ask more questions...
Does pydev.debugger support debugpy DAP client? When run python pydev_run_in_console.py --help, it need client port parameter. But debugpy does not have corresponding parameter.