0

I'm trying to create a C++ Python extension using pybind11 and CMake, and would like to take advantage of visual studio's mixed mode debugging (see) for developing the extension.

I tried following the MSDN guide, and was able to create an extension and debug it using visual studio solution configurations. However, trying to recreate the project with CMake and debug it, breakpoints inside the C++ code are not triggered. I tried recreating the project twice:

  1. a full CMake project (i.e. first create a folder with a CMake file then open it in VS).

  2. a Python solution with a CMake subproject (adding the build folder to python search paths to access the extension).

In both methods C++ breakpoints are not triggered. Is there any way to make this work? Something I'm missing? I know there is a VSCode plugin which enables something similar. I'm currently using it, however I'd like to know if it is possible in Visual Studio proper.

Versions:

  1. Visual Studio 2022
  2. CMake 3.18
  3. Python 3.8 (with debug symbols installed), however this is not the Python distributed with Visual Studio
osbt1
  • 1
  • looks like this feature was queued long time ago. Did you find a workaround or solution? https://developercommunity.visualstudio.com/t/enable-mixed-mode-debugging-in-cmakeopenfolder-pro/351740 – Nir Jan 31 '23 at 16:24
  • Not in Visual Studio. I ended up using VSCode with this extension: https://marketplace.visualstudio.com/items?itemName=benjamin-simmonds.pythoncpp-debug – osbt1 Feb 02 '23 at 07:57

0 Answers0