Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(21)

Delta Between Two Patch Sets: README.ANDROID

Issue 407002: Add Android NDK module definition + sample application (Closed) Base URL: http://google-breakpad.googlecode.com/svn/trunk/
Left Patch Set: Created 12 years, 9 months ago
Right Patch Set: Created 12 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | android/google_breakpad/Android.mk » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 Google Breakpad for Android
2 ===========================
3
4 This document explains how to use the Google Breakpad client library
5 on Android, and later generate valid stack traces from the minidumps
6 it generates.
7
8 Note that this release only supports ARM-based Android systems.
9 We're working on adding support for x86 and MIPS, but that might
10 require an udpated NDK release.
11
12
13 I. Building the client library:
14 ===============================
15
16 The Android client is built as a static library that you can
17 link into your own Android native code. There are two ways to
18 build it:
19
20 I.1. Building with ndk-build:
21 -----------------------------
22
23 If you're using the ndk-build build system, you can follow
24 these simple steps:
25
26 1/ Include android/google_breakpad/Android.mk from your own
27 project's Android.mk
28
29 This can be done either directly, or using ndk-build's
30 import-module feature.
31
32 2/ Link the library to one of your modules by using:
33
34 LOCAL_STATIC_LIBRARIES += breakpad_client
35
36 NOTE: The client library requires a C++ STL implementation,
37 which you can select with APP_STL in your Application.mk
38
39 It has been tested succesfully with both STLport and GNU libstdc++
40
41
42 II.1. Building with a standalone Android toolchain:
43 ---------------------------------------------------
44
45 All you need to do is configure your build with the right 'host'
46 value, and disable the processor and tools, as in:
47
48 $GOOGLE_BREAKPAD_PATH/configure --host=arm-linux-androideabi \
49 --disable-processor \
50 --disable-tools
51 make -j4
52
53 The library will be under src/client/linux/libbreakpad_client.a
54
55
56 II. Using the client library in Android:
57 ========================================
58
59 The usage instructions are very similar to the Linux ones that are
60 found at http://code.google.com/p/google-breakpad/wiki/LinuxStarterGuide
61
62 1/ You need to include "client/linux/handler/exception_handler.h" from a C++
63 source file.
64
65 2/ If you're not using ndk-build, you also need to:
66
67 - add $GOOGLE_BREAKPAD_PATH to your compiler include path
68 - add -llog to your linker flags
69
70 Note that ndk-build does that for your automatically.
71
72 3/ Keep in mind that there is no /tmp directory on Android.
73
74 If you use the library from a regular Android applications, specify a
75 path under your app-specific storage directory. An alternative is to
76 store them on the SDCard, but this requires a specific permission.
77
78 For a concrete example, see the sample test application under
79 android/sample_app. See its README for more information.
80
81
82 III. Getting a stack trace on the host:
83 =======================================
84
85 This process is similar to other platforms, but here's a quick example:
86
87 1/ Retrieve the minidumps on your development machine.
88
89 2/ Dump the symbols for your native libraries with the 'dump_syms' tool.
90 This first requires building the host version of Google Breakpad, then
91 calling:
92
93 dump_syms $PROJECT_PATH/obj/local/$ABI/libfoo.so > libfoo.so.sym
94
95 3/ Create the symbol directory hierarchy.
96
97 The first line of the generated libfoo.so.sym will have a "MODULE"
98 entry that carries a hexadecimal version number, e.g.:
99
100 MODULE Linux arm D51B4A5504974FA6ECC1869CAEE3603B0 test_google_breakpad
101
102 Note: The second field could be either 'Linux' or 'Android'.
103
104 Extract the version number, and a 'symbol' directory, for example:
105
106 $PROJECT_PATH/symbols/libfoo.so/$VERSION/
107
108 Copy/Move your libfoo.sym file there.
109
110 4/ Invoke minidump_stackwalk to create the stack trace:
111
112 minidump_stackwalk $MINIDUMP_FILE $PROJECT_PATH/symbols
113
114 Note that various helper scripts can be found on the web to automate these
115 steps.
116
117 IV. Verifying the Android build library:
118 ========================================
119
120 If you modify Google Breakpad and want to check that it still works correctly
121 on Android, please run the android/run-test-program.sh script which will do all
122 necessary verifications for you. This includes:
123
124 - Rebuilding the full host package
125 - Rebuilding the client library with configure/make
126 - Rebuilding the client library with ndk-build
127 - Building, installing and running a test crasher program on a device
128 - Extracting the corresponding minidump, dumping the test program symbols
129 and generating a stack trace.
130 - Checking the stack trace for valid source locations.
131
132 For more details, please run:
133
134 android/run-test-program.sh --help-all
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted