免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1588 | 回复: 0
打印 上一主题 下一主题

vmware debug kernel [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-10-31 16:10 |只看该作者 |倒序浏览

     
        
         
Debugging Linux kernels with Workstation 6.0
        
     
      
   
   
   
      We
just quietly added an exciting feature to Workstation 6.0. I believe it
will make WS6 a great tool for Linux kernel development. You can now
use gdb on your host to debug the Linux kernel running inside the VM.
No kdb, no recompiling and no need for second machine. All you need is
a single line in VM's configuration file.
To use the new feature, grab the latest build of Workstation
here
, or free 30-day evaluation
here
. Put this line into configuration file of your Linux VM:
    debugStub.listen.guest32=1
Now
whenever you run the virtual machine, you'll see the following in the
vmware.log file (debug builds will also print this message to Host
console):
    VMware Workstation is listening for debug connection on port 8832.
Run gdb on the Host, reference it to the kernel with symbols and attach to the virtual machine:
    % gdb
(gdb) file vmlinux-2.4.21-27.EL.debug
(gdb) target remote localhost:8832
That's
it. The VM is blocked now, so you can "continue" it and "^C" back to
gdb. Breakpoints, single step, memory inspection - all this works as
usual. If you have SMP VM, then each VCPU is mapped on a thread, so use
"info threads" and "thread NN" to switch between them.
Debugging the 64-bit kernel works in the same way, except you need to use a different option:
    debugStub.listen.guest64=1
and
connect to port 8864. Since gdb starts in 32-bit mode by default, you
may also need to switch it to i386:x64-64 before connecting:
(gdb) set architecture i386:x86-64
(gdb) target remote localhost:8864
The
kernels with symbols are sadly lacking on most distributions, but if
you use RHEL then this website may help (look for kernel-debuginfo rpm):
    http://people.redhat.com/duffy/debuginfo/index-js.html
The
gdb support in WS6 is experimental, so there may be rough edges here
and there. Please post on community forums if something doesn't work
right or if you have a suggestion:
   
http://communities.vmware.com/community/vmtn/general/guestdebugmonitor
There
are more debugging specific features in WS6 (for example, you can use
gdb hand-in-hand with Record/Replay!). I will describe them shortly.
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/40232/showart_411604.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP