我的mentor要求我去build谷歌的crash分析工具breakpad,弄了一天终于解决了,在这里记录一下。注意!国内的方法大多都是错误的!

1、首先先读breakpad的官方指南https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/

2、通过https://chromium.googlesource.com/breakpad/breakpad的To request change review方法进行编译!!!这个Getting started in 32-bit mode (from trunk)提供的方法编译出来总是出错。

3、ps:

(1)为什么能找到这个方法?在breakpad的官方论坛上有一个人简单提了一下,我做了一下尝试,居然真的成功了。

(2)注意:gclient sync之后要等很久,一定要耐心等待。这个很容易就ctrl+c中止掉了或者进行git clone操作了。

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

下面是我完成breakpad集成之后,写的一个wiki:如果你要集成breakpad,就一定用得上。

How to integrate Google Breakpad for Android

1.Build to get the libbreakpad_client.a(please refer https://chromium.googlesource.com/breakpad/breakpad)

Steps:

1). Before build, Strongly recommend you to build on the prt server, cuz the environment of the specific server is perfectly right.

2). Get a copy of depot_tools repo.  (please refer https://www.chromium.org/developers/how-tos/install-depot-tools)

3). Create a new directory for checking out the source code. mkdir breakpad && cd breakpad

4). Run the fetch tool from depot_tools to download all the source repos. fetch breakpad. As the process takes long, you need to wait for about 20s and then you will get the source code.

5). Configure and build(please refer the README.ANDROID located in $GOOGLE_BREAKPAD_PATH/src/README.ANDROID)

(a) ./configure --host=arm-linux-androideabi --disable-processor --disable-tools

(b) make -j4

(c) if make failed with "nullptr not declared \ error: expected nested-name-specifier" means you will need to use C++ 11 to build.   set CPPFLAGS = -std=c++11 within Makefile (the MAkefile locate in                          $GOOGLE_BREAKPAD_PATH/src/Makefile)

6). Check if the process of building is right: there should be the libbreakpad_client.a in the google-breakpad-read-only/src/client/linux.

7). Copy the sources to your local computer and cover the relative code loacted in the $JABBER-ANDROID/Jabber9.6/jni/native_crash_handler/breakpad_client(Note that you just need to copy the *.h code and cover)

2.Build to get the minidump_stackwalk and the dump_syms (please refer https://chromium.googlesource.com/breakpad/breakpad)

Steps:

1). Before build, Strongly recommend you to build on the prt server, cuz the environment of the specific server is perfectly right.

2). Get a copy of depot_tools repo.  (please refer https://www.chromium.org/developers/how-tos/install-depot-tools)

3). Create a new directory for checking out the source code. mkdir breakpad && cd breakpad

4). Run the fetch tool from depot_tools to download all the source repos. fetch breakpad. As the process takes long, you need to wait for about 20s and then you will get the source code.

5). Configure and build(please refer the README.md located in $GOOGLE_BREAKPAD_PATH/src/README.md)

(a) .CXXFLAGS=-64 CFLAGS=-m64 CPPFLAGS=-m64 ./configure

(b) make -j4

(c) if make failed with "nullptr not declared \ error: expected nested-name-specifier" means you will need to use C++ 11 to build.   set CPPFLAGS = -std=c++11 within Makefile (the MAkefile locate in                          $GOOGLE_BREAKPAD_PATH/src/Makefile)

6). Check if the process of building is right: there should be the dump_syms in the google-breakpad-read-only/src/tools/linux/dump_syms and the minidump_stackwalk in the google-breakpad-read-only/src/processor

3.Create a native crash to get a dmp file and analyze the dmp file.

Steps:

1). Add the following code in $JABBER-ANDROID/Jabber9.6/obj/local/armeabi/librender.so

int a = 0; int b = 1 / a;

2). Go to the $JABBER-ANDROID/Jabber9.6/ and run the following 2 commands:

ndk-build.cmd USE_FETCH=1 clean

ndk-build.cmd USE_FETCH=1 NDK_DEBUG=1

3). Clean the jabber project and rebuild the jabber project(Note that the step is so critical)

4). Run the source and make a call to someone else. At this time, you should meet a crash. Next, send the prt report to your own email and unzip the accessory(there should be a *.dmp int the folder)

5). Copy the *.dmp and the $JABBER-ANDROID/Jabber9.6/jni/ librender.so to the prt server

6) .Symbol your .so file

$GOOGLE_BREAKPAD_PATH/src/tools/linux/dump_syms/dump_syms  libfoo.so > libfoo.so.sym

7) .Get version number of symbols using the command "head -n1 libfoo.so.sym"

8) .Save the symbol file to some place which is based on version number, like:
          $SOME_PLACE/symbols/libfoo.so/D51B4A5504974FA6ECC1869CAEE3603B0(this step is so critical that you should make the folders named after the request format)

6). Symbol your crash dump file

$GOOGLE_BREAKPAD_PATH/src/processor/minidump_stackwalk crash.dmp $SOME_PLACE/symbols

then,you will get the readable dump file.

【Android 第三方SDK】breakpad在linux下编译相关推荐

  1. linux下编译libuv,linux下libuv库安装教程

    下载并编译libuv libuv需要自己手动下载源码,并手动编译. 当前目录为:/home/xlz/test/github/,在后面,会用$PATH来代替,我的系统的Debian8,64bit. $g ...

  2. linux3.10.53编译,根据官方文档在Linux下编译安装Apache

    根据官方文档在Linux下编译安装Apache 前言 永远记住官方文档才是最准确的安装手册,这篇文章仅为对官方文档的解读和补充,学习提升务必阅读官方文档: http://httpd.apache.or ...

  3. android 第三方社区,从友盟微社区看Android第三方SDK架构实践

    原标题:从友盟微社区看Android第三方SDK架构实践 开发Android第三方SDK说难不难,但说简单也不简单,要开发一个给很多人使用的第三方SDK,如何在保证稳定性的同时,增强SDK的灵活性,让 ...

  4. Android 第三方SDK的检测与提取

    Android 第三方SDK的检测一直是研究领域的热点与难点: 目前检测Android第三方SDK的方法主要分为两类 下手的目标也主要存在三点 首先说检测的点: AndroidManifest.xml ...

  5. 在Linux下编译VLC-Qt

    在Linux下编译VLC-Qt 一.源码准备 1.下载VLC源码 2.下载VLC-Qt源码 二.编译VLC源码 1.解压VLC压缩包 2.安装VLC依赖的库 3.配置VLC 4.编译与安装 三.编译V ...

  6. linux如何编译boost指定库,linux下编译安装boost库

    linux下编译安装boost库 先看一下系统环境 Linux o-pc 3.19.0-22-generic #22-Ubuntu SMP Tue Jun 16 17:15:15 UTC 2015 x ...

  7. linux 保存编译log,(转)Linux下编译安装log4cxx

    一个项目的服务器端在Linux平台下,用到了开源日志库log4cxx,这个库是apache项目的一个子库.功能很不错.下面记录下它的编译和安装过程. 第一步安装apr-1.3.8,顺序不能错,它必须首 ...

  8. linux下编译make文件报错“/bin/bash^M: 坏的解释器,使用grep快速定位代码位置

    一.linux下编译make文件报错"/bin/bash^M: 坏的解释器 参考文章:http://blog.csdn.net/liuqiyao_01/article/details/415 ...

  9. 一份简单的在 Linux下编译及调试 C 代码的指南

    摘要: 一份简单的在 Linux下编译及调试 C 代码的指南 对于Linux下的C程序员来说,几乎天天都会和Linux打交道.但在很多人的眼中,Linux是一个易用性极差.靠命令驱动的操作系统,根本无 ...

  10. linux下软件编译终止,[2018年最新整理]linux下编译运行程序命令大全.ppt

    [2018年最新整理]linux下编译运行程序命令大全 1. 项目课题引入 2. Vi编辑器的使用方法 3. Linux中C语言程序的编辑 4. Linux中C语言程序的运行 5. 现场演示案例 课题 ...

最新文章

  1. 第一次软件工程作业(改进版)
  2. django2 mysql配置_Django:Python3.6.2+Django2.0配置MySQL 转载
  3. [na]出口选路pbr小实验视频
  4. 【学习笔记】14、标准数据类型—字典
  5. 秒拍,一款为你纪录万千世界的好玩短频App是怎么运作的?
  6. 【渝粤教育】 广东开放大学 21秋期末考试物业经营管理实务10123k2
  7. LeetCode 33. 搜索旋转排序数组 golang
  8. 机器学习 深度学习 ai_如何突破AI炒作成为机器学习工程师
  9. python高手之路(第3版)_Python高手之路(第3版)
  10. linux通配符与正则表达式
  11. 支付宝技术期末考:专业技术蓝军首次对外公开
  12. 2020SCTF——PWN snake
  13. 最全移动端UI设计规范,作为前端的你,了解多少?
  14. 如何确保数据完整性?
  15. 剑指Offer系列(java版,详细解析)38.字符串的排列
  16. 中枢神经的运动控制理论,神经网络运动控制方式
  17. UrlRewrite.xml
  18. DRV8301驱动芯片BUCK电路设计
  19. SQL1 插入记录(一)
  20. 使用js将网页导出为图片并下载

热门文章

  1. UWB电厂人员定位系统优势有哪些?
  2. web错误代码ERR_BLOCKED_BY_RESPONSE
  3. 图像目标检测和视频目标检测文献综述
  4. Only fullscreen activities can request orientation异常解决
  5. MIS课设 JavaFX考试管理系统
  6. 项目上线前验收测试流程
  7. 后台得到ajax传来的参数,几种ajax传参数到后台获取的方法
  8. Windows修改本地域名解析文件hosts
  9. Flink链接kafka并解析Json文件(三)
  10. 关系数据库之关系代数