I'm playing around with the code from the "Embedded Programming with Android: Bringing Up an Android System from Scratch" book. The Android versions meant in the book are a bit outdated, like 4.4, so I decided to use the current ones. My setup is:
- Debian 11
- emulator 31.2.10
- android 24/armeabi-v7a system image
- gcc-arm-none-eabi (15:8-2019-q3-1) for compiling the sources
- gdb-multiarch(10.1.90)/arm-none-eabi-gdb (10.3-2021.10) for debugging
Emulator command is emulator -verbose -show-kernel -netfast -avd avd_name -shell -qemu -s -S -kernel test_binary.axf
The problem is that the both GDB versions (gdb-multiarch set to arm, armv7 or whatever and arm-none-eabi-gdb) fail to attach to the running emulator.
So, the target remote localhost:1234 command fails with the following error message:
warning: while parsing target description (at line 1): Could not load XML document "arm-core.xml"
warning: Could not load XML target description; ignoring
Truncated register 16 in remote 'g' packet
Why this error happens (given the latest, quite widely used tools and no special setup it should work out of the box)? Is there any additional GDB or emulator/QEMU settings to tweak?
Can someone share a working configuration for the emulator in ARM mode on x86_64?
EDIT: Also the following error happens: qemu-system-armel: error while loading state for instance 0x0 of device 'goldfish_pipe'. Installing previous emulator versions doesn't seem to help.