0%

gdb远程调试android虚拟机的c程序

  • 远程开启gdbservice
1
2
adb shell
gdbserver 10.0.2.2:1233 /system/exp

10.0.2.2为android虚拟机的默认地址

  • 开启端口映射
1
2
3
telnet localhost 5554
auth
redir add tcp:1233:1233
  • gdb远程调试exp
1
2
gdb ./exp
target remote :1233
  • ubuntu交叉编译c
1
2
sudo apt-get install gcc-arm-linux-androideabi
arm-linux-androideabi-gcc --sysroot=/opt/android/android-ndk-r9c/platforms/android-19/arch-arm -o test lin.c