gdb non-stop/target-async remote debug

本文介绍了如何使用gdb进行Aarch64架构的远程调试,包括设置.gdbinit文件、连接到目标主机并调试./rservice程序的过程。步骤包括设置异步连接、跳过符号加载警告,并展示了使用infothread命令查看线程状态。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


## target 
/ # gdbserver    --multi           localhost:1234
Listening on port 1234
Remote debugging from host 10.213.0.8
Attached; pid = 379  <<<<<<<< gdb  client connect 







[lake@localhost]$ cat   ~/.gdbinit
set  target-async  1                ###  https://www.youtube.com/watch?v=SnouzHI9bis 
set  pagination  off
set  non-stop  on
target extended-remote IP_TARGET_BOARD:PORT_TARGET_BOARD_GDBSERVER   ## https://sourceware.org/gdb/current/onlinedocs/gdb/Connecting.html
attach 379 &
[lake@localhost]$

[lhu3@zch127bld08 recording]$aarch64-linux-gnu-gdb       ./rservice
GNU gdb (GDB) 7.10
Copyright (C) 2015 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-unknown-linux-gnu --target=aarch64-kreatv-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"...
[New Thread 379.379]
[New Thread 379.381]
Reading symbols from ./rservice...done.
(gdb) Reading /lib64/libpthread.so.0 from remote target...
warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
Reading /usr/lib64/libcrypto.so.1.0.0 from remote target...
..............
Reading /lib/ld-linux-aarch64.so.1 from remote target...

(gdb)
(gdb) info thread
  Id   Target Id         Frame
  2    Thread 379.381    (running)
* 1    Thread 379.379    (running)
(gdb)

 

 

Refer 
https://blog.youkuaiyun.com/zb872676223/article/details/37906091
https://blog.youkuaiyun.com/nirendao/article/details/103302950

https://sourceware.org/gdb/current/onlinedocs/gdb/Connecting.html

https://www.youtube.com/watch?v=SnouzHI9bis 

touch stamp-system-gdbinit touch stamp-syscalls make[5]: Leaving directory '/home/wsk/Desktop/riscv-gnu-toolchain/build/build-gdb-newlib/gdb/data-directory' make[4]: Leaving directory '/home/wsk/Desktop/riscv-gnu-toolchain/build/build-gdb-newlib/gdb' make[3]: Leaving directory '/home/wsk/Desktop/riscv-gnu-toolchain/build/build-gdb-newlib/gdb' make[2]: Leaving directory '/home/wsk/Desktop/riscv-gnu-toolchain/build/build-gdb-newlib' make[1]: Leaving directory '/home/wsk/Desktop/riscv-gnu-toolchain/build/build-gdb-newlib' make -C build-gdb-newlib install make[1]: Entering directory '/home/wsk/Desktop/riscv-gnu-toolchain/build/build-gdb-newlib' make[2]: Entering directory '/home/wsk/Desktop/riscv-gnu-toolchain/build/build-gdb-newlib' /bin/bash /home/wsk/Desktop/riscv-gnu-toolchain/build/../gdb/mkinstalldirs /opt/riscv /opt/riscv make[2]: Nothing to be done for 'install-target'. make[3]: Entering directory '/home/wsk/Desktop/riscv-gnu-toolchain/build/build-gdb-newlib/libsframe' make[3]: Entering directory '/home/wsk/Desktop/riscv-gnu-toolchain/build/build-gdb-newlib/etc' make[4]: Entering directory '/home/wsk/Desktop/riscv-gnu-toolchain/build/build-gdb-newlib/libsframe' make[4]: Entering directory '/home/wsk/Desktop/riscv-gnu-toolchain/build/build-gdb-newlib/etc' make[4]: Nothing to be done for 'install-exec-am'. make[4]: Nothing to be done for 'install-data-am'. make[4]: Leaving directory '/home/wsk/Desktop/riscv-gnu-toolchain/build/build-gdb-newlib/etc' make[3]: Leaving directory '/home/wsk/Desktop/riscv-gnu-toolchain/build/build-gdb-newlib/etc' /usr/bin/mkdir -p '/opt/riscv/share/info' make[3]: Entering directory '/home/wsk/Desktop/riscv-gnu-toolchain/build/build-gdb-newlib/intl' make[3]: Nothing to be done for 'install'. make[3]: Leaving directory '/home/wsk/Desktop/riscv-gnu-toolchain/build/build-gdb-newlib/intl' /usr/bin/install -c -m 644 ./doc/sframe-spec.info '/opt/riscv/share/info' /usr/bin/install: cannot remove '/opt/riscv/share/info/sframe-spec.info': Permi
最新发布
03-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值