- 论坛徽章:
- 0
|
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中使用shift+s来设置断点。
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/83922/showart_1361190.html |
|