Android使用gdb调试native程序
2013-08-02 16:01
411 查看
1、push gdbserver到手机,并修改为可执行权限。
adb shell push gdbserver /system/bin/
adb shell chmod 777 /system/bin/gdbserver
2、得到进程号并attact上进程。
adb shell ps |grep system_server
adb shell gdbserver :1234 --attach 658
3、启动并设置gdb
shell adb forward tcp:1234 tcp:1234
target remote localhost:1234
file out/target/product/msm8960/symbols/system/bin/app_process
set solib-absolute-prefix android/out/target/product/generic/symbols/
set solib-search-path android/out/target/product/generic/symbols/system/lib
调试进程。
注意:
C++在类的方法里面设置断点的方式是b namespace::class::method,可使用nm命令查看方法。
Reference:
http://mogoweb.net/archives/309
https://github.com/keesj/gomo/wiki/AndroidGdbDebugging
http://blog.chinaunix.net/uid-12567959-id-3214283.html
adb shell push gdbserver /system/bin/
adb shell chmod 777 /system/bin/gdbserver
2、得到进程号并attact上进程。
adb shell ps |grep system_server
adb shell gdbserver :1234 --attach 658
3、启动并设置gdb
shell adb forward tcp:1234 tcp:1234
target remote localhost:1234
file out/target/product/msm8960/symbols/system/bin/app_process
set solib-absolute-prefix android/out/target/product/generic/symbols/
set solib-search-path android/out/target/product/generic/symbols/system/lib
调试进程。
注意:
C++在类的方法里面设置断点的方式是b namespace::class::method,可使用nm命令查看方法。
Reference:
http://mogoweb.net/archives/309
https://github.com/keesj/gomo/wiki/AndroidGdbDebugging
http://blog.chinaunix.net/uid-12567959-id-3214283.html
相关文章推荐
- Ubuntu下使用gdb远程调试android native程序笔记
- 使用ndk-gdb调试android native程序
- 用android自带的gdb与gdbserver调试native C/C++程序
- 如何使用arm-eabi-gdb调试android c/c++程序
- 使用GDB调试Android NDK native(C/C++)程序
- Eclispe+CDT+gdb调试android ndk程序----包括CDT组件跟Sequoyah Android Native Code Support组件安装
- gdb 远程调试 android native 程序
- 用GDB远程调试android native程序
- 使用GDB调试Android NDK native(C/C++)程序
- Android使用ndk-gdb调试jni程序
- 使用gdb和gdbserver调试Android C/C++程序
- Android 系统中使用GDB调试C程序
- 使用GDB调试Android NDK native(C/C++)程序
- Android无源码调试Native代码(使用GDB)
- Android Native C程序使用GDBServer调试
- 使用GDB调试Android NDK native(C/C++)程序
- 使用GDB调试Android中的C/C++程序
- 如何使用arm-eabi-gdb调试android c/c++程序
- 使用GDB调试Android NDK native程序
- 使用GDB调试Android NDK native(C/C++)程序