步骤

首先,编译生成的out/target/product/$project/symbols目录的如下文件放到您新建的symbols 文件夹下,目录结构保持一致:(symbols 例子)
symbols/system/lib/libbinder.so
symbols/system/lib/libandroid_runtime.so
symbols/system/lib/libutils.so
symbols/system/lib/libc.so
symbols/system/bin/app_process

然后把symbols 目录放到和coredump 存放一致的目录。

下面进行gdb 调试

1. 进入gdb 环境
如通过命令行进入 C:\Documents and Settings\mtk28119>arm-linux-androideabi-gdb

2. 转到coredump 存放的目录:
如 (gdb) cd D:\dd\coredump

3. 执行file 命令
如 (gdb) file symbols/system/bin/app_process
Reading symbols from D:\dd\coredump/symbols/system/bin/app_process...done.
4.执行set solib-serach-path
如 (gdb) set solib-search-path symbols/system/lib
5.执行core
如(gdb) core PROCESS_COREDUMP
6.执行 bt
如 (gdb) bt ,这样就可以打印出backtrace 出来了。

 

 

实测log

lumy1@linuxws15:~$ export PATH=$PATH:/home/lumy1/work/snoopy_dev2/sys/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin
lumy1@linuxws15:~$ arm-linux-androideabi-gdb count
GNU gdb (GDB) 7.3.1-gg2
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-linux-gnu --target=arm-linux-android".
For bug reporting instructions, please see:
...
Reading symbols from /home/lumy1/count...done.

WARNING: no debugging symbols found in /home/lumy1/count.
Either the binary was compiled without debugging information
or the debugging information was removed (e.g., with strip or strip -g).
Debugger capabilities will be very limited.
For further information: http://wiki/Main/GdbFaq#No_debugging_symbols_found

(gdb) set solib-search-path /home/lumy1/work/snoopy_dev2/sys/out/target/product/snoopy/symbols/system/lib
(gdb) info sharedlibrary
No shared libraries loaded at this time.
(gdb) core-file core-count.9362.0
warning: exec file is newer than core file.
[New LWP 9362]
warning: while parsing target library list: no element found
Core was generated by `./count'.
Program terminated with signal 11, Segmentation fault.
#0 0x40128020 in ?? ()
(gdb) where
#0 0x40128020 in ?? ()
#1 0x40162684 in cri_sig_handler () from libcr.so
#2 0x40096188 in ?? () from /home/lumy1/linker
#3 0x40096188 in ?? () from /home/lumy1/linker
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

更多相关文章

  1. 系统编译三方apk,out目录有这个apk,但刷机不见踪影
  2. Android聊天软件开发(基于网易云IM即时通讯)——环境搭建(一)
  3. andriod(1) 初学 安装 以及相关问题
  4. android 如何使用jar替换java代码编译
  5. Android经典例子收藏笔记1
  6. android studio异常Error:A problem was found with the configu
  7. Android(安卓)studio --1-- 从普通IntelliJ项目的迁移到Gradle
  8. Android(安卓)java Broadcast广播例子,
  9. Android平台Firefox――Fennec编译手记

随机推荐

  1. Android(安卓)自定义弹幕控件
  2. Android 拖动换图特效
  3. Android(安卓)JNI和NDK有什么区别
  4. 如何查看Android设备的CPU架构信息
  5. 圆形button
  6. Android NDK打印log到logcat的方法
  7. Android――ImageButton按下效果设计
  8. Android uri转Bitmap
  9. 使用Leancloud实现React Native App的消
  10. [android] 获取网页中的HTML数据