调试重命名的DLL? [英] Debugging a renamed DLL?

查看:198
本文介绍了调试重命名的DLL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在调试DLL时遇到问题,该DLL在构建后的过程中已被重命名:WinDBG无法加载正确的符号(pdb文件)。

示例:
原始文件名原为:abc.dll
创建的PDB命名为:abc.pdb
在构建后的过程中,DLL重命名为 ab.DLL。

出于某些原因,调试时我可以看到该模块显示为 a_b.dll(下划线代替了连字符,不知道为什么会这样)。此外,WinDBG无法加载其符号。

我尝试了 ld a_b / f abc ,还尝试将PDB重命名为'a_b.pdb',并且然后称为 .reload / f / i a_b ,但这也行不通。

这一切都发生在我的 Release code>构建,它​​被设置为添加调试信息并创建了PDB。

I am having problems trying to debug a DLL, which has been renamed during the post-build process: WinDBG fails to load the correct symbols (pdb file).

Example:
Original file name was: abc.dll
The created PDB is named: abc.pdb
During post-build process the DLL was renamed to 'a-b.DLL'.

For some reason when debugging I can see the module apears as 'a_b.dll' (hyphen was replaced by underscore, not sure why this happen). In addition, WinDBG cannot load its symbols.

I tried ld a_b /f abc, and also tried to rename PDB as 'a_b.pdb', and then called .reload /f /i a_b, but also this did not work.

All this happens in my Release build, which was set to add debug-info and created PDB, as it does.

推荐答案

PDB的名称是DLL的一部分。重命名DLL不会更改其内容,因此重命名PDB也不起作用。

The name of the PDB is part of the DLL. Renaming the DLL will not change its contents, so renaming the PDB as well will not work. Instead, keep the original name.

请确保您的符号设置正确,例如使用Microsoft符号和您自己的符号:

Make sure your symbols are set up correctly, e.g. use Microsoft symbols and your own symbols:

.symfix c:\debug\symbols
.sympath+ c:\path_to\myproject\bin\Release
.reload

另外,不要不必担心WinDbg中的模块名称。它会替换一些特殊字符,但不会影响符号加载。如果仍然有问题,请打开符号调试输出

Also, don't worry about the module name in WinDbg. It replaces some special characters, but won't affect symbol loading. If you still have problems getting symbols laded, turn on symbol debug outout

!sym noisy

这应该显示WinDbg试图从中加载符号的路径和文件名。检查您的位置是否包括在内。如果没有,请通过 .sympath + 添加它。完成后,通过以下方式关闭符号调试

This should show the paths and file names where WinDbg tries to load symbols from. Check if your location is included. If not, add it via .sympath+. When done, turn symbols debugging off by

!sym quiet

此命令等效于

.symopt+ 0x80000000    *** noisy
.symopt- 0x80000000    *** quiet

这篇关于调试重命名的DLL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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