C++ 读取 windows *.dmp 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/158534/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 13:19:59  来源:igfitidea点击:

Reading a windows *.dmp file

c++cwindows

提问by Aardvark

I was wonder if any knows how to open up a windows *.dmp file after a application crash written C/C++.

我想知道是否有人知道如何在编写 C/C++ 的应用程序崩溃后打开 windows *.dmp 文件。

回答by Aardvark

Using Visual Studio's File>Open Projector the free WinDbg's (part of Debugging Tools for Windows) File>Open Crash Dumpselect the dmp file.

使用 Visual Studio 的File>Open Project或免费的 WinDbg(Windows 调试工具的一部分)File>Open Crash Dump选择 dmp 文件。

Make sure to configure the tools to include a path to the location of the PDB debugging symbols for that application (you do have symbols right?). Either tool has a thread and call stack window that should give you a good idea where the crash occurred. Including paths to the source code will help as well.

确保将工具配置为包含该应用程序的 PDB 调试符号位置的路径(您确实有符号吗?)。这两个工具都有一个线程和调用堆栈窗口,可以让您很好地了解崩溃发生的位置。包含源代码的路径也会有所帮助。

Symbol and Source paths can be set in WinDbg under the File menu. It's buried in Visual Studio under Tools>Options>Debugging>Symbolsand Tools>Options>Project and Solutions>VC++ Directores

符号和源路径可以在文件菜单下的 WinDbg 中设置。它隐藏在 Visual Studio 中的Tools>Options>Debugging>Symbolsand Tools>Options>Project and Solutions>VC++ Directores

回答by Wayne

Here's a link to an article from Microsoft on reading the small memory dump files that Windows creates for debugging

这是 Microsoft 的一篇文章的链接,该文章关于阅读 Windows 为调试而创建的小内存转储文件

回答by Tom

When using Debugging Tools for Windowsbe sure to setup symbols. For Microsoft symbols use: SRV*DownstreamStore*http://msdl.microsoft.com/download/symbols

使用Windows 调试工具时,请务必设置符号。对于 Microsoft 符号,请使用:SRV*DownstreamStore* http://msdl.microsoft.com/download/symbols

For example: SRV*c:\websymbols*http://msdl.microsoft.com/download/symbols

例如:SRV*c:\websymbols* http://msdl.microsoft.com/download/symbols

Take a look at these blogs for more on debugging:

查看这些博客以了解有关调试的更多信息:

回答by Richard Harrison

If you mean a dump file created by windows (either small memory dump, kernel memory dump or full memory dump) that is created after a system crash then you need WinDBG

如果您的意思是在系统崩溃后创建的由 windows 创建的转储文件(小内存转储、内核内存转储或完整内存转储),那么您需要WinDBG

回答by Ates Goral

You should be able to just double click the .dmp file to automatically open it in Visual Studio. If the .pdb file that was generated when the program was compiled is still around, Visual Studio should be able to automatically load the symbols from that. From then on, you can just hit Run/Debug (F5) to start peeking into the .dmp file.

您应该只需双击 .dmp 文件即可在 Visual Studio 中自动打开它。如果编译程序时生成的 .pdb 文件仍然存在,Visual Studio 应该能够自动加载符号。从那时起,您只需点击运行/调试 (F5) 即可开始查看 .dmp 文件。