Search code examples
c++cvisual-studiodebuggingdebug-symbols

Unable to debug through a second binary being called from first binary in Visual Studio solution


I have a solution where I have added two C/C++ projects. The First C++ project calls the second C project's binary to use some of its functionality. While I am trying to debug the first binary, I expect the debug control to switch to the second binary where I have placed relevant breakpoints when the second binary is invoked using the system function. But for the code in the second binary, I am getting the error "the breakpoint will not currently be hit no symbols have been loaded" while putting the breakpoint.

The debug switch to the second binary was working previously but has stopped. I have already tried several options suggested to clean and rebuild the solution, checking whether the second binary appears in Debug->Windows->Modules/Process and enable/disable e.g Tools->Debugging->Enable Just My Code etc but failing to get it to work.


Solution

  • I found an extension: Microsoft Child Process Debugging Power Tool 2022

    And enable child process debugging in Debug->other debug targets: enter image description here

    Then open the file of child process and add a breakpoint in the running solution. It is able to debug console and MFC. No need to attach to process.