1
votes

I got a minidump from a server on which my native c++ app was running. I also have the exe and pdb files. I am able to open the minidump using Visual Studio 2005 Pro and it correctly loads the symbols from the pdb file.

I run the debugger (F5) and it shows me that it crashed. When I click on the stack trace to see where, it tells me that it can't find the source code "There is no source code available for the current location.".

How do I tell Visual Studio where the source code is?

My exe is an optimized release build that I build with a pdb file.

1
If the crash occurs in a dll that doesn't have a pbd, you won't be able to debug it. The debugger will only show you the calls for which you have the symbols. - VoidStar
Yes, I have the symbols and I have all the pdb files I need. I'm just trying to see the source code (which I also have). - curlingdude
There is a good chance that your app crashes in a Windows DLL... - Mihai Todor
It did crash in a Windows DLL. That's fine. I just want to see the code for methods up the stack trace that are in my code. - curlingdude
Then double-click a location in the stack trace that is your code. - Hans Passant

1 Answers

2
votes

From this MSDN page:

In the Solution Property Pages, you can change the directories where the debugger looks for sources files and tell the debugger to ignore selected source files. See Debug Source Files, Common Properties, Solution Property Pages Dialog Box.

Make sure you supply VS with the sources that correspond to the binaries and PDB files.

Normally, VS should ask you where the sources are when first double-clicking a stack frame. I ran into a problem where VS would pop up the There is no source code available for the current location. dialog when clicking on some stack frames only, but display the source for others. This turned out to be because the /Zi flag was not set for some projects, causing the link back to the source files to be missing. This flag can be set in Project Propery Pages > C/C++ > General > Debug Information Format.