GDB+GDBService 嵌入式调式

使用buildroot编译对应的gdb for x86,gdbservice for arm: 确保各自平台和cpu的位数和程序的位数匹配

记得设置 host gdb这边要调试的程序的依赖库,如:

pakydu@SRVECT:~/works/E3_ok/source/utils/OneDay$ /opt/arm64_tool/bin/aarch64-buildroot-linux-gnu-gdb OneDay
GNU gdb (GDB) 8.2.1
Copyright (C) 2018 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=x86_64-pc-linux-gnu --target=aarch64-buildroot-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from OneDay...done.
(gdb) target remote 10.161.93.10:2001
Remote debugging using 10.161.93.10:2001
Reading /lib/ld-linux-armhf.so.3 from remote target...
warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
Reading /lib/ld-linux-armhf.so.3 from remote target...
Reading symbols from target:/lib/ld-linux-armhf.so.3...(no debugging symbols found)...done.
0xf7fbea00 in ?? () from target:/lib/ld-linux-armhf.so.3
(gdb) set solib-absolute-prefix  /home/pakydu/works/E3_ok/rootfs_arm64-full/rootfs_partition_unstripped/:/home/pakydu/works/E3_ok/rootfs_arm64-full/rootfs_partition_unstripped/usr/lib/
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
(gdb) l

GDB的相关参考:

原来gdb的底层调试原理这么简单 - 知乎

一文带你看透 GDB 的 实现原理 -- ptrace真香_z_stand的博客-CSDN博客_ptrace修改内存

GDB 实现原理介绍 | 始于珞尘

Linux下core文件产生的一些注意问题-阿里云开发者社区

如何获取运行时进程堆栈

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值