添加 gdb 目标架构:aarch64

add gdb target achitecture: aarch64

我正在尝试调试 android 的 Linux 内核。我可以在 android 设备上 运行 gdbserver64 并在主机上使用 gdb 连接到它。但是,当我尝试调试时,我收到此错误:

(gdb) target remote localhost:2345
Remote debugging using localhost:2345
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:50f8ffff7f000000;20:641cf5b77f000000;thread:p57c.57c;core:5;
here: 00000000;1f:50f8ffff7f000000;20:641cf5b77f000000;thread:p57c.57c;core:5;

很明显主机 gdb 没有 aarch64。有没有办法将体系结构添加到 gdb?我似乎找不到办法。

Is there a way to add architectures to gdb?

是:配置为--enable-targets=all

我必须从 gdb source code:

构建它
  1. cd gdb-10.1
  2. ./configure --target=aarch64-linux-android && make -j8 && sudo make install
  3. aarch64-linux-android-gdb
  4. set sysroot
  5. target remote <android-ip-address>:<port-number>