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
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:
.
Find the GDB manual and other documentation resources online at:
    .

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文件产生的一些注意问题-阿里云开发者社区

如何获取运行时进程堆栈

你可能感兴趣的:(技术分享,开源工作从Linux开始,linux)