看到了insight這個軟件,linux下gdb的前端工具,於是希望試用一下。我的系統centos6.4 x86.
1.下載insight ,解壓,編譯
# tar jxvf insight-6.8-1a.tar.bz2
# cd insight-6.8
# ./configure
# make
2.期間碰到錯誤
eval.c: 在函數‘evaluate_subexp_standard’中:
eval.c:1705: 錯誤:此函數中的‘subscript_array’在使用前可能未初始化
修改gdb/eval.c第1644行爲
int subscript_array[MAX_FORTRAN_DIMS] = {0};
再重新make
編譯後
make install
安裝成功
3輸入insight,報錯
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
看提示,找不到tk.tcl,那安裝試試
yum install tk
發現
Package 1:tk-8.5.7-5.el6.i686 already installed and latest version
難道是版本不對?
又發現一篇好文
參考 gdb與可視化gdb工具insight
https://blog.csdn.net/ljh081231/article/details/17354431
找到了解決方法
(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
#}
————————————————
版權聲明:本文爲CSDN博主「ljh081231」的原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/ljh081231/article/details/17354431
經過修改,終於可以啓動了。
4啓動之後發現設置了target一次,之後就沒法修改了,輸入不了字符。
參考這篇文章arm-linux-insight啓動後無法更改target設置解決方法 http://www.linuxdiyf.com/view_418406.html
insight啓動後會在當前用戶主目錄執行.gdbtkinit這個文件,裏面保存了很多配置信息
我直接修改了這個文件裏的配置。