【问题标题】:Load dbg symbol file into WinDbg将 dbg 符号文件加载到 WinDbg
【发布时间】:2015-02-18 03:54:03
【问题描述】:

我有一个要调试的 DLL 的 MAP 文件。我使用 Map2Dbg 工具将其转换为 DBG 文件并将其放入符号路径中。

虽然发出 .reload /f mydll.dll 不起作用,但会出现符号加载错误。

然后我尝试用 !sym quiet 对其进行诊断,它告诉我 Windbg 查找正确的符号路径,但仅针对 PDB 文件(mydll.pdb )。

有没有办法强制 Windbg 找到我的 DBG 文件?

编辑:

这里有一些进一步的信息:

Windbg中的符号搜索路径:

> .sympath
e:\code-factory\symbols;cache*;SRV*http://msdl.microsoft.com/download/symbols

dbg 文件在该目录中:

e:\code-factory\symbols> dir /b
cdmod.dbg
cdmod.map
...

.reload 输出:

> .reload /f cdmod.dll

DBGHELP: e:\code-factory\symbols\cdmod.pdb - file not found
DBGHELP: e:\code-factory\symbols\dll\cdmod.pdb - file not found
DBGHELP: e:\code-factory\symbols\symbols\dll\cdmod.pdb - file not found
SYMSRV:  D:\Portable\Debugging Tools for Windows\x86\sym\cdmod.pdb\BD09115E93474ABCB6152149A23F95372\cdmod.pdb not found
SYMSRV:  Get File Path: /download/symbols/cdmod.pdb/BD09115E93474ABCB6152149A23F95372/cdmod.pdb


************* Symbol Loading Error Summary **************
Module name            Error
cdmod                    PDB not found : e:\code-factory\symbols\symbols\dll\cdmod.pdb
                Unable to locate the .pdb file in this location

                       PDB not found : cache*
                Unable to locate the .pdb file in this location

                       The system cannot find the file specified : SRV*http://msdl.microsoft.com/download/symbols
                The SYMSRV client failed to find a file in the UNC store, or there
                is an invalid UNC store (an invalid path or the pingme.txt file is
                not present in the root directory), or the file is present in the
                symbol server exclusion list.

谢谢

【问题讨论】:

  • 当我尝试 .reload 时,我看到 Windbg 正在寻找 .dbg 文件。你能发布你的.reload 命令的输出吗?

标签: windbg debug-symbols


【解决方案1】:

Drag and Drop *.dbg 文件到folder where exe exists
如果模块的lm output 使用imagexxxxxxx 而不是模块名称
更改 dbg 文件的名称以匹配它,如 imagexxxxx.dbg 执行.reload /f 并且windbg 应该使用cv code symbols 加载您的dbg 文件

前目录内容

    :\>dir /b
    msgbox.exe
    msgbox.map  < created via ida produce map         

将地图转换为 dbg

    :\>map2dbg msgbox.exe  lucian wischik utility
    Converted 7 symbols.

发布目录内容

    :\>dir /b
    msgbox.dbg
    msgbox.exe
    msgbox.map 

在windbg中加载exe

    :\>windbg msgbox.exe    
0:000> lm 
start    end        module name
00400000 00404000   image00400000   (deferred) 

0:000> .reload /f
Reloading current modules
ERROR:Module load completed but symbols could not be loaded for image00400000 

0:000> lm e
start    end        module name
00400000 00404000   image00400000   (no symbols)

$ rename the msgbox.dbg to image00400000.dbg  

重命名 dbg 文件

    :\>ren msgbox.dbg image00400000.dbg        
    :\>dir /b
    image00400000.dbg
    msgbox.exe
    msgbox.map

将 cv 代码符号信息加载到 windbg 的符号文件

0:000> .reload /f
Reloading current modules
0:000> lm e
start    end        module name
0:000> lm m i*
start    end        module name
00400000 00404000   image00400000   (codeview symbols)     
C:\Documents and Settings\Admin\Desktop\nosym\image00400000.dbg

0:000> x image00400000!*
00401000 image00400000!start = <no type information>
0040101a image00400000!MessageBoxA = <no type information>
00401020 image00400000!ExitProcess = <no type information>
00403000 image00400000!Caption = <no type information>
00403019 image00400000!Text = <no type information>

0:000> da image00400000!Caption
00403000  "Iczelion's tutorial no.2"

【讨论】:

    猜你喜欢
    • 2011-11-06
    • 1970-01-01
    • 2020-07-19
    • 2015-01-02
    • 2016-12-25
    • 1970-01-01
    • 2017-03-14
    • 2012-06-14
    • 2012-02-21
    相关资源
    最近更新 更多