ubuntu10.x 安装gdb insight

操作系统:ubuntu11.04

安装包:insight.6.8-1.tar.bz2

下载地址:ftp://sourceware.org/pub/insight/releases/

安装步骤:

1. sudo tarjxvf insight.6.8-1.tar.bz2

2.sudo ./configure--prefix=/usr/local/arm/arm-linux-insight--target=arm-linux

3. sudomake

4. sudo makeinstall

出错解决:

1.关于i387-tdep.c的报错

解决:sudo vim./gdb/i386-linux-nat.c

         在#ifdef HAVE_SYS_REG_H
         #include <sys/reg.h>
         #endif

         后加入 #include "i387.tdep.h"

2.类似出错:linux-nat.c:2879:error:ignoringreturn value of 'fgets',declared with attributewarn_unused_result

解决:进入insight-6.8-1/gdb目录,打开Makefile文件搜索-Werror注释掉

(Can be set when configure:--enable-werror=no)

3. configure:error: no termcap library found

解决:缺乏termcap库文件,
sudo apt-getinstall libncurses5-dev

4.安装完毕后,运行出错
yc200@yc200:~/Desktop/insight-6.8$arm-linux-insight
Tk_Init failed:Can't find a usable tk.tcl in the followingdirectories:
/usr/local/arm/2.95.3/share/tk8.4/usr/local/arm/2.95.3/lib/tk8.4 /usr/local/arm/lib/tk8.4/usr/local/arm/2.95.3/library /usr/local/arm/library/usr/local/arm/tk8.4.1/library/usr/local/tk8.4.1/library

/usr/local/arm/2.95.3/share/tk8.4/tk.tcl:no event type or button # or keysym
no event typeor button # or keysym
whileexecuting
"bind Listbox<MouseWheel> {
%W yview scroll[expr {- (%D / 120) * 4}] units
}"
(file"/usr/local/arm/2.95.3/share/tk8.4/listbox.tcl" line182)
invoked fromwithin
"source/usr/local/arm/2.95.3/share/tk8.4/listbox.tcl"
(in namespaceeval "::" script line 1)
invoked fromwithin
"namespace eval:: [list source [file join $::tk_library$file.tcl]]"
(procedure"SourceLibFile" line 2)
invoked fromwithin
"SourceLibFilelistbox"
(in namespaceeval "::tk" script line 4)
invoked fromwithin
"namespace eval::tk {
SourceLibFilebutton
SourceLibFileentry
SourceLibFilelistbox
SourceLibFilemenu
SourceLibFilepanedwindow
SourceLibFile..."
invoked fromwithin
"if{$::tk_library ne ""} {
if {[stringequal $tcl_platform(platform) "macintosh"]} {
proc::tk::SourceLibFile {file} {
if {[catch{
namesp..."
(file"/usr/local/arm/2.95.3/share/tk8.4/tk.tcl" line393)
invoked fromwithin
"source/usr/local/arm/2.95.3/share/tk8.4/tk.tcl"
("uplevel" bodyline 1)
invoked fromwithin
"uplevel #0[list source $file]"


This probablymeans that tk wasn't installed properly.
解决办法:
编译insight-6.8前必须修改insight-6.8的源代码。
1)修改insight-6.8/tk/generic/tk.h
将(line653)
#defineVirtualEvent (LASTEvent)
#defineActivateNotify (LASTEvent + 1)
#defineDeactivateNotify (LASTEvent + 2)
#defineMouseWheelEvent (LASTEvent + 3)
#defineTK_LASTEVENT (LASTEvent + 4)
改为:
#defineVirtualEvent (MappingNotify)
#defineActivateNotify (MappingNotify + 1)
#defineDeactivateNotify (MappingNotify + 2)
#defineMouseWheelEvent (MappingNotify + 3)
#defineTK_LASTEVENT (MappingNotify + 4)
并将随后的#defineTK_LASTEVENT (LASTEvent + 4)删除(line 661附近)
2)修改insight-6.8/tk/generic/tkBind.c
在line 586和line587之间增加
#ifdefGenericEvent
0,
#endif


/

 

错误信息:

qiang@LinuxSir:~$ sudo arm-elf-insight
Tk_Init failed: Can't find a usable tk.tcl in the followingdirectories:
   /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

/usr/local/share/tk8.4/tk.tcl: no event type or button # orkeysym
no event type or button # or keysym
    whileexecuting
"bind Listbox <MouseWheel> {
    %W yviewscroll [expr {- (%D / 120) * 4}] units
}"
    (file"/usr/local/share/tk8.4/listbox.tcl" line 182)
    invoked fromwithin
"source /usr/local/share/tk8.4/listbox.tcl"
    (innamespace eval "::" script line 1)
    invoked fromwithin
"namespace eval :: [list source [file join $::tk_library$file.tcl]]"
    (procedure"SourceLibFile" line 2)
    invoked fromwithin
"SourceLibFile listbox"
    (innamespace eval "::tk" script line 4)
    invoked fromwithin
"namespace eval ::tk {
   SourceLibFile button
   SourceLibFile entry
   SourceLibFile listbox
   SourceLibFile menu
   SourceLibFile panedwindow
   SourceLibFile ..."
    invoked fromwithin
"if {$::tk_library ne ""} {
    if {[stringequal $tcl_platform(platform) "macintosh"]} {
    proc::tk::SourceLibFile {file} {
       if {[catch{
      namesp..."
    (file"/usr/local/share/tk8.4/tk.tcl" line 393)
    invoked fromwithin
"source /usr/local/share/tk8.4/tk.tcl"
    ("uplevel"body line 1)
    invoked fromwithin
"uplevel #0 [list source $file]"


This probably means that tk wasn't installed properly.

编译insight-6.8前必须修改insight-6.8的源代码。
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

经测试,已经可以正常启动arm-linux-insight


补充一下:我安装的tk8.5和tcl8.5

 


 

错误:

cc1: warnings being treated as errors
.././gdb/cli/cli-cmds.c: In function ‘pwd_command’:
.././gdb/cli/cli-cmds.c:323: error: ignoring return value of‘getcwd’, declared with attribute warn_unused_result
make[2]: *** [cli-cmds.o] 错误 1
make[2]:正在离开目录 `/home/qiang/tools/insight-6.8-1/gdb'
make[1]: *** [all-gdb] 错误 2
make[1]:正在离开目录 `/home/qiang/tools/insight-6.8-1'
make: *** [all] 错误 2

解决方案:

方法1.修改源代码,
linux-nat.c:2879:error:ignoring return value of 'fgets',declaredwith attribute warn_unused_result

老代码
fgets(buffer, MAXPATHLEN, procfile);
解决的方法是
char* temp_p = fgets(buffer, MAXPATHLEN, procfile);

类似的问题还有几个,基本上都是gdb的问题,照着解决就行了,我就不一个个说了。

方法2.进入insight-6.8-1/gdb目录,打开Makefile文件搜索-Werror
老代码
WERROR_CFLAGS = -Werror
新代码
WERROR_CFLAGS = #-Werror

这2个办法都可以通过编译,就可以使用insight了。

/

 

下载地址:ftp://sourceware.org/pub/insight/releases/

1.configure:error: no termcap library found

解决:缺乏termcap库文件,
sudo apt-getinstall libncurses5-dev

2.类似出错:linux-nat.c:2879:error:ignoringreturn value of 'fgets',declared with attributewarn_unused_result

解决:进入insight-6.8-1/gdb目录,打开Makefile文件搜索-Werror注释掉

3.

1)修改insight-6.8/tk/generic/tk.h
将(line653)
#defineVirtualEvent (LASTEvent)
#defineActivateNotify (LASTEvent + 1)
#defineDeactivateNotify (LASTEvent + 2)
#defineMouseWheelEvent (LASTEvent + 3)
#defineTK_LASTEVENT (LASTEvent + 4)
改为:
#defineVirtualEvent (MappingNotify)
#defineActivateNotify (MappingNotify + 1)
#defineDeactivateNotify (MappingNotify + 2)
#defineMouseWheelEvent (MappingNotify + 3)
#defineTK_LASTEVENT (MappingNotify + 4)
并将随后的#defineTK_LASTEVENT (LASTEvent + 4)删除(line 661附近)
2)修改insight-6.8/tk/generic/tkBind.c
在line 586和line587之间增加
#ifdefGenericEvent
 

否则运行会报错:

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

/usr/local/arm/2.95.3/share/tk8.4/tk.tcl:no event type or button # or keysym
no event typeor button # or keysym
whileexecuting
"bind Listbox<MouseWheel> {
%W yview scroll[expr {- (%D / 120) * 4}] units
}"
(file"/usr/local/arm/2.95.3/share/tk8.4/listbox.tcl" line182)
invoked fromwithin
"source/usr/local/arm/2.95.3/share/tk8.4/listbox.tcl"
(in namespaceeval "::" script line 1)
invoked fromwithin
"namespace eval:: [list source [file join $::tk_library$file.tcl]]"
(procedure"SourceLibFile" line 2)
invoked fromwithin
"SourceLibFilelistbox"
(in namespaceeval "::tk" script line 4)
invoked fromwithin
"namespace eval::tk {
SourceLibFilebutton
SourceLibFileentry
SourceLibFilelistbox
SourceLibFilemenu
SourceLibFilepanedwindow
SourceLibFile..."
invoked fromwithin
"if{$::tk_library ne ""} {
if {[stringequal $tcl_platform(platform) "macintosh"]} {
proc::tk::SourceLibFile {file} {
if {[catch{
namesp..."
(file"/usr/local/arm/2.95.3/share/tk8.4/tk.tcl" line393)
invoked fromwithin
"source/usr/local/arm/2.95.3/share/tk8.4/tk.tcl"
("uplevel" bodyline 1)
invoked fromwithin
"uplevel #0[list source $file]"


====

http://blog.sina.com.cn/s/blog_6e228288010118yo.html

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值