Last active
March 17, 2020 16:14
-
-
Save olivierlemoal/ba4e1c269b81e3376eac587faa8d2946 to your computer and use it in GitHub Desktop.
Cross debugging ARM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pacman -S qemu-arch-extra | |
yay -S gdb-multiarch | |
get ARM libs from http://mirror.archlinuxarm.org/armv7h/core/ and extract usr/ : | |
tar -xvpf glibc-2.30-3-armv7h.pkg.tar.xz usr | |
$ qemu-arm -L usr -g 12345 ./a.out & | |
$ gdb-multiarch ./a.out | |
(gdb) set arch arm | |
The target architecture is assumed to be mips | |
(gdb) set endian little | |
The target is assumed to be little endian | |
(gdb) set solib-absolute-prefix ./usr | |
(gdb) target remote localhost:12345 | |
Also we can put library in QEMU_LD_PREFIX default path (see qemu-arm --help) | |
mkdir /usr/gnemul | |
ln -s /home/olivier/libs_foreign/arm/usr qemu-arm | |
We don't need any more to specify (-L) library path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment