etodd
etodd

Reputation: 533

Source information missing from the debug information for this module - PDB successfully loaded

Visual Studio loads the correct PDB file, but can't find source information for anything in the solution.

Things I've tried:

Is there some setting that generates a PDB without source information? Or could it be baking bad paths into the PDB? I tried grepping through the PDB and although it appears to have all the symbols, I couldn't find any source file paths.

More info: this is a 64-bit C++ project. Everything is statically linked including the runtime.

Upvotes: 22

Views: 31309

Answers (3)

Laurie Stearn
Laurie Stearn

Reputation: 999

More of a specific case answer, with the /ZI option set: The variable in question here was a HGDIOBJ variable created as a return from SelectObject. Its Type in the Watch window was void *. The action was to "Break When Value Changes", and after continuation the VS windowed code graphic bounced back to the beginning of the main WndPRoc with:

When 0xbd1676ecb8 (Original Expression: hMyObj) changes (8 bytes) in process 'MyProg.exe'

after which the "Source Not Available" dialog was shown.

So, what to do? If there were issues with the VS2019 installation on this machine, they applied only to this particular variable type, thus the decision was consequently not to use "Break When Value Changes" for that type.

Upvotes: 0

Leslie
Leslie

Reputation: 532

At the bottom bar of visual studio, click Application Output and resolve the error from the exception which was produced.

Upvotes: -6

etodd
etodd

Reputation: 533

The project was missing the /Zi parameter. Apparently this still causes the compiler to generate a PDB file that can be successfully loaded, it just doesn't have any useful symbols in it. No idea why.

Upvotes: 18

Related Questions