linux使用---15.源码编译insight及使用

来源:互联网 发布:c语言1.0f 编辑:程序博客网 时间:2024/06/15 21:01
 linux使用---15.源码编译insight及使用 2016-06-30 18:51:37

分类: LINUX

1.下载insight的源码
http://sourceware.org/insight/downloads.php
下载insight-6.8-1a.tar.bz2
2.ubuntu14.04下编译出错及解决
  1. a.出错1 
  2. bfd.texinfo:326: unknown command `colophon'
  3. bfd.texinfo:337: unknown command `cygnus'
  4. 查到了这个文章:http://permalink.gmane.org/gmane.linux.lfs.devel/13912
  5. sed --'s/ <at> colophon/ <at> <at> colophon/' \
  6.  -'s/doc <at> cygnus.com/doc <at> <at> cygnus.com/' bfd/doc/bfd.texinfo
  7.  竟然是!!
  8. 正确的是这个:  
  9.  sed --'s/@colophon/@@colophon/' \
  10.        -'s/doc@cygnus.com/doc@@cygnus.com/' bfd/doc/bfd.texinfo

  11. b.出错2
  12. ./elf.texi:11: raising the section level of @subsubsection which is too low
  13. cong@msi:/work/ffmpeg/insight/insight-6.8-1$ cp bfd/doc/elf.texi bfd/doc/elf.texi_bak
  14. cong@msi:/work/ffmpeg/insight/insight-6.8-1$ sed -'s/subsubsection/subsection/' ./bfd/doc/elf.texi
  15. 这就是一个拼写错误,我承认是瞎蒙的,但是可以编过去了。

  16. c.出错3
  17. elf64-x86-64.c:2364:16: error: variable 'warned' set but not used [-Werror=unused-but-set-variablebfd_boolean warned;
  18. cong@msi:/work/ffmpeg/insight/insight-6.8-1$ ./configure --disable-werror

  19. d.出错4
  20. linux-nat.h:63:18: error: field ‘siginfo’ has incomplete type struct siginfo siginfo;
  21.                   ^
  22. In file included from linux-nat.c:32:0:
  23. linux-nat.h:63:18: error: field ‘siginfo’ has incomplete type
  24.    struct siginfo siginfo;
  25. 解决方法: 把所有的 struct siginfo替换为 struct siginfo_t, 脚本如下:
  26. #!/bin/sh
  27. for c_file in `find . -name '*.c' --name '*.h'`
  28. do
  29.     sed -'s/struct siginfo/siginfo_t/' $c_file
  30. done
3. 使用insight
3.1 调试时报错
  1. 直接insight ./hello时会报错:
  2. wrong version in compilation unit header (is 4, should be 2) 
  3. 这需要在被调试的程序的Makefile加上:
  4. CFLAGS+= -gdwarf--gstrict-dwarf
  5. 参考: http://ju.outofmemory.cn/entry/94917
3.2 TMD还有问题
  1. cong@msi:/work/ffmpeg/test/jpeg/jpeg6b$ insight ./mytest
  2. BFD: /lib/x86_64-linux-gnu/libc.so.6: invalid relocation type 37
  3. BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail elf64-x86-64.c:278
  4. BFD: /lib/x86_64-linux-gnu/libc.so.6: invalid relocation type 37
  5. BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail elf64-x86-64.c:278
  6. BFD: /lib/x86_64-linux-gnu/libc.so.6: invalid relocation type 37
  7. BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail elf64-x86-64.c:278
  8. BFD: /lib/x86_64-linux-gnu/libc.so.6: invalid relocation type 37
  9. BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail elf64-x86-64.c:278
  10. BFD: /lib/x86_64-linux-gnu/libc.so.6: invalid relocation type 37
  11. BFD: BFD (GNU Binutils) 2.18.50.20080226 assertion fail elf64-x86-64.c:278
  12. next
重新编译gdb也解决不了。算了,放弃了,世上无难事,只要肯放弃。换DDD或cgdb了。

0 0