benibenj / vscode-pythonCpp

A Visual Studio Code Debug Extension for debugging mixed Python and C++ code. The extension starts a Python debug session and attaches the C++ debugger to it. This extension is useful for debugging Python programs that call functions from shared libraries (.so/.dll).
Other
47 stars 7 forks source link

[Bug] The debugging is getting stuck especially when attempting to attach to an existing process #22

Open realaslam786 opened 9 months ago

realaslam786 commented 9 months ago

The extension is originally intended to work in the launch mode only. However, by using the custom configuration (Python C++ Debugger Custom: GDB) and modifying the Python config's (type = 'python') request to attach, it becomes possible to attach to an existing process. Python C++ extension is initially stopping the Python extension and waiting for the C++ debugger to get attached before restarting (continuing) the Python debugger. The issue is that Python debugger is not continuing even after the corresponding message to continue has been sent.

The same issue, with the Python debugger getting stuck, is also sometimes coming up using the regular launch mode, especially on Windows.

realaslam786 commented 9 months ago

I played around with the code and removing the limitation of waiting for the C++ debugger (stopping/continuing the Python debugger) actually works around this issue.