在 XenServer上调试windows程序

WinDbg

WinDbg is one of a number of tools available from Microsoft that can be used for debugging Windows guests in XenServer environments.

You can get QEMU to passive-open a TCP port on dom0 for serial output and wait for a connection, this method will work if you‘re running on a machine with a dynamically assigned IP address:
on XenServer 6.2 or later

xe vm-param-add uuid=<uuid> param-name=platform hvm_serial=tcp::<port>,server,nodelay

on earlier versions

xe vm-param-add uuid=<uuid> param-name=other-config hvm_serial=tcp::<port>,server,nodelay

Then:

  1. Grab a copy of HW Virtual Serial Port from http://www.hw-group.com/products/hw_vsp/hw_vsp2_en.html and install it.
  2. Fire up the application and configure a COM port to point at your dom0 IP address and the <port> you specified to QEMU above). Make sure that you uncheck ‘NVT Enable‘ in the Settings tab.
  3. Start the COM port.
  4. Configure debugging inside the guest by editing boot.ini in the usual way.
  5. Reboot the VM.
  6. Start windbg and point it at the COM port you created.
An Unofficial Method

To the best of my knowledge we have never released sockpipe.exe but this is a method some of our own developers use, it isn‘t supported but may be useful to developers in a debug scenario.

If you‘re running windbg on a machine with a statically assigned IP address then you can use the following setting to get QEMU to active-open a TCP port on your machine for serial output:

on XenServer 6.2 or later

xe vm-param-add uuid=<uuid> param-name=platform hvm_serial=tcp:<machine>:<port>

on earlier versions

xe vm-param-add uuid=<uuid> param-name=other-config hvm_serial=tcp:<machine>:<port>

Then:

  1. Run sockpipe.exe (which seems to be available here) on the machine where you want to run windbg. Run it without arguments to get help; it should be fairly obvious what‘s going on. For example, you could use ‘sockpipe <name> <port>‘ (where <port> is the name number as specified to QEMU above).
  2. Fire up windbg and go ``File->Kernel Debugging‘‘, make sure that ``Pipe‘‘ is ticked, and enter \\.\pipe\<name> in the Port box, where <name> is the pipe name specified to sockpipe. Hit OK.
  3. Configure debugging inside the guest by editing boot.ini in the usual way.
  4. Reboot the VM.
  5. Debug as normal.

I‘m told it may be a bit slow, but it mostly works although it has limitations; it will not work for SMP 64 bit or SMP Vista.

Further Information

链接

时间: 2024-08-05 14:30:51

在 XenServer上调试windows程序的相关文章

[WINCE|VS2008] 用在PC上调试WINCE程序

http://www.danielmoth.com/Blog/deploy-to-my-computer.aspx 作者:The Moth 步骤: 1. 在VS2008中打到 Device Options=>Windows CE=>Save As... => DesktopRun ,关闭VS2008 2. 打开文件 %USERPROFILE%\Local Settings\Application Data\Microsoft\CoreCon\1.0\conman_ds_platform.

Windows远程调试Linux上的C++程序:Eclipse+MingW+Samba+GDBserver

转自:http://www.heimizhou.com/windows-remote-debug-linux-c-plus-plus.html 最近有一个需求,就是需要在Windows上远程调试Linux上的C++程序,然后我就从网上搜集各种方法,但是发现很多方法中是先在Windows上编译程序,然后再从Linux上编译程序,最后进行远程调试,这种方法使我的调试不能进入源代码,后来经过尝试发现只需要在Linux上编译程序即可.下面从三个方面:需要安装的软件.安装与配置.配置远程调试,来介绍一下我

Windows程序调试系列: 使用VC++生成调试信息 转

Windows程序调试系列: 使用VC++生成调试信息 ZhangTao,[email protected], 译自 “Generating debug information with Visual C++”,Oleg Starodumov 出处: http://www.cnblogs.com/itrust/archive/2006/08/17/479603.aspx 引子 当我们使用调试器来调试程序时,我们希望能够单步调试到源代码中,在代码中设置断点,观察变量的值(包括用户自定义的复杂类型的

windows程序员C/C++转向linux程序员时,如何编写、调试linux程序

windows程序员使用vs或windbg进行调试相当熟悉,转到linux下面,要进行程序的编写.调试,往往非常痛苦(或者说不习惯吧).目前可以找到的各种IDE或编辑软件相当多,我试过的有eclipse+cdt+gdb,codeblock+gdb,vi+cgdb,都是不太理想,时不时的想往vs上靠,一直还是有vs的情结. 某日,正在查找gdb如何显示当前进程加载的动态库时,查到了visualgdb中关于gdb的教程,此时猛然想起了visualgdb这个工具(原来在用visualddk的时候瞧见过

windows下使用MinGW的调试工具gdb.exe调试C程序

1.编译源代码 C:MinGW\bin>gcc.exe -g -o program.exe program.c 编译选项上要加上“g”,这样生成的目标程序会含有调试内容,再用gdb调试的时候才能使用.显然加上“g”选项生成的应用程序会比不加的大,但两者运行时没有差别. 2.启动调试 C:MinGW\bin>gdb.exe program.exe 3.设置断点并启动运行 (gdb)break main(gdb)start 不能直接start,因为程序运行太快了,直接start就运行到程序停止的地

windows下使用eclipse调试C程序

一.环境描述 Eclipse IDE for C/C++ Developers version 4.4.0 MinGW  gcc/g++ version 4.8.1;gdb version 7.6.1 二.操作步骤 1.新建工程 2.编译源程序 3.调试设置 Run-->Debug Configurations-->Debugger,设置调试器目标 4.启动调试 三.说明 windows下Eclipse调试C程序时,会出现无法使用printf和scanf的情况:console没有输出.原因是由

linux(ubuntu12.04)下手机真机调试eclipse上的android程序

模拟器太慢了,而且在模拟器上运行程序的效果毕竟还是跟在真机上有点区别的,所以建议大家尽量使用真机调试.把android手机通过usb线连接至电脑,之后步骤如下: 1. 在/etc/udev/rules.d/目录下新建一个51-android.rules文件,文件内容为: SUBSYSTEM == "usb",ENV{DEVTYPE} == "usb_device",MODE = "0666" 2.$ sudo chmod a+rx /etc/ud

IDEA调试服务器上部署的程序

提出问题: 一个程序,部署在自己的电脑上,debug调试,相信大家都会,但是,如果我想debug调试非本地部署的程序怎么办呢.比如测试服务器上部署的程序. 其实这样的需求也是经常有的,比如一个大型的项目有很多模块,也有很多自己的或外部的依赖,不可能在自己电脑上整个都搭建一整套完整的环境.先不管有多复杂,有时候公司的电脑配置再不给力,部署一个大型程序更是雪上加霜.通常这样的程序都是直接部署到专门的开发或测试环境里面.很少在自己电脑上部署测试.再加上运用像jenkins这样的自动化的部署工具,部署只

在Windows版本Docker上运行GUI程序

看到很多人在Docker问题区讨论:如何在OS X和Windows的Docker上运行GUI程序, 随手记录几个参考资料: https://github.com/docker/docker/issues/8710 http://sourceforge.net/projects/xming/ https://www.gitbook.com/book/yeasy/docker_practice/details