Debug ARM NEON for Android NDK

The NDK (Android Native Development Kit) for ARM comes with gcc and GNU utils software, including older GDB. However, GDB does not seem to be able to show the contents of the registers in the VFP or NEON SIMD extensions, that is, when debugging a program using NEON / VFP instructions, only a subset of the registers is displayed. I believe that a newer version of GDB is required to get this ability. The equipment used supports NEON.

That's true, I need a new gdb, but how can the NDK sent by GDB to Google Gogs not do this?

Is there a built-in GDB for debugging VFP / NEON code on ARM Android devices or a procedure for creating an NDK toolchain with GDB enabled that can do this? (for 64-bit Windows / Linux host)

+4
source share
2 answers

Android NDK (tested on r8) comes with old gdb and gdbserver (v6.6), which does not support NEON. To use it, you can build either build it from gdb sources, or Android patches, or get a pre-built one:

  • Download the finished gdb 7.4.1 for the Android archive
  • Open the (NDK) \ toolchains \ arm-linux-androideabi-4.4.3 \ prebuilt \ windows \ bin directory
  • Rename arm-linux-androideabi-gdb.exe to arm-linux-androideabi-gdb-OLD.exe
  • Copy the new gdb.exe file to the current folder.
  • Open the (NDK) \ toolchains \ arm-linux-androideabi-4.4.3 \ prebuilt directory .
  • Rename the gdbserver file to gdbserver_old
  • Copy the new gdbserver to the current folder
+3
source

It appears that the bundled NDK GDB cannot display NEON registers. This link on the ARM developer site implies this, stating that gdbserver, which ships with the DS5 package, adds this feature.

The gdbserver provided in DS-5 is based on the newer version of GNU gdbserver and provides additional multithreading capabilities, access to ARM NEON registers (when available), and improved stability

+2
source

Source: https://habr.com/ru/post/1402982/


All Articles