Windbg USB3.0雙機調試

配置需求

  1. 目標主機有USB3.0 xHCI主機控制器,支持調試

[Port1]

Is Port User Connectable: yes

Is Port Debug Capable: yes

Companion Port Number: 3

Companion Hub Symbolic Link Name: USB#ROOT_HUB30#5&32bab638&0&0#{…}

Protocols Supported:

USB 1.1: no

USB 2.0: no

USB 3.0: yes

  1. host主機支持USB3.0 xHCI主機控制器(使用UsbView查看)
  2. USB 3.0 調試線(國外購買地址)(可以用普通USB3.0 公對公線改造,剪掉紅綠百三根線)

先從淘寶買一根USB 3的A對A連線,有時也稱公對公連線,很便宜。這根線需要加工一下才可以支持調試,加工的方法是選取線的某個位置,剝開外皮,然後把其中的紅綠白三根線剪斷,然後包上就可以了。USB 3電纜的線是有固定顏色的,如圖3所示,
其中SDP是Shielded Differential Pair的縮寫,即屏蔽起來的差分信號線,是USB 3.0的數據線,UTP是Unshielded Twisted Pair的縮寫,即未屏蔽的雙絞線,是USB1/2使用的數據線,所謂的D+,D-。要做的加工其實就是把2.0的三根弦剪斷。剝開後,很容易找到紅綠白三根,膽大心細,下剪子吧:-)。

  1. 兩臺主機系統必須是Win8以上

On the host computer, an xHCI (USB 3.0) host controller
On the target computer, an xHCI (USB 3.0) host controller that supports debugging

步驟

在目標主機配置調試模式。

命令:

bcdedit /debug on
bcdedit /dbgsettings usb targetname:TargetName
//如果目標主機有多個xHCI主機控制器,則需要配置需要使用的,b.d.f在usbview中可以看到
bcdedit /set "{dbgsettings}" busparams b.d.f
//重啓主機

使用msconfig配置,引導,高級模式,勾選調試,選擇USB模式,USB目標名:usbdbg

host主機配置。

第一次配置,如果host是X64,開啓X64 windbg,如果是x86,選擇開啓x86 windbg,需要管理員權限運行。

Ctrl+K,選擇USB,填入目標主機配置的名字(usbdbg),確認,等待。


Microsoft (R) Windows Debugger Version 10.0.14321.1024 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.

Using USB for debugging
Waiting to reconnect...
USB: Write opened

當將USB調試線插入host主機接口時,會自動安裝相關驅動(usb2dbg等,管理員,位數等要求的原因)。

然後出現USB: Write opened表示與目標主機連接成功。

按下Ctrl+break,即可開始調試目標主機了

Connected to Windows 10 16299 x64 target at (Tue Dec 12 09:47:18.535 2017 (UTC + 8:00)), ptr64 TRUE
Kernel Debugger connection established.

************* Symbol Path validation summary **************
Response                         Time (ms)     Location
Deferred                                       SRV*e:\symbols* http://msdl.microsoft.com/download/symbols
Deferred                                       SRV*e:\symbols*http://msdl.microsoft.com/download/symbols
Symbol search path is: SRV*e:\symbols* http://msdl.microsoft.com/download/symbols;SRV*e:\symbols*http://msdl.microsoft.com/download/symbols
Executable search path is: 
Windows 10 Kernel Version 16299 MP (4 procs) Free x64
Product: WinNt, suite: TerminalServer SingleUserTS
Built by: 16299.15.amd64fre.rs3_release.170928-1534
Machine Name:
Kernel base = 0xfffff800`9e21d000 PsLoadedModuleList = 0xfffff800`9e57efb0
Debug session time: Tue Dec 12 09:47:12.452 2017 (UTC + 8:00)
System Uptime: 3 days 17:11:46.032
WARNING: Whitespace at end of path element

************* Symbol Path validation summary **************
Response                         Time (ms)     Location
Deferred                                       SRV*e:\symbols* http://msdl.microsoft.com/download/symbols
Deferred                                       SRV*e:\symbols*http://msdl.microsoft.com/download/symbols
Break instruction exception - code 80000003 (first chance)
*******************************************************************************
*                                                                             *
*   You are seeing this message because you pressed either                    *
*       CTRL+C (if you run console kernel debugger) or,                       *
*       CTRL+BREAK (if you run GUI kernel debugger),                          *
*   on your debugger machine's keyboard.                                      *
*                                                                             *
*                   THIS IS NOT A BUG OR A SYSTEM CRASH                       *
*                                                                             *
* If you did not intend to break into the debugger, press the "g" key, then   *
* press the "Enter" key now.  This message might immediately reappear.  If it *
* does, press "g" and "Enter" again.                                          *
*                                                                             *
*******************************************************************************
nt!DbgBreakPointWithStatus:
fffff800`9e386c60 cc              int     3

連接成功,設備管理中出現USB Debug Connection Device

參考:

  1. setting-up-a-usb-3-0-debug-cable-connection
  2. USB3 Kernel Debugging with Dell PowerEdge 13G Servers
  3. http://blog.techlab-xe.net/archives/1961
  4. 使用USB3.0調試Windows 8
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章