insight是基于gdb的,所 以gdb需要的环境是一定要有的,新力德安装libx11-dev libncurses5-dev和libc6-dev这3个依赖文件,先安装好啊,不然等出错了再安装需要重新编译,麻烦死了。insight编译之前, 要修改下源码,就是修改默认的端口,否则会是1000不能改的,因为我用的是jlink,其端口2331是不能修改的,所以只有修改gdb的端口了,找到 /gdb/gdbtk/libaray/targetselection.itb ,查找1000,将其修改为2331(jlink端口)这里还需要注意一点,如果你跟我一样一定要修改insight端口,一定要看仔细了,这是 insight第一次编译安装,如果你以前安装过又删除了,再按照我这样修改编译安装 是不会有效的,除非你保证卸载的非常干净(其实源码make uninstall啥都没有写),否则,你得重新安装系统了!
软件的安装
1. tar jxvf insight-6.8-1.tar.bz2
2. cd insight-6.8-1
3. ./configure --prefix=/usr/local/insight --target=arm-linux
4. make
编译很久产生错误
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
解决方法: vi gdb/Makefile 搜索-Werror
老代码
WERROR_CFLAGS = -Werror
修改为新代码
WERROR_CFLAGS = #-Werror
接着继续 sudo make
5. make install
最后添加其路径到系统中去,修改/etc/environment 添加/usr/local/insight/bin. 更新下此文件 source /etc/environment
6.然后就是编译出gdbserver了,
cd ~/gdb-6.8/gdb/gdbserver
$ ./configure --target=arm-linux --host=arm-linux
cd ~/gdb-6.8/gdb/gdbserver
$ make CC=arm-linux-gcc 指定编译器,也可以直接指定路径
这样在gdb-6.8/gdb/gdbserver目录下就生成了一个gdbserver可执行文件,复制到开发板系统(嵌入式linux)的/bin下
7.Insight工具的使用
主机上运行: arm-linux-insight
目标板上运行: gdbserver Host IP:Port myapp -qws
部分问题解决:
l1、inux-arm-low.c:37:21: error: sys/reg.h: No such file or directory
转自:http://blog.csdn.net/shopping988/archive/2010/12/21/6090170.aspx
参考:http://hi.baidu.com/zjsxycli/blog/item/99863fddf1be55196227986e.html
参考:http://blogold.chinaunix.net/u3/110913/showart_2493386.html