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

3

22

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

Things I've tried:

  • Clean, reboot, regenerate project (CMake), rebuild
  • Check the Modules window to ensure the PDB is loaded (it is)
  • Mess with "Debug Source Files" setting under solution properties
  • Check the PDB file with symchk (it says the PDB matches the EXE, and that it has full symbol information, i.e. it's not stripped)
  • Download system lib symbols from Microsoft because why not

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.

Markson answered 27/9, 2016 at 15:8 Comment(7)
The debugger will ask you for the source file location if it can't find it by itself. Knee jerk is to click Cancel, it won't ask again. Right-click the Solution in the Solution Explorer window > Properties > Debug Source Files. Empty the "Do not look" box, add the path in the list above it.Topic
@HansPassant That's the weird part, I never get that option to manually locate the source file. Here: i.imgur.com/jgOL8wE.pngMarkson
Adding source folders to the "Debug Source Files" property appears to have no effect.Markson
@etodd, can you get the source file in local machine? Maybe it really has no the source file for the reference or others: msdn.microsoft.com/en-us/library/3sehk0fb.aspx, please uncheck "Require source files to exactly match the original version" option under Tool -> Options -> Debugging -> General. Debug it again.Reviel
@JackZhai yeah, tried that checkbox too. No effect. All the source files are in the solution on the local machine. There's one library for which I have neither the source code nor PDBs, but that never caused problems before.Markson
@etodd, Can you enable the Exception settings which can throw the Exception messages during debugging? I met the same warning like "source not available" which was related to the CLR Exception or others, so you can enable the Exception settings, and check that whether you could get more information.Reviel
@JackZhai yes, I tried disabling and enabling it to no avail. I can replicate the problem on multiple machines. The issue appears to be with a specific project file, which I've uploaded here: github.com/etodd/VSDebugProblemMarkson
M
18

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.

Markson answered 29/9, 2016 at 17:55 Comment(0)
D
0

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.

Deuterium answered 6/12, 2020 at 6:18 Comment(0)
V
-6

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

Vondavonni answered 31/5, 2018 at 12:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.