2011-04-12 226 views

回答

14

運行windbg -I將其安裝在默認的驗屍調試器。

正如Kurt指出的那樣,WinDbg具有32位和64位兩種版本。執行windbg -I爲與調試器的位數相對應的進程設置事後調試器。

如果您需要同時使用32位和64位版本,則可以同時安裝兩個版本的WinDbg。

從幫助文件:

-I[S]已安裝的WinDbg爲事後調試。有關詳細信息,請參閱 啓用事後調試。在 嘗試執行此操作後,將顯示成功或 失敗消息。如果包含S爲 ,則此過程在成功時默默執行 ;僅顯示 失敗消息。 -I 參數不得與其他任何參數一起使用。該命令將 實際上不啓動WinDbg,儘管 WinDbg窗口可能會出現片刻。

+3

說明註冊成功,但再次啓動崩潰過程仍然會導致只顯示Visual Studio調試器的Visual Studio Just-In-Time窗口。 :(哦,好吧, – SilverbackNet 2013-06-12 21:40:33

+2

@SilverbackNet:Windbg有32位和64位兩種版本,如果你用'-I'參數運行32位版本,它將自己設置爲32位進程的默認調試器。如果你運行64位版本,它將自己設置爲64位進程的默認調試器,所以如果你仍然看到Visual Studio調試器選擇窗口,可能是你沒有運行正確的bitness風格windbg with'-I'。參見[本MSDN文章](https://msdn.microsoft.com/en-us/library/windows/hardware/ff542967)。 – 2015-10-15 04:03:25

+0

我記得[windbg]最近發佈的一篇文章該比特覆蓋哪一個(但反之不然)。 – 2015-10-19 08:38:03

5

下面是設置的WinDbg作爲託管調試和本機調試一個註冊表文件:

Windows Registry Editor Version 5.00 

;This reg file installs just-in-time debuggers to capture a dump of all process 
;crashes for the machine. 
; 
;Assumes 32-bit debugger is cdb.exe and is installed to C:\debuggers\x86\. 
;Assumes 64-bit debugger is cdb.exe and is installed to C:\debuggers\x64\. 
; 
;Assumes crash dumps can be written to C:\crash_dumps\. 
;Make sure all users have write access to this directory. 

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework] 
"DbgManagedDebugger"="\"c:\\debuggers\\x64\\windbg.exe\" -pv -p %ld " 
"DbgJITDebugLaunchSetting"=dword:00000002 


[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug] 
"Debugger"="\"c:\\debuggers\\x64\\windbg.exe\" -pv -p %ld " 
"Auto"="1" 


;The following keys are only used on 64-bit versions of Windows (note Wow6432Node). 
;They can be safely created with no side-effects on 32-bit versions of Windows. 
;Alternatively, you can delete the remainder of this file if you’re running a 
;32-bit version of Windows. 


[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug] 
"Debugger"="\"c:\\debuggers\\x86\\windbg.exe\" -pv -p %ld " 
"Auto"="1" 

Automatically Capturing a Dump When a Process Crashes是從CLR團隊這個書面記錄。