Visual Studio调试器-源搜索目录 [英] Visual Studio debugger - source search directory
问题描述
我有一个故障转储(小型转储,mdmp格式),用于在另一台计算机上编译的可执行文件(本机x86代码)。我有与崩溃转储相对应的pdb + exe,它们位于崩溃转储旁边,调试器可以正确识别它们。 pdb在我的计算机上不可用的路径上引用源(例如 E:\Project
)。当我第一次打开故障转储时,调试器要求我提供源位置。我将其指向计算机上的 E:\B\Project
,但是,一旦出现源窗口,我就意识到我的选择是错误的(源是用于其他产品的)科)。我想将调试器指向正确的位置 E:\D\Project
,但是调试器不再问我。没有为崩溃崩溃创建的解决方案,项目或选择文件。我已经搜索了注册表,但是在任何地方都找不到 E:\B\Project
。
I have a crash dump (minidump, mdmp format) for an executable (native x86 code) compiled on a different computer. I have the pdb + exe corresponding to the crash dump, they are located next to the crashdump, and debugger recognizes them correctly. The pdb references sources on a path which is not available on my computers (say E:\Project
). When I first opened the crash dump, the debugger has asked me for the source location. I pointed it to E:\B\Project
on my computer, however once the source window appeared, I realized my choice was wrong (the sources were for a different product branch). I would like to point the debugger to a correct location E:\D\Project
, however the debugger is no longer asking me. There is no solution, project or opt file for the crashdump created. I have searched the registry, but I did not find E:\B\Project
anywhere.
如何可以为Visual Studio调试器设置/更改源目录吗?
How can one set/change source directories for Visual Studio debugger?
推荐答案
我发现了一种方法,虽然不是很直观,但是可以:
I have found one way, not very intuitive, but it works:
- 创建一个新的Visual C ++项目和解决方案(可以在任何地方创建,但是mdmp文件旁边的位置似乎很方便)
- ,或使用通常用于生成可执行文件的Visual C ++项目和解决方案
- 在
解决方案中设置源位置
(右键单击)>常用属性
>调试源文件
>目录包含源代码
- 使用
File
>Open 打开故障转储code>>
文件
>选择转储文件
作为过滤器
- create a new Visual C++ project and solution (it may be created anywhere, but a location next to the mdmp file seems convenient)
- or use a Visual C++ project and solution you normally use to build the executable
- set up source location in
Solution
(Right click) >Common Properties
>Debug Source Files
>Directories containing source code
- open the crash dump using
File
>Open
>File
> selectDump Files
as a filter
注意:当互联网上的崩溃转储分析指南不够新时,它们可能会误导您, s的转储文件自2010年以来不再以项目形式打开,而是以文件形式打开。请参见 R Nitzel在MSDN故障转储分析文章。
这篇关于Visual Studio调试器-源搜索目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!