arm-linux-gdb+gdbserver环境搭建以及远程调试
来源:互联网 发布:手机淘宝怎么搜索达人 编辑:程序博客网 时间:2024/04/28 23:14
0) gdb源码下载:http://ftp.gnu.org/gnu/gdb/
1) 编译arm-linux-gdb
指定交叉编译工具链的位置
export PATH=$PATH:/usr/local/arm/3.4.1/bin
开始配置和编译
$cd gdb-6.6
$./configure --target=arm-linux --prefix=/usr/local/arm/gdb -v
$make
中间会出现一些地方编译过去,如
gdb declared with attribute warn_unused_result
检查了下,发现是由于检查太严格了,把 Makefile 里面 -Wall 类似的强制警告检查都去掉就可以过了
2) 编译gdbserver
$cd gdb/gdbserver
$./configure --target=arm-linux --host=arm-linux
target含义同前,host指明编译生成的gdbserver运行在arm-linux上,前者没有设定host的原因是
arm-linux-gdb是在pc linux上运行的,就像arm-linux-gcc (很好理解的:))
$make CC=/usr/local/arm/3.4.1/bin/arm-linux-gcc
#gdbserver 192.168.1.200:7777 test
Process test created; pid
Listening on port 7777
主机shell下
$cd ~/tftpboot
$arm-linux-gdb test
GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-linux"...
(gdb)
注意一下显示信息的最后--host=i686-pc-linux-gnu --target=arm-linux,明白了吧。。。
target remote 192.168.1.168:7777 --连接gdbserver
Remote debugging using 192.168.1.168:7777
0x40000dd0 in _start () from /lib/ld-linux.so.2
表示连接上了服务器,:),接下来就可以调试了。arm-linux-gdb和GDB的用法一样,只是没有r这个命
令,运行程序用c命令。
(gdb) l
1 #include<stdio.h>
2
3 int main()
4 {
5 char *ptr = "csdn";
6 printf("%c/n",*(ptr++));
7 return 0;
8 }
(gdb) b 3
Breakpoint 1 at 0x83d0: file test.c, line 3.
另外由于程序是在目标板上运行,调试是在PC下,程序的结果还是会在目标板上显示的,
例如:minicom,lcd等。
btw,附近一篇介绍GDB使用的文章:http://blog.csdn.net/haoel/archive/2003/07.aspx,这下全了吧。哈
- arm-linux-gdb+gdbserver环境搭建以及远程调试
- arm-linux-gdb+gdbserver环境搭建以及远程调试
- arm-linux-gdb+gdbserver环境搭建以及远程调试 及调试core文件
- arm-linux-gdb+gdbserver环境搭建以及远程调试 及调试core文件
- 搭建交叉调试环境arm-linux-gdb与gdbserver
- 搭建交叉调试环境arm-linux-gdb与gdbserver
- 搭建交叉调试环境arm-linux-gdb与gdbserver
- 搭建交叉调试环境 arm-linux-gdb配合gdbserver
- GDB+Gdbserver ARM远程调试
- 基于hisilicon的arm平台搭建gdb+gdbserver调试环境
- 基于hisilicon的arm平台搭建gdb+gdbserver调试环境
- 使用gdb、gdbserver在ARM-Linux下进行远程调试
- 使用gdb、gdbserver在ARM-Linux下进行远程调试
- 嵌入式arm linux环境中gdb+gdbserver调试
- 嵌入式arm linux环境中gdb+gdbserver调试
- 嵌入式arm linux环境中gdb+gdbserver调试
- Insight 和 gdbserver 搭建ARM远程调试环境
- arm远程调试 gdb和gdbserver
- 黑马程序员--多线程
- cocos2d-x中定时器的使用
- php5.3.26在mac os x 10.8.5下的 memcached.so 扩展文件
- 《S3C2440A时钟体系小结》
- V4L2驱动程序架构
- arm-linux-gdb+gdbserver环境搭建以及远程调试
- 直接拿来用!超实用的Java数组技巧攻略
- 求解1-n之间的素数
- Android 对话框(Dialog)大全 建立你自己的对话框
- 一个异或加密方案--C语言实现
- 在Windows下利用PowerShell脚本定时删除过期文件
- HDU 4753 Two Rabbits(区间DP)
- sql上一个月和下一个月
- MSP430单片机学习前必须知道的