====== Android上如何用arm-eabi-gdb调试程序 ====== 参考:http://blog.csdn.net/sanlinux/archive/2010/07/10/5725557.aspx ===== 1.安装gdbserver到模拟器 ===== adb push gdbserver /system/bin 或者 adb push gdbserver /data/ adb shell chmod 777 /data/gdbserver ===== 2.运行gdbserver ===== adb shell cd /data gdbserver 10.0.2.2:1234 /data/hello 或者gdbserver :1234 /data/hello 其中hello是需要調試的程序 ===== 3.用telnet設置端口轉發 ===== telnet localhost 5554 redir add tcp:1234:1234 ===== 4. arm-eabi-gdb 調試程序 ===== arm-eabi-gdb hello (gdb) r Starting program: Don't know how to run. Try "help target". (gdb) target remote localhost:1234 之後連接上了就和一般的gdb調試一樣了。 ===== ndk-gdb调试 ===== - http://www.devdiv.com/article-1431-1.html - http://vilimpoc.org/blog/2010/09/23/hello-gdbserver-a-debuggable-jni-example-for-android/ 添加Symbols命令: add-symbol-file /cygdrive/d/workspace/DDTui/libs/armeabi/libslpi.so