I am trying to get my application to use VS Code as an external text editor and debugger. The application runs an embedded python thread and launches an instance of VS Code. When trying to attach the VS Code python debugger, it does not work if the embedded python thread is not running python code.
launch.json
{
"version": "0.2.0",
"configurations": [{
"name": "Python: Attach using Process Id",
"type": "python",
"request": "attach",
"processId": 9164
}]
}
I added a python sleep loop for the embedded python thread to run while VS Code attaches to the application. When this occurs, the VS Code debugger successfully attaches but has varying behavior in terms of breakpoints. If there are processes slowing down the processor, the breakpoints will be hit, but if there are no processes, then the breakpoints are passed through as if they do not exist. How can I get the VS Code debugger to consistently hit breakpoints after attaching to the application?
CodePudding user response:
The VS Code Python Debugger was looking for the python threading module. The debugger worked as expected after importing the python threading module with the embedded python.