arm-linux下的多线程调试

本文介绍了如何在ARM-Linux环境下使用GDB进行多线程程序的调试,包括下载调试工具、建立调试环境、设置断点、查看线程信息以及常用调试命令的使用方法。
摘要由CSDN通过智能技术生成

gdb是UNIX及UNIX-like下的调试工具。在linux下开发的人一定不会陌生,在arm-linux下也有对应的调试版本。下面记录一下在工作中用到的一些在arm-linux下用gdb调试多线程的一些知识。

一、下载调试工具
工程中使用了arm-none-linux-gnueabi-gcc编译器,提供一个下载网站arm-none-linux-gnueabi-gcc
安转以后执行 arm-arago-linux-gnueabi-gdb -v即可查看版本信息和安转成功与否。

xxx@xxx-desktop:~/workdir/$ arm-arago-linux-gnueabi-gdb -v
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-linux --target=arm-arago-linux-gnueabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.

二、调试环境的建立
1、在下位机中输入:gdbserver 10.11.13.19:215 test.app

/mnt/test/ # gdbserver 10.11.13.19:215 test.app 
Process test.app created; pid = 817
Listening on port 215

其中10.11.13.19为主机的ip地址,215为连接的端口号,test.app为要调试的应用程序。成功以后下位机将会监听215端口。
2、在主机输入:arm-arago-linux-gnueabi-gdb test.app

xxx@xxx-desktop:~/workdir/$arm-arago-linux-gnueabi-gdb test.app
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you
  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值