gdb与可视化gdb工具insight


2) 解压缩

tar jvxf insight-6.8a.tar.bz2

3) 生成Makefile
./configure

4) 修改Makefile(注意是gdb目录下的,否则编译报错)
cd gdb #(进入insight下的gdb目录)
sudo gedit Makefile
找到WERROR_CFLAGS = -Werror,将其改为
WERROR_CFLAGS=#-Werror(这里也可以将‘=’后面的内容删除掉变成 WERROR_CFLGAS= )
保存退出
仍然回到insight目录
cd ..

5) 修改源码

如果这里直接开始编译,则会出现一个说tk.ctl文件找不到的错误:

Tk_Init failed: Can't find a usable tk.tcl in the following directories: 
    /usr/local/share/tk8.4 /usr/local/lib/tk8.4 /usr/lib/tk8.4 /usr/local/library /usr/library /usr/tk8.4.1/library /tk8.4.1/library

 

(1)修改insight-6.8/tk/generic/tk.h
将(line 653)
#define VirtualEvent (LASTEvent)
#define ActivateNotify (LASTEvent + 1)
#define DeactivateNotify (LASTEvent + 2)
#define MouseWheelEvent (LASTEvent + 3)
#define TK_LASTEVENT (LASTEvent + 4)
改为:
#define VirtualEvent (MappingNotify)
#define ActivateNotify (MappingNotify + 1)
#define DeactivateNotify (MappingNotify + 2)
#define MouseWheelEvent (MappingNotify + 3)
#define TK_LASTEVENT (MappingNotify + 4)
并将随后的#define TK_LASTEVENT (LASTEvent + 4)删除(line 661附近)
(2)修改insight-6.8/tk/generic/tkBind.c
在line 586和line 587之间增加
#ifdef GenericEvent
0,
#endif

tk8.4/library/listbox.tcl   註掉 lines 182-184
#bind Listbox <MouseWheel> {
#    %W yview scroll [expr {- (%D / 120) * 4}] units
#}
tk8.4/library/text.tcl       註掉 lines 461-463
#bind Text <MouseWheel> {
#    %W yview scroll [expr {- (%D / 120) * 4}] units
#}

你可能感兴趣的:(gdb与可视化gdb工具insight)