3

I am trying to debug a Visual C++ project. I run the program in debug mode, and the debugger shows me a message saying that the breakpoint will not be hit because symbols are not loaded. However, when I go to the Debug->Windows->Modules window, I see that the symbols for the executable file have been loaded. The window shows that the loaded .pdb file is the .pdb file generated by the compiler, which is up-to-date.

I have cleaned and rebuilt the project, exited MSVS and relentered the project. No joy.

I have looked at the possibilities in this article, which offers many possible solutions, but did not find a reference to a similar situation. What is the problem here?

Community
  • 1
  • 1
Aharon Manne
  • 712
  • 3
  • 11
  • 34
  • 2
    Common problems are: The sources does not match the executable (re-compile needed), or you are attaching to a process with wrong debugging mode (.net debugger to Native code, or vice-versa). – Algirdas Preidžius Feb 07 '16 at 13:28

1 Answers1

1

Had a similar issue. After downloading and running PdbInspector from the 'Code Project', I have 'inspected' the pdb file in question and found that it was indeed missing the source file paths that should be associated with each module. This was a clear indication that my pdb file wasn't being created correctly. A closer examination of the project properties led me to the 'debug information format' field under 'C\C++ -> General' which I have set to 'Program Database'. Building the project yielded a much bigger pdb file with all the necessary symbols.

shem
  • 11
  • 1