Thursday 27 October 2022

No symbols loaded for c++ in mixed debugging (from Python)

I have a large project where the major part computation heavy stuff is written in c++ and the "glue code" and the start script is written in Python. The code has been compiled with the VS 2017 compiler (V141) and Python 3.7.0-32bit for a few years now and I want to upgrade to V143 and Python 3.10-64, I can build and run the code with the new environment. I get some small errors when I run the test suite (probably due to the change from 32bit to 64bit.

The issue occurs when I try to debug the C++ code in Visual Studio 2022. I can debug the Python code without any errors but when I want to debug the code I can't get any symbols from the c++ to load.

I've tried to follow this guide: https://learn.microsoft.com/en-us/visualstudio/python/debugging-mixed-mode-c-cpp-python-in-visual-studio?view=vs-2022 (But I fail to enable both Native and Python in step 2 of Enable mixed-mode debugging in a Python project. When I select Python in Select Code type I get this error: "Python debugging is not compatible with Native. Would you like to uncheck Native?"

Similar I don't find the option Python/Native debugging in step 2 of "Enable mixed-mode debugging in a C/C++ project" and I've installed Python native development tools using the VS installer etc.)

I've built the code with debug info etc. and enabeled Native debugging in the Python project in VS 2022 and when I run the code with debugging the break points in the c++ doesn't get hit. (the pdb, pyd, lib and exp files should have the extension project_name.cp310-win_amd64.pdb for python 3.10-64 right?)

I can also see that it doesn't load the Symbols for my 4 c++ projects (Screenshot of the loaded modules after pausing the debugging while running the code): Print screen when paused debugging with python 3.10-64

Compared to the list of modules when I run the project with Python 3.7.0:

Print screen when paused debugging with python 3.7.0-32

I've tried to run the project in vscode but I can't get it to load the debugging there either. Any suggestion how to get the symbols loaded?



from No symbols loaded for c++ in mixed debugging (from Python)

No comments:

Post a Comment