0.1 将VMware与Debugging Tools for Windows基于串口的远程调试功能相结合 https://scz.617.cn/misc/200304301428.txt A: Immortal1015@smth 参看"Microsoft Knowledge Base Article - 121543" http://support.microsoft.com/default.aspx?scid=kb;EN-US;q121543 但是这里介绍的办法与Q121543不同,没有利用真实的串口,而是命名管道。我使用 VMware Workstation 3.2,其上安装了英文版Windows XP SP1。参看帮助文件中这一 节"Debugging an Application in a Virtual Machine from the Windows Host"。 VMWare外部机器(本机)也是英文版Windows XP SP1,其上安装了"Debugging Tools for Windows 6.2"。 启动到VMware的初始界面,为XP SP1虚拟机只设置一个串口,设置如下: -------------------------------------------------------------------------- Device status : Connect at power on Connection : Use named pipe Use named pipe : \\.\pipe\com_1 : This end is the server : The other end is an application I/O Mode : Yield CPU on poll -------------------------------------------------------------------------- 必须让虚拟机以轮询方式使用串口,而非中断方式。3.0版没有这个设置,无法成功 达到本篇目的。启动XP SP1虚拟机,编辑boot.ini如下: -------------------------------------------------------------------------- [boot loader] timeout=-1 default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS [operating systems] multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect /noguiboot /sos multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Kernel Debug" /noguiboot /debug /debugport=COM1 /sos -------------------------------------------------------------------------- 重新启动XP SP1虚拟机,选择"Kernel Debug",这个过程比较慢,耐心等待启动完成。 假设你已经在本机安装虚拟机所用符号表文件,在本机执行如下命令进行基于串口的 远程内核调试: set _NT_SYMBOL_PATH=x:\windows\symbols kd -s -k com:pipe,port=\\.\pipe\com_1,resets=0 如果想退出远程调试的同时保持虚拟机正常运行,不得使用Q命令,必须按如下步骤 退出: kd> bc * kd> g 一定不要与SoftICE远程调试同时使用。此外,进入过远程调试环境的虚拟机在关机 时,需要本机kd的配合,否则虚拟机挂起。虚拟机关闭后本机kd使用Ctrl-B退出。