1

使用 Visual Studio 2010 调试 C++ 项目时,找不到 crt 的源代码。当我试图进入一个这样的模块时,它显示“没有可用的源”。它也没有提供一个选项,Browse以便我可以帮助它找到源位置。

在 Option Solution->Common Properties->Debug Source Files 下,更新 crt 源的正确位置。

由于缺乏 crt 的源代码级调试,我必须通读越来越困难的反汇编。

谁能帮我弄清楚可能出了什么问题?

请注意 ** 我通过 Visual Studio 使用外部构建系统来构建我的 C++ 项目。

在汉斯的指导下,我如何缩小问题范围。

当断点仍处于活动状态时,我列出了所有符号加载信息。我意识到msvcr100d.i386.pdb与dll不匹配。它实际上一直从微软公共符号存储中获取,其中当然已经剥离了符号。所以这就是我的问题的根本原因。

这是social.msdn中的类似问题

4

2 回答 2

1

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.

于 2012-04-04T12:07:57.347 回答
0

您可以在安装文件夹的子文件夹 VC\CRT\SRC 中找到 CRT 的源代码。

如果它们不存在,您在安装 VS2010 时是否安装了它们?(不确定你是否真的可以选择这个)。

于 2012-04-04T09:18:18.113 回答