sudo apt-get install qemu qemu-user qemu-user-static
sudo apt-get install gdb-multiarch
sudo apt-get install 'binfmt*'
$ sudo apt-get install libc6-mipsel-cross # For MIPS-EL
$ sudo apt-get install libc6-armhf-armel-cross # For ARM
$ sudo apt-get install gcc-4.4-mipsel-linux-gnu # For MIPS-EL on Ubuntu 14.04
$ sudo apt-get install gcc-mipsel-linux-gnu # For MIPS-EL on Ubuntu 16.04
$ sudo apt-get install gcc-arm-linux-gnueabihf # For ARM
$ sudo mkdir /etc/qemu-binfmt
$ sudo ln -s /usr/mipsel-linux-gnu /etc/qemu-binfmt/mipsel # MIPSEL
$ sudo ln -s /usr/arm-linux-gnueabihf /etc/qemu-binfmt/arm # ARM
qemu-mipsel -strace ./myelf
qemu-mipsel-static -strace ./myelf
$ qemu-mipsel -g 12345 ./a.out &
./qemu-mipsel-static -g 12345 /bin/httpd
The target architecture is assumed to be mips
The target is assumed to be little endian
(gdb) target remote localhost:12345
Remote debugging using localhost:12345
0x00408754 udhcp_checksum
0x00408884 get_raw_packet
0x004097f8 computeTCPChecksum