windows雙機除錯
目標計算機(windows 7 串列埠除錯):
1. 管理員帳號登陸
2.設定除錯方式
串列埠引數
bcdedit /dbgsettings serial baudrate:115200 debugport:1
網路除錯(僅限於win7以上)
bcdedit /dbgsettings net hostip:192.168.1.1 port:50000 key:1.2.3.4
3.複製一個開機選項,命名為“DebugEntry”,可任意命名。命令如下:
bcdedit /copy {current} /d DebugEntry \\設定後會產生一串數字,記錄下來,填充後面的ID欄位
4.啟用或禁用作業系統項的核心除錯。
bcdedit /debug [{ID}] { ON | OFF }
5. 鍵入此命令以啟用測試簽名。
bcdedit /set TESTSIGNING ON | OFF
在dos下的windbg目錄下,鍵入下面命令啟動windbg(管道引數要和虛擬機器一致)
串列埠
windbg -b -k com:pipe,port=\\.\pipe\com_1,resets=0
網路
WinDbg –k net:port=50000,key=1.2.3.4
若要列印kdprint輸出資訊,在windbg下鍵入下面命令
ed kd_default_mask 0xffffffff
詳情檢視Reading and Filtering Debugging Messages
https://docs.microsoft.com/zh-cn/windows-hardware/drivers/devtest/reading-and-filtering-debugging-messages
以管理員執行CMD,一次執行以下命令:
bcdedit /bootdebug ON
bcdedit /debug ON
bcdedit /dbgsettings serial baudrate:115200 debugport:1
bcdedit /copy {current} /d DebugEntry
bcdedit /displayorder {current} {be64c676-46ac-11e8-b719-a213e216b4ab}
bcdedit /debug {be64c676-46ac-11e8-b719-a213e216b4ab} ON
bcdedit /set TESTSIGNING ON
重啟
目標計算機(windows 10 網路除錯):
1. 管理員帳號登陸
2.啟動除錯
bcdedit /set {default} DEBUG YES
3. 鍵入此命令以啟用測試簽名。
bcdedit /set TESTSIGNING ON
4. 鍵入以下命令以設定主機系統的 IP 地址。使用你之前記錄的主機系統的 IP 地址,而非示例中所示的地址。
網路除錯
bcdedit /dbgsettings net hostip:192.168.1.1 port:50000 key:1.2.3.4
5. 鍵入此命令以確認 dbgsettings 均已正確設定。
bcdedit /dbgsettings
主機系統:
1.找到windbg目錄
C:\Program Files (x86)\Windows Kits\10\Debuggers\x64
2. 使用以下命令啟動具有遠端使用者除錯功能的 WinDbg。金鑰值和埠
值須與我們之前使用 BCDEdit 在目標計算機系統上設定的值匹配。
串列埠
windbg -b -k com:pipe,port=\\.\pipe\com_1,resets=0
網路
WinDbg –k net:port=50000,key=1.2.3.4
3.重啟目標計算機
bug: WinDBG實時列印Windows驅動或者核心資訊的方法
當WinDBG除錯視窗載入符號表未出現錯誤資訊時,在WinDBG中命令列中輸入以下命令:
ed kd_default_mask 0xffffffff //不區分大小寫,用於開啟Windows驅動或者核心除錯篩選器