Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

msvc "the breakpoint will not currently be hit"

MSVS 2013: I've got the VC project and C++ code of a static library I want to step into from within my exe project which is found in the same solution. However, the debugger keeps telling me it wouldn't hit the break points, since it wouldn't be able to load according debugging symbols for the static library ("The breakpoint will not currently be hit. No symbols have been loaded for this document"). Other static libs in the same solution work. I just recently added the new one since I wanted to step into some of it's code to see what's going wrong. I added a build dependency from exe to lib project, no idea if this has any effect, but I thought it couldn't hurt. I also tried cleaning and rebuilding. What might be a hint and what I don't get: why does VS try to load debug symbols in the first place when it's got the source code?

Funny thing is, I've got a different solution, also using the very same static lib project, there it works, so the issue seems not to be a messed up setting in the lib project. I compared all linker and compiler settings of both exe projects and cannot find any suspicious differences.

Any ideas what the issue would be are highly appreciated.

like image 826
iko79 Avatar asked Dec 14 '15 13:12

iko79


1 Answers

There are several possible reasons for this:

  1. The function you set your breakpoint has been inlined (check your link-time optimisation flags /LTCG and disable any)
  2. You built your library without debugging information (check the /DEBUG flag)
  3. When attaching the debugger Visual Studio didn't find the .pdb file containing the debug information (this produces a warning in the output window)
  4. The above compiler and linker options don't match up (you should see warnings in that case)

Try the following: use the default Debug build for both the static library and the executable project you're running. Reference the library project in your executable project and DONT explicitly add the library to Linker->Input->Additional Dependencies.

like image 127
BeyelerStudios Avatar answered Oct 12 '22 17:10

BeyelerStudios