-
-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: How can I run a script with pydevd in --server mode #161
Comments
closing for now as it seems running the app via |
Hi @etanshaul, sorry about the delay in getting back to you... as you probably seen, it does create a server socket and waits for the connection. What's not currently implemented is a way to start in server mode but start running before the connection is done to the server. This should not be difficult to do (all the machinery is there, it's just not handled in the arguments) -- you can take a look at |
Thanks for the follow up @fabioz .
This is great to know. Are there any plans / ambitions to add support for this as part of the pydevd server initialization (via a flag; e.g. |
I don't really have any plans to add that, but I do accept contributions regarding adding that support (just note that it should be accompanied by a test case so that it doesn't break in the future). |
Goal:
Similar to ptvsd's (debugging a script file), I want to launch my script with the pydevd debugger waiting in
--server
mode ready to accept connections from a client.Why:
We are working on implementing remote container debugging for JetBrains IDEs (via a 3rd party plugin). The normal connection mode for pydevd is to run the debug server in the client and make a connection back from the application (in the remote env) to the IDE. I need to reverse this model: run the application and debug server in the remote container, and then connect to it from the IDE.
What I've tried:
Running the pydevd script with
--server
, e.g.:pydevd --server --port [debug_port] --file myscript.py
This appears to only run the debugger, but not the script. I can elicit a response from the debug server by setting breakpoints on the client; however, this appears to be detached from the running app (which I'm currently running separately) so I cannot hit any breakpoints. I've dug up the
pydevd_attach_to_process
script where I think I can run the script and then attach the debugger to it but ideally I'd be able to start the script immediately with the debugger. Hopefully this makes some sense. Happy to provide more details.The text was updated successfully, but these errors were encountered: