由于后期构建步骤,未加载本机dll的符号(pdb) [英] Symbols (pdb) for native dll are not loaded due to post build step

查看:224
本文介绍了由于后期构建步骤,未加载本机dll的符号(pdb)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用符号构建的本机发行版dll.有一个后构建步骤,可以修改dll.后构建步骤进行了一些压缩,并可能附加了一些数据. pdb文件仍然有效,但是在后期构建步骤之后,WinDbg和Visual Studio 2008均不会加载dll的符号.我们需要修改pdb文件或dll中的哪些位,以便在WinDbg或Visual Studio加载引用了我们的发行版dll的转储时,使WinDbg或Visual Studio加载符号?

I have a native release dll that is built with symbols. There is a post build step that modifies the dll. The post build step does some compression and probably appends some data. The pdb file is still valid however neither WinDbg nor Visual Studio 2008 will load the symbols for the dll after the post build step. What bits in either the pdb file or the dll do we need to modify to get either WinDbg or Visual Studio to load the symbols when it loads a dump in which our release dll is referenced?

重要的是文件大小吗?校验和还是哈希?时间戳吗?

Is it filesize that matters? A checksum or hash? A timestamp?

修改转储?或修改pdb?在发货前修改dll?

Modify the dump? or modify the pdb? modify the dll before it is shipped?

(我们知道pdb是有效的,因为我们能够使用它来手动获取引用已释放的dll的转储调用栈中地址的符号名称.这是* ss手动为每个地址中的每个地址带来的麻烦.所有线程中的一个调用栈.)

(We know the pdb is valid because we are able to use it to manually get symbol names for addresses in dump callstacks that reference the released dll. It's just a total pain in the *ss do it by hand for every address in a callstack in all the threads.)

推荐答案

chkmatch .在已处理的dll上,chkmatch显示以下信息:

This post led me to chkmatch. On the processed dll, chkmatch shows this info:


Executable:
TimeDateStamp: 4a086937
Debug info: 2 ( CodeView )
TimeStamp: 4a086937  Characteristics: 0  MajorVer: 0  MinorVer: 0
Size: 123  RVA: 00380460  FileOffset: 00380460
CodeView signature: sUar

Debug information file:
Format: PDB 7.00
Result: unmatched (reason: incompatible debug information formats)

针对预处理后的dll使用相同的pdb,它会报告以下内容:

With the same pdb against the pre-processed dll, it reports this:


Executable:
TimeDateStamp: 4a086937
Debug info: 2 ( CodeView )
TimeStamp: 4a086937  Characteristics: 0  MajorVer: 0  MinorVer: 0
Size: 123  RVA: 00380460  FileOffset: 00380460
CodeView format: RSDS
Signature: (my guid)  Age: 19
PdbFile: (my path)

Debug information file:
Format: PDB 7.00
Signature: (my matching guid)  Age: 19

我打开了dll的两个版本,并转到了偏移量00380460.在原始版本中,足够清晰,我可以看到pdb的名称,但是在后处理版本中,该偏移量处没有pdb信息.我搜索了pdb路径并找到了完全相同的块-只是在不同的偏移量处.然后,我在bin中搜索了原始dll中的字节"38 00 60 04".看着处理过的dll中的相同偏移量,我发现了相同的字节.因此,我调整了RVA和偏移量(通过匹配字节来定位).答对了!现在chkmatch报告处理后的dll与原始dll的结果完全相同(除了我更改的RVA和FileOffset).

I opened up both versions of the dll and went to offset 00380460. In the original version, clear enough I see the name of the pdb, but in the post-processed version there is no pdb info at that offset. I searched for the pdb path and found the exact same block - just at a different offset. Then I did bin search for the bytes "38 00 60 04" in the original dll. Looking at the same offset in the processed dll, I found the same bytes. So I adjusted the RVA and the offset (located by matching the bytes). Bingo! Now chkmatch reports the exact same results for the processed dll as the original (aside from the RVA and FileOffset that I changed).

编辑:确认,现在Visual Studio加载引用处理后的dll的转储的符号.

Edit: Confirmed, now Visual Studio loads the symbols for dumps that reference the processed dll.

这篇关于由于后期构建步骤,未加载本机dll的符号(pdb)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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