2010-12-21 84 views
1

我想在我的VS2010 .net4應用程序中使用windbg得到一個未處理的異常的正確調用堆棧。主程序是一個控制檯應用程序。這個DLL正確加載它的符號。 在同一個目錄中,我有一個dll +匹配的pdb,它不會加載。windbg - 模塊未加載「在圖像列表中找不到dll」

我在Windows服務器2008 R2,64位(未安裝VS)上運行應用程序。但該應用程序是在32位編譯的。我正在使用winX86調試器附加到進程。

我已經下載sosex支持.NET 4從 http://www.stevestechspot.com/(32位版本) 的sos.dll(從「C:\ Program Files文件(x86)的\ Windows調試工具(x86)的\ clr10 \ SOS .dll「)版本是6.12.2.633。

發出以下命令:
SYMPATH + 「... EXE和DLL文件夾」
.loadby SOS CLR
.load sosex.dll

在運行時MK我得到以下! !

Thread 0: 
    ESP  EIP 
00:U 0016ec6c 5f636578 0x5f636578 
01:U 0016ec70 05f1380f SN!SN_MedistoreEngine::FetchNotes+0x13f [v:\mp\mp\src\sn\sn_medistoreengine.cpp @ 59] 
02:M 0016edbc 07dd0db1 SN_Bridge.SNB_bridge.fetch_notes(IOD_Msg*, System.String, System.String, Boolean)(+0x4a IL)(+0x131 Native) [v:\mp\portal\commonutils\src\snb\snb_bridge.cpp, @ 142,0] 
03:M 0016ef24 055bfde5 SN_Bridge.SNB_bridge.FetchNotesByStudyUId(System.String, System.String, System.Collections.Generic.List`1<SN_Bridge.SNB_StickyNote>)(+0x25 IL)(+0x55 Native) [v:\mp\portal\commonutils\src\snb\snb_bridge.cpp, @ 296,0] 
04:M 0016efb0 055bfd22 
"xxx.Services.StickyNotes.dll" was not found in the image list. 
Debugger will attempt to load "xxx.Services.StickyNotes.dll" at given base 00000000. 

Please provide the full image name, including the extension (i.e. kernel32.dll) 
for more reliable results.Base address and size overrides can be given as 
.reload <image.ext>=<base>,<size>. 
Unable to add module at 00000000 

"xxx.ni.Services.StickyNotes.dll" was not found in the image list. 
Debugger will attempt to load "xxx.ni.Services.StickyNotes.dll" at given base 00000000. 

Please provide the full image name, including the extension (i.e. kernel32.dll) 
for more reliable results.Base address and size overrides can be given as 
.reload <image.ext>=<base>,<size>. 
Unable to add module at 00000000 
xxx.Services.StickyNotes.StickyNotesLogic.StickyNotesByStudyID(System.String, System.String, System.String)(+0x1d IL)(+0x52 Native) 
05:M 0016efcc 055ba0ab SNConsole.Program.Main(System.String[])(+0x101 IL)(+0x24b Native) [D:\Documents and Settings\tamar\My Documents\Visual Studio 2010\Projects\SNConsole\Program.cs, @ 48,17] 
06:U 0016f02c 72da21db clr+0x21db 
07:U 0016f034 72dae021 clr!DllUnregisterServerInternal+0x8025 
08:U 0016f090 72dbc58d clr!DllUnregisterServerInternal+0x16591 

在運行時clrstack我得到如下:

PDB symbol for clr.dll not loaded 
OS Thread Id: 0x2984 (0) 
Child SP IP  Call Site 
0016edc8 5f636578 [InlinedCallFrame: 0016edc8] 
0016edc4 07dd0db1 SN_Bridge.SNB_bridge.fetch_notes(IOD_Msg*, System.String, System.String, Boolean) [v:\mp\portal\commonutils\src\snb\snb_bridge.cpp @ 142] 
0016ef30 055bfde5 SN_Bridge.SNB_bridge.FetchNotesByStudyUId(System.String, System.String, System.Collections.Generic.List`1<SN_Bridge.SNB_StickyNote>) [v:\mp\portal\commonutils\src\snb\snb_bridge.cpp @ 296] 
0016efb0 055bfd22 xxx.Services.StickyNotes.StickyNotesLogic.StickyNotesByStudyID(System.String, System.String, System.String) 
0016efcc 055ba0ab SNConsole.Program.Main(System.String[]) [D:\Documents and Settings\tamar\My Documents\Visual Studio 2010\Projects\SNConsole\Program.cs @ 48] 
0016f25c 72da21db [GCFrame: 0016f25c] 

如您所見,在這兩種情況下,我都會在堆棧中獲取文件名+行號,xxx.Services.StickyNotes.dll行除外。

我已經試過: .realod/F 「」 C:\ xxx.Services.StickyNotes.dll 「 - 同樣的錯誤 和
LD」 C:\ XXX。 Services.StickyNotes.dll」這導致

沒有模塊匹配 'C:\ BIN \ xxx.Services.StickyNotes.dll'

使用SYM吵都沒有!幫助,我認爲它因爲模塊本身沒有加載,所以甚至不會嘗試加載pdb。

我不明白爲什麼這個特定的dll不會加載。 SN_Console.exe和SNB_Bridge.dll從同一個目錄加載沒有問題。 (我不關心異常本身,我植入了創建的代碼,問題是關於設置一個好的調試環境)。

由於提前, 添馬艦

回答

0

可以使用提示調試器中的DLL的位置,它的地址空間:

.reload /f "c:...\xxx.Services.StickyNotes.dll=image_base_address" 

image_base_address是這個DLL在過程中映射的地址範圍的開始。您可以在Process Explorer的DLL窗格中找到此值。

我寫了一些更詳細的內容here

相關問題