1.下载insight的源码
http://sourceware.org/insight/downloads.php
下载insight-6.8-1a.tar.bz2
2.编译出错及解决
3. 使用insight
3.1 调试时报错
http://sourceware.org/insight/downloads.php
下载insight-6.8-1a.tar.bz2
2.编译出错及解决
- a.出错1
-
bfd.texinfo:326: unknown
command `colophon'
- bfd.texinfo:337: unknown command `cygnus'
- 查到了这个文章:http://permalink.gmane.org/gmane.linux.lfs.devel/13912
-
sed -i -e 's/ <at> colophon/ <at> <at> colophon/' \
-
-e 's/doc <at> cygnus.com/doc <at> <at> cygnus.com/' bfd/doc/bfd.texinfo
-
竟然是!!
- 正确的是这个:
-
sed -i -e 's/@colophon/@@colophon/' \
-
-e 's/doc@cygnus.com/doc@@cygnus.com/' bfd/doc/bfd.texinfo
-
- b.出错2
- ./elf.texi:11: raising the section level of @subsubsection which is too low
-
cong@msi:/work/ffmpeg/insight/insight-6.8-1$
cp bfd/doc/elf.texi bfd/doc/elf.texi_bak
-
cong@msi:/work/ffmpeg/insight/insight-6.8-1$
sed -i 's/subsubsection/subsection/' ./bfd/doc/elf.texi
- 这就是一个拼写错误,我承认是瞎蒙的,但是可以编过去了。
-
-
c.出错3
- elf64-x86-64.c:2364:16: error: variable 'warned' set but not used [-Werror=unused-but-set-variable] bfd_boolean warned;
-
cong@msi:/work/ffmpeg/insight/insight-6.8-1$ ./configure --disable-werror
-
- d.出错4
- linux-nat.h:63:18: error: field ‘siginfo’ has incomplete type struct siginfo siginfo;
-
^
-
In file included from linux-nat.c:32:0:
-
linux-nat.h:63:18: error: field
‘siginfo’ has incomplete type
-
struct siginfo siginfo;
- 解决方法: 把所有的 struct siginfo替换为 struct siginfo_t, 脚本如下:
-
#!/bin/sh
-
for c_file in `find . -name '*.c' -o -name '*.h'`
-
do
-
sed -i 's/struct
siginfo/siginfo_t/' $c_file
- done
3.1 调试时报错
-
直接insight ./hello时会报错:
-
wrong version in compilation unit header (is 4, should
be 2)
-
这需要在被调试的程序的Makefile加上:
-
CFLAGS+= -gdwarf-2 -gstrict-dwarf
- 参考: http://ju.outofmemory.cn/entry/94917
3.2 TMD还有问题
重新编译gdb也解决不了。算了,放弃了,世上无难事,只要肯放弃。换DDD或cgdb了。
-
cong@msi:/work/ffmpeg/test/jpeg/jpeg6b$
insight ./mytest
-
BFD: /lib/x86_64-linux-gnu/libc.so.6: invalid
relocation type 37
-
BFD: BFD (GNU Binutils) 2.18.50.20080226
assertion fail elf64-x86-64.c:278
-
BFD: /lib/x86_64-linux-gnu/libc.so.6: invalid
relocation type 37
-
BFD: BFD (GNU Binutils) 2.18.50.20080226
assertion fail elf64-x86-64.c:278
-
BFD: /lib/x86_64-linux-gnu/libc.so.6: invalid
relocation type 37
-
BFD: BFD (GNU Binutils) 2.18.50.20080226
assertion fail elf64-x86-64.c:278
-
BFD: /lib/x86_64-linux-gnu/libc.so.6: invalid
relocation type 37
-
BFD: BFD (GNU Binutils) 2.18.50.20080226
assertion fail elf64-x86-64.c:278
-
BFD: /lib/x86_64-linux-gnu/libc.so.6: invalid
relocation type 37
-
BFD: BFD (GNU Binutils) 2.18.50.20080226
assertion fail elf64-x86-64.c:278
- next