Search code examples
c++visual-studiodebuggingvisual-c++msvcrt

No source for msvcr100d.dll!__CrtDumpMemoryLeaks()


When debugging a C++ Project using Visual Studio 2010, it cannot find the source for crt. When I am trying to go inside one such module, it displays "No Source Available". It also does not provide an option to Browse so that I can help it locate the source location.

Under the Option Solution->Common Properties->Debug Source Files, the proper location to the crt source is updated.

In lack of source level debugging of crt I have to read through the disassemble which is getting difficult.

Can anyone help me figure out what might be going wrong?

Please Note ** I am using an external build system via Visual Studio to build my C++ Project.

With the guidance of Hans here how I narrowed down to the problem.

While the breakpoint was still active, I listed all the Symbol Load information. I realized that msvcr100d.i386.pdb did not match the dll. It actually went all the way down to fetch from the microsoft public symbol store which off course had the symbols stripped off. So that was the root cause of my problem.

And here is a similar problem in social.msdn


Solution

  • You can see the cause of the problem by using Debug + Windows + Modules while you have a break active. Right-click msvcr100d.dll and select "Symbol Load Information" to get info about the .pdb that the debugger uses.

    For some reason the Microsoft Symbol Server supplies one that has the source info stripped. It is probably intentional, something to do with service and security patches of the DLL getting out of sync with the source code in vc/crt/scr. You can get a real answer instead of a guess by posting to connect.microsoft.com

    A workaround of sorts is to compile your code with /MTd instead of /MDd, if that's possible at all. Project + Properties, C/C++, Code Generation, Runtime Library setting. The debugger will then use the .pdb file in vc/lib. Do keep your eyes on the ball, debug your code instead of the CRT's.