windows WinDbg Dr. Watson minidump - 需要最初为已安装版本构建的 pdb/dll?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/134866/
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-09-15 11:18:43  来源:igfitidea点击:

WinDbg Dr. Watson minidump - requires pdb/dll originally built for installed version?

windowsdebuggingdllwindbgdr.watson

提问by Doug T.

I have a mindmp file from a target's application crash. Is it possible for me to rebuild the dll/pdb files for a version of software and have windbg load symbols correctly?

我有一个来自目标应用程序崩溃的 mindmp 文件。我是否可以为某个版本的软件重建 dll/pdb 文件并正确加载 windbg 符号?

My problem is that our pdb files are only kept for major releases (unfortunately). This is a daily build, which I can rebuild myself, but I'm getting tripped up on errors.

我的问题是我们的 pdb 文件只保留主要版本(不幸的是)。这是一个每日构建,我可以自己重建,但我被错误绊倒了。

With !sym noisy on: "image header does not match memory image header."

随着 !sym 嘈杂:“图像标题与内存图像标题不匹配。”

DBGENG:  C:\...\XXX.dll image header does not match memory image header.
DBGENG:  XXX.dll - Partial symbol image load missing image info
DBGHELP: Module is not fully loaded into memory.
DBGHELP: Searching for symbols using debugger-provided data.
DBGHELP: C:\...\XXX.pdb - mismatched pdb

Note I've build the pdb with the dll, they are from the same RELEASE directory (should I be building debug?)

注意我已经用 dll 构建了 pdb,它们来自同一个 RELEASE 目录(我应该构建调试吗?)

Theses are release builds (as release builds are installed on the target and crashing) should I be somehow using the debug build dlls to get more symbol information?

这些是发布版本(因为发布版本安装在目标上并崩溃)我应该以某种方式使用调试版本 dll 来获取更多符号信息吗?

回答by SteveMan

The ChkMatchutility is designed for this exact scenario. As long as you have the original .EXE, you can recompile the sources (with the same compiler and compiler settings) and patch the new .PDB to match the old .EXE.

ChkMatch工具是专为这个确切的情况。只要您拥有原始 .EXE,就可以重新编译源代码(使用相同的编译器和编译器设置)并修补新的 .PDB 以匹配旧的 .EXE。

In this example, OriginalExecutable.exeis the executable that no longer has a .PDB file, and RebuiltPDB.pdbis one that has been produced by rebuilding the original source.

在此示例中,OriginalExecutable.exe是不再具有 .PDB 文件的可执行文件,而RebuiltPDB.pdb是通过重建原始源生成的可执行文件。

chkmatch -m OriginalExecutable.exe RebuiltPDB.pdb

Now, as long as the two files have their original names, The debugger should accept them as a matching pair.

现在,只要这两个文件具有它们的原始名称,调试器就应该接受它们作为匹配对。

回答by Rob Walker

In my experience probably not.

根据我的经验可能不会。

If you have the exact build directory and build with the exact samecompiler settings then this might work. You definitely will not be able to load symbols from a debug build against a release crash dump.

如果您有确切的构建目录并使用完全相同的编译器设置进行构建,那么这可能会起作用。您绝对无法从针对发布崩溃转储的调试版本加载符号。

You will need to turn on the 'load anything' options: .symopt+0x40 to get windbg to ignore the timestamp differences.

您需要打开“加载任何内容”选项:.symopt+0x40 以使windbg 忽略时间戳差异。

回答by mikhailitsky

if you still have the exact source code the image was compiled from, then rebuild it producing a new pdb file and then instruct WinDbg to forcibly load this pdb when you open the crash dump - it worked once in my practice.

如果您仍然拥有编译图像的确切源代码,则重建它以生成一个新的 pdb 文件,然后在您打开故障转储时指示 WinDbg 强制加载此 pdb - 在我的实践中它工作过一次。

回答by Roger Lipscombe

PDB files are tied to their EXE files by a GUID and an "age" (it's a sequence number). These are embedded in the EXE, and into the PDB. The GUID is regenerated on each complete build, and the "age" is changed on each incremental build.

PDB 文件通过 GUID 和“年龄”(这是一个序列号)与其 EXE 文件相关联。这些嵌入在 EXE 和 PDB 中。GUID 在每次完整构建时重新生成,并且“年龄”在每次增量构建时更改。

The debugger uses these to ensure that it's looking at the correct PDB for the EXE file.

调试器使用这些来确保它正在查看 EXE 文件的正确 PDB。

I didn't know about the "chkmatch" tool mentioned by SteveMan, but I suspect that it works by patching up the GUID/age so that they match.

我不知道 SteveMan 提到的“chkmatch”工具,但我怀疑它是通过修补 GUID/age 使它们匹配来工作的。

回答by Dan K

This is too late to help Doug, but for the sake of anyone who comes across this question, another thread (Is it possible to load mismatched symbols in Visual Studio?) pointed out a way to get WinDbg to accept mismatched .PDB files

这对 Doug 来说已经太晚了,但是为了任何遇到这个问题的人,另一个线程(是否可以在 Visual Studio 中加载不匹配的符号?)指出了一种让 WinDbg 接受不匹配的 .PDB 文件的方法

.symopt_0x40