将dbg符号文件加载到WinDbg中

时间:2014-12-19 08:28:34

标签: windbg debug-symbols

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

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

然后我尝试用!sym noisy 来诊断它,它告诉我Windbg查找正确的符号路径,但仅用于PDB文件( mydll.pdb )。

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

修改

以下是其他一些信息:

Windbg中的符号搜索路径:

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

dbg-file位于该目录中:

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.

由于

1 个答案:

答案 0 :(得分:3)

Drag and Drop * .dbg文件到folder where exe exists
如果模块的lm output表示imagexxxxxxx而不是模块名称 更改dbg文件的名称以匹配它imagexxxxx.dbg do .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"