Reputation: 3728
However, if I rename myProgram.exe and myProgram.pdb to SomethingElse.exe and SomethingElse.pdb and repeat these steps, results are mixed from Step 4 onwards. As far as I can tell, on my build machine, VS will always load symbols successfully from the renamed PDB file. However, on my remote target machine, VS will never load symbols - it always tells me that the PDB file does not match the executable. Why not? Is there an obscure rule I am breaking? I am running Visual Studio 2005 everywhere in case that matters.
Upvotes: 4
Views: 3610
Reputation: 2959
Visual Studio 2013 Update 5 creates broken[1] PDBs for me if my intermediate directory is a subdirectory of the output directory. My diff to fix the issue
- <IntDir>$(OutDir)/$(TargetName)/</IntDir>
+ <IntDir>$(OutDir)</IntDir>
[1] Verified mismatched with windbg's !itoldyouso
Upvotes: 0
Reputation: 3728
The simple subtle rule being broken here is that the PDB file name appears to be encoded into the EXE file, not derived from the EXE file name. So, for example, if you create "Copy of myProgram.exe" and "Copy of myProgram.pdb" by a simple copy-and-paste in Windows Explorer, it can appear that symbols are being loaded despite the name change. But this will only work so long as the original "myProgram.pdb" file is also present - if you remove "myProgram.pdb" and only have "Copy of myProgram.pdb", the symbols may be compatible, but Visual Studio will not even try to load them.
In a quick-and-dirty test on a remote machine in my office, all that changed was the file name, not the file version, whereas on the actual remote machine, both name and file version were different, so it was never possible for things to appear to work.
Upvotes: 3