gdbserver:目标描述指定未知架构“aarch64”

use*_*154 6 debugging arm gdbserver

我尝试远程使用 gdbserver 进行调试,如下所示

在目标机器上启动 gdbserver

$ gdbserver localhost:2000 hello -l 20 -b 10 --enable-targets=all
Run Code Online (Sandbox Code Playgroud)

主机具有启用调试的程序二进制文件

"copied binary from ARM target to host" 
Run Code Online (Sandbox Code Playgroud)

在主机上运行 gdb

$ gdb -q --args hello --enable-target=all
Run Code Online (Sandbox Code Playgroud)

连接到目标

(gdb) target remote 192.168.15.132
192.168.15.132: No such file or directory.
(gdb) target remote 192.168.15.132:2000
Remote debugging using 192.168.15.132:2000
warning: while parsing target description (at line 11): Target description specified unknown architecture "aarch64"
warning: Could not load XML target description; ignoring
Remote register badly formatted: T051d:0000000000000000;1f:80fcffffffff0000;20:403cfdb7ffff0000;thread:pd60.d60;core:1;
here: 00000000;1f:80fcffffffff0000;20:403cfdb7ffff0000;thread:pd60.d60;core:1;
(gdb) q
Run Code Online (Sandbox Code Playgroud)

我正在寻找正确调试 ARM 远程目标的建议。

Syf*_*ski 10

要调试的可执行文件编译为一个不同的体系结构,安装gdb-multiarch和运行gdb-multiarch代替gdb。不同的发行版以不同的方式编译 gdb,有些甚至在他们的存储库中缺少 multiarch 版本 - RHEL 不包含它,但它存在于 Ubuntu 和 Debian 中。


Fra*_*ant 1

由于您报告您的 GDB 支持以下架构: i386:x64-32 i386:x86-64:intel i386 i386:x64-32:intel i386:x86-64:nacl i386:intel i386:x64-32:nacl i8086 i386:nacl i386:x86-64,您可能正在尝试使用 gdb 的 x86_64 目标版本远程调试 aarch64-linux-gnu 可执行文件。我建议下载/安装gcc-linaro-7.3.1 -2018.05-x86_64_aarch64-linux-gnu.tar.xz

wget https://releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz
tar Jxvf  gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz -C /opt
Run Code Online (Sandbox Code Playgroud)

然后用于/opt/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gdb远程调试您的程序。