免费注册 查看新帖 |

Chinaunix

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

使用Clewn连接gvim和gdb [复制链接]

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

                   Clewn是一个把gvim和gdb连接起来的工具,使得在调试时代码可以显示在gvim中,得到类似在IDE中的效果。使用Clewn不需要修改vim
源代码。另外一个把vim和gdb结合起来的工具:vimgdb则需要修改vim源代码,并重新编译vim。但是Clewn必须需要有GUI的
gvim,vimgdb则在gvim和vim中都可以达到效果。
使用Clewn一般步骤如下:
               
               
                $clewn -va
your_source.cpp
此时进入gdb命令行界面,并且gvim自动打开your_source.cpp文件。
(gdb)file your_execute
获得要调试文件的symbols
然后就可以在(gdb)中使用b main等命令设置断点。也可以在gvim中使用ctrl+b来设置断点(第一次设断点的时候ctrl+b要按两下才有效,不知道是不是bug)。
clewn在gvim中设置的快捷键:
List of default key mappings:
    CTRL-Z  send an interrupt to GDB and the program it is running
    B       info breakpoints
    L       info locals
    A       info args
    S       step
    I       stepi
    CTRL-N  next: next source line, skipping all function calls
    X       nexti
    F       finish
    R       run
    Q       quit
    C       continue
    W       where
    CTRL-U  up: go up one frame
    CTRL-D  down: go down one frame
cursor position:
    CTRL-B  set a breakpoint on the line where the cursor is located
    CTRL-E  clear all breakpoints on the line where the cursor is located
mouse pointer position:
    CTRL-P  print the value of the variable defined by the mouse pointer
                position
    CTRL-X  print the value that is referenced by the address whose
                value is that of the variable defined by the mouse pointer
                position
    CTRL-K  set a breakpoint at assembly address shown by mouse position
    CTRL-H  clear a breakpoint at assembly address shown by mouse position
    CTRL-J  add the selected variable at mouse position to the watched
                variables window
               
               

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

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP