Machine A: x86, cross-compile for armhf
Machine B: armhf
On Machine A, you create a program. Then you copy the program to Machine B.
On Machine B, you execute the program and boom fatal error, a core is generated.
The question is: on which machine should I use GDB to read the core file?
Answer: Machine A! But you need to install GDB for ARMHF!
Here are the steps (on Machine A):
Download GDB
wget http://ftp.gnu.org/gnu/gdb/gdb-7.8.tar.gzExtract
gunzip gdb-7.8.tar.gzGo to the folder
tar -xf gdb-7.8.tar
cd gdb-7.8/Build GDB
#ARMHFAnd that's it.
./configure --target=arm-linux-gnueabihf --prefix=/usr/arm-linux-gnueabihf CXX="arm-linux-gnueabi-g++"
#ARMEL
./configure --target=arm-linux-gnueabi --prefix=/usr/arm-linux-gnueabi CXX="arm-linux-gnueabi-g++"
make
make install
From Machine B, copy the core file in Machine A, and run this command:
/usr/arm-linux-gnueabihf/arm-linux-gnueabihf-gdb myProgram core
And that's it.
Note: I'm not sure if you really need to specify CXX when building GDB.