add gdb target achitecture: aarch64

2.4k views Asked by At

I`m trying to debug android's Linux kernel. I can run gdbserver64 on the android device and connect to it with gdb on the host computer. However when i try to debug i receive this error:

(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;

Its pretty clear that the host gdb does not have aarch64. Is there a way to add architectures to gdb? I cant seem to find a way to.

2

There are 2 answers

1
Employed Russian On BEST ANSWER

Is there a way to add architectures to gdb?

Yes: configure it with --enable-targets=all.

0
Siklab.ph On

I had to build it from the 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>