在 Visual Studio 中分析故障转储 [英] Analyzing Crash dumps in Visual Studio

查看:35
本文介绍了在 Visual Studio 中分析故障转储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个崩溃的应用程序的 *.dmp(转储)文件.现在,我想分析另一台机器上的崩溃进程.也就是说,应用程序在一台机器上崩溃了,而我在另一台机器上安装了 Visual Studio.

I have a *.dmp (dump) file of my crashed application. Now, I want to analyze the crashed process on a different machine. That is, the app crashed on one machine, and I have Visual Studio on other machine.

现在,我需要什么才能看到堆栈跟踪和我的应用程序的所有符号?*.exe 文件和*.dmp 文件是否足够?

Now, what do I need to be able to see stack trace and all symbols of my app? Is *.exe file and the *.dmp file sufficient?

或者我还需要源代码和 PDB 文件吗?

Or do I need also the source code and PDB file?

如果是这样,源代码和可执行文件是否应该放在与进程正在运行的机器上相同的目录结构中?

If so, should the source code and executable file be placed in the same directories structure as it is on the machine the process was running?

如何在 Visual Studio 中将 PDB 文件附加到故障转储文件?

How to attach PDB file to crash dump file in Visual Studio?

推荐答案

不,您肯定需要 .pdb 文件才能获得不错的堆栈跟踪.到目前为止,最简单的方法是在您构建程序的机器上执行此操作,源代码和 .pdb 文件将位于正确的位置.

No, you definitely need the .pdb files to get decent stack traces. By far the simplest way is to do this from the machine on which you built the program, the source code and .pdb files will be in the right place.

接下来最好的办法是将完全相同的可执行文件复制到故障计算机上安装它的完全相同的文件夹中.将 .pdb 文件复制到同一个目录中,如果在原始构建位置找不到它们,调试器将在该目录中查找它们.一旦调试器到达带有源代码的语句并且 .pdb 没有被剥离,那么它将提示您提供源代码文件的位置.

Next best thing is to copy the exact same executables into the exact same folder in which it was installed on the failing machine. Copy the .pdb files into that same directory, that's where the debugger looks next if it can't find them in the original build location. Once the debugger lands on a statement with source code and the .pdb wasn't stripped then it will prompt you to give the source code file location.

下一个最好的事情是工具 + 选项、调试、符号,并将路径添加到包含 .pdb 文件的目录.

Next best thing is Tools + Options, Debugging, Symbols and add the path to the directory that contains the .pdb files.

在同一个对话框中,还打开 Microsoft 符号服务器 (http://msdl.microsoft.com/download/symbols).这将为您获取 Windows DLL 的符号,并让您在 Windows DLL 中发生崩溃时准确地追溯到您自己的代码.

In that same dialog, also turn on the Microsoft Symbol Server (http://msdl.microsoft.com/download/symbols). That gets you the symbols for the Windows DLLs and lets you accurately trace back to your own code if the crash occurred in a Windows DLL.

这篇关于在 Visual Studio 中分析故障转储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆