1

I have just started experimenting with the Microsoft tools to set up a symbol and source server. I have successfully indexed my source files using p4index, updated the .pdb files and updated the symbol server. I have set visual studio to use the my symbol server.

All works fine: when I step debug through my exe as a standalone exe the pdb's are loaded and the correct version of the source code is exported from perforce to temp location and displayed within visual studio.

Whats the problem then? If I try to debug on the machine on which I built my exe then visual studio finds the source code locally. The trouble is that this is a modified file and not the correct version of the source corresponding to when exe was built. VStudio even knows this and pops up a requester saying "the source file is different from when the module was built. Would you like the debugger to use it anyway?"

If I click no then I just get a file dialog to manually locate the source.

Is there a way to get vstudio to fall back to using source server or preferably to use the source server first before looking looking locally?

I'm using visual studio 2012 and perforce

David Woo
  • 749
  • 4
  • 13

2 Answers2

1

After having encountered the same issue, I finally narrowed it down to the fact that Visual Studio won't run the P4 PRINT command if there is already a file at the place where the pdb/debugger expects to find it.

For example, if the indexed source file was in C:\Toto\Source.cpp, the sole presence of this file when Visual is looking for it will prevent the P4 PRINT.

If i rename it, Visual is correctly printing the file in another unrelated folder (the symbol cache pass).

It's not a fix, it's only a reason, but I'm still investigating. This behavior is not present in windbg.

Jibai
  • 21
  • 4
1

In case anyone else finds this thread and has the same problem, the solution in my case was to Enable "Require source files to exactly match the original version" in Options -> Debugging -> General.

It will still prefer the local copies, but only if they are identical, in which case it is the same version it would otherwise grab from the source control server. And if it isn't the right one, it will now display the proper one from the source control server.