android gdb ndk so lib


1. adb root
手机需要rooted,并且开发者选项中设置adb可以获得root权限;
root access is disabled by system setting - enable in settings -> development options

2. ndk-build 设置
ndk-build NDK_DEBUG=1
V=1
Android.mk : LOCAL_CFLAGS := -g
(there should be gdb.setup gdbserver files under the libs/armeabi after ndk-build)..

3. adb shell
su
#am start -n com.xxx.xxx/.MainActivity
#ps |grep -i xxx
#gdbserver :5039 --attach your_process_id

4.
$adb forward tcp:5039 tcp:5039
$/Users/xxx/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/arm-linux-androideabi-gdb
5.
(from the libs/armeabi/gdb.setup file, get the following path)
(gdb)set solib-search-path /Users/xxxx/obj/local/armeabi-v7a
(gdb)directory /path/to/your/project's all source/directory
(gdb)target remote :5039
(gdb) bt full
(gdb) set logging on

references:
1. http://www.bobbog.com/archives/24
2. http://wiki.debian.org/HowToGetABacktrace
3. http://www.kandroid.org/online-pdk/guide/debugging_gdb.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值