2

I've got a C++ project in MSVS 2013, which causes problems when debugging: whenever I run a debug session, a message box shows up, saying "No Debug Information -- Debugging information for 'xy.exe' cannot be found or does not match. Cannot find the PDB file. Do you want to continue debugging?" This is a common issue and the question was asked several times, however, none of the answers I found so far apply to my case.

  1. Project Properties -> Configuration Properties -> C/C++ -> Optimization -> Optimization is disabled
  2. Project Properties -> Configuration Properties -> Linker -> Debugging -> Generate Debug Info is turned on
  3. Path and filename are correct; Project Properties -> Configuration Properties -> Linker -> Debugging -> Generate Program Database File is "$(OutDir)$(TargetName).pdb" (Output File is "$(OutDir)$(TargetName)$(TargetExt)", so there's no misconfiguration here either)
  4. I tried deleting the file manually, restarting Visual Studio, cleaning and rebuilding. From the file timestamp I see it is indeed the PDB file just created, and both exe and pdb are built to the very same folder and are named correctly.
  5. Someone suggested doublechecking the task manager and see if devenv.exe is still running in the background -- indeed, it was. I killed it, deleted PDB files, restarted, cleaned, rebuilt, no luck.
  6. I switched the startup project to a different one and back, as a poster suggested [1]. No luck.
  7. Somebody reported having this issue when the local PDB file of the main project has the same name as the final PDB file for the entire executable [2]. This is not the case here.
  8. When I open the Modules Window [3], I see that for my exe, in the "Symbol Status" column, it says "Cannot find or open the PDB" file. When I try to right click -> Load Symbols, I see they are right there (e.g. xy.pdb for xy.exe). When I select them, a message box says "A maching symbol file was not found in this folder."

Interestingly, none of the projects in this solution work. Other projects, however, work withouth any problems. I tried to compare each and every setting in the project properties with the ones that work, but I cannot find any differences.

Any more ideas?

[1] https://stackoverflow.com/a/15378106/4508058

[2] https://stackoverflow.com/a/21640745/4508058

[3] https://stackoverflow.com/a/540599/4508058

Community
  • 1
  • 1
iko79
  • 1,127
  • 10
  • 23
  • When you start your application in the debugger (just ignore that you don't have debug info for the moment), what messages show up in your `Output Window`? One of those lines should say something like "Loading whatever.exe" with the status of whether debugging information can be found. Note the full path of what is being loaded and ensure it is the right executable that is running. – PaulMcKenzie Jul 21 '15 at 16:02
  • Does your executable elevate or run as a different user? It sounds like the debugger/executable *really can't open* the pdb file, which sounds like a file/directory permission issue to me. – Mark B Jul 21 '15 at 16:04
  • @PaulMcKenzie: Thanks. It writes "Cannot find or open the PDB file." The binary path is correct. – iko79 Jul 22 '15 at 11:57
  • @MarkB: Thanks, didn't think of that. However, it runs with the same user as devenv.exe does, which is my admin user. File permissions of the PDB file are okay. – iko79 Jul 22 '15 at 12:04
  • Note: Sometimes, when I try to build a debug binary, I get this, maybe that's a hint to what's wrong? Error 24 error LNK1209: program database 'D:\work\-coding-\Projects\vrtheater\LoadingApp\bin\LoadingAppD.pdb' differs from previous link; relink or rebuild D:\work\-coding-\Projects\vrtheater\LoadingApp\prj\LINK LoadingApp – iko79 Jul 22 '15 at 12:05

2 Answers2

1

Okay, a hint to future readers: now it is finally working. I noticed that the project shared it's intermediate directory with another project. However, just changing this, cleaning, rebuilding, even deleting the intermediate directory manually didn't help. But after some builds it finally worked, so it might have had something to do with it (?). So I don't have an absolute solution to the problem, but maybe it helps.

I sometimes still get the Linker error I mentioned in my comment above, though (LNK1209: program database 'D:\work-coding-\Projects\vrtheater\LoadingApp\bin\LoadingAppD.pdb') so there still might be something wrong...

iko79
  • 1,127
  • 10
  • 23
0

The c++ compile also needs generate debug info /Zi. If that is also set, use windbg with !sym noisy to see where it is trying to load symbols.

mksteve
  • 12,614
  • 3
  • 28
  • 50
  • thanks, didn't know WinDgb. Symbol search path is correct. Output is: *** ERROR: Symbol file could not be found. Defaulted to export symbols for ntdll.dll - – iko79 Jul 22 '15 at 11:55