Hyper-V 调试:如果在无调试解调器的情况下进行远程连接和调试

2009年12月12日 | 分类: Microsoft | 标签: , | Author: chill
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading ... Loading ...

Debugging Tools 现在已经支持Hyper-V的挂载连接调式了,当然这也不是新鲜事,这里将简单介绍下如何开始做Hyper-V的无解调器的基本调式,完了这篇我会在写个实例怎么做debugging.

 

在对HV做线缆调试之前,你需要注意几个方面:

1. 确保你不要用错Debugging Tool的版本,一定要是X64版本,不要用X32版本的debugging tool哦,HV可是跑在64位上的,没有哪个版本是32位的哦。如果一些特殊情况需要用到其他版本,那用1394来做。

2. 复制Debugging Tools中的kdhvcom.dll到HV根分区的Windows\system32下面,记住不是WOW64,kdhvcom.dll只有64位版本中有。

3. 登录到HV计算机,并用BCDEdit工具设置启动配置设置以启用debugging。这里有两个方式,第一如果要调式根分区,用以下命令:

bcdedit /set dbgtransport kdhvcom.dll
bcdedit /dbgsettings serial DEBUGPORT:Port BAUDRATE:Baud
bcdedit /debug on

如果是要调式Windows Hypervisor,用这些命令:

bcdedit /hypervisorsettings serial DEBUGPORT:Port BAUDRATE:Baud
bcdedit /set hypervisordebug on
bcdedit /set hypervisorlaunchtype auto

上面命令中的port表示COM端口,Baud表示连接的速率,例如你连接的是COM1并且速率是115,200,那么Port部分则是1,Baund部分则是115200。

 

如果你同时要调式root partition和windows hypervisor,那就要同时使用以上两组命令来启用debugging。

 

注意:

以上用COM端口来做完成调试的方式不是标准的内核调式,这个可以参考相关帮助。

 

在调试主机打开Command Prompt,输入:

vmdemux -src com:port=Port,baud=Baud

 

5. 实际上debugging会话是由Remote.exe调用KD建立的,要开始调式root partition, 请用如下命令:

remote.exe /s "DbgPath\kd –k RPConnectionString -y SymPath" HyperV_ROOT

要开始调试 Windows hypervisor, 请用如下命令:

remote.exe /s "DbgPath\kd -k HVConnectionString -y SymPath" HyperV_HV

RPConnectionString  和 HVConnectionString 表示root partition和Windows Hypervisor的连接字符串,这些都将在vmdemux的输出中显示出来。DbgPath 表示Debugging Tool的安装目录,SymPath 表示符号路径。当然你也可以在里面设置其他的KD选项。

连接到root partition的例子:

remote.exe /s "\debuggers\kd –k com:port=\\.\pipe\Vm1,pipe,resets=0,reconnect -y srv*c:\localstore*http://msdl.microsoft.com/download/symbols" HyperV_ROOT

连接到Windows Hypervisor的例子:

remote.exe /s "c:\debuggers\kd -k com:port=\\.\pipe\Vm0,pipe,resets=0,reconnect -y srv*c:\localstore*http://msdl.microsoft.com/download/symbols" HyperV_HV

 

之后,你就可以开始工作了。

没有评论

  • (Required)
  • (Required, will not be published)