Search code examples
visual-studio-2010debug-symbolsminidump

Loading dump file; VS doesn't find my source code


I'm developing a .NET 4.0 app in VS 2010.

I'm trying to use dump files for the first time, but when loading the minidump into VS, I can't debug it, since VS doesn't find the source files.

Here's what I did:

  • In Options -> Debugging -> Symbols I added my app's build dir, which contains the pdbs.
  • Ran the app in the VS debugger. Selected Debug -> Break All.
  • Selected Debug -> Save dump as
  • Went to the dump file in windows explorer and opened it. This opened a new instance of VS.
  • I clicked "Debug with mixed". This opened a new tab that said "There is no source code available for the current location.

I tried to figure out why VS wasn't loading my pdbs:

  • Opened Debug -> Windows -> Modules
  • The Symbol Status column for MyApp.exe said "Symbols loaded".
  • For MyApp.vshost.exe it said "Cannot find or locate the PDB file".
  • Rightclicked on MyApp.exe, selected "Symbol load info". It said "MyApp.pdb: Symbols loaded."
  • Did the same for MyApp.vshost.exe. It said vshost32.pdb: Cannot find or open the PDB file.. (note how it's looking for a file named vshost32.pdb rather than MyApp.vshost.pdb, for some reason)

So, any ideas?


Solution

  • Solved the problem. VS was looking at the bottom-most method in the call-stack, which was a system method somewhere in ntdll.dll. So naturally there was no source for it. I had to click on my own method in the Call Stack window to navigate to my own code, for which source was available.