Replies: 2 comments 2 replies
-
Transferred to discussions as not really an issue. |
Beta Was this translation helpful? Give feedback.
0 replies
-
My first instinct here is can you just 'attach' to the process? That's essentially what you're asking for, you just want it to attach at the right spot. You stick a breakpoint in the code using the IDE ahead of time and after the attach it should stop on that breakpoint. If you wanted to do this in code however, you'd put this code somewhere that you wanted it to 'wait' for the debugger: import debugpy
debugpy.listen(("localhost", 5691)) # listen for incoming DAP client connections
debugpy.wait_for_client() # wait for a client to connect And then in a launch.json you'd have: {
"name": "Python Debugger: Attach to listening debugpy",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "localhost",
"port": 5691
},
}, |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Often it can be pretty hard / tedious to replicate all the settings and env state when trying to debug through the integrated vscode config system. I have found it very convenient to just swap in the right
breakpoint()
on the line I want to debug.Is it possible to have some equivalent that essentially is
debugpy.breakpoint_and_attach()
that encapsulates the full flow and can be used to drop into the debugger when hit? I tried to jerry-rig things up and didnt have much success, maybe this is already possible??I use the integrated terminal
Beta Was this translation helpful? Give feedback.
All reactions