OLD | NEW |
1 # Android Debugging Instructions | 1 # Android Debugging Instructions |
2 | 2 |
3 Chrome on Android has java and c/c++ code. Each "side" have its own set of tools | 3 Chrome on Android has java and c/c++ code. Each "side" have its own set of tools |
4 for debugging. Here's some tips. | 4 for debugging. Here's some tips. |
5 | 5 |
6 [TOC] | 6 [TOC] |
7 | 7 |
8 ## Setting up command line flags | 8 ## Setting up command line flags |
9 | 9 |
10 Various commands below requires setting up command line flags. | 10 Various commands below requires setting up command line flags. |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 third_party/android_platform/development/scripts/stack --output-directory out/De
fault ~/crashlogs/tombstone_07-build231.txt | 196 third_party/android_platform/development/scripts/stack --output-directory out/De
fault ~/crashlogs/tombstone_07-build231.txt |
197 ``` | 197 ``` |
198 | 198 |
199 ## Deobfuscating Stack Traces (Java) | 199 ## Deobfuscating Stack Traces (Java) |
200 | 200 |
201 You will need the ProGuard mapping file that was generated when the application | 201 You will need the ProGuard mapping file that was generated when the application |
202 that crashed was built. When building locally, these are found in: | 202 that crashed was built. When building locally, these are found in: |
203 | 203 |
204 ```shell | 204 ```shell |
205 out/Default/apks/ChromePublic.apk.mapping | 205 out/Default/apks/ChromePublic.apk.mapping |
206 out/Default/apks/Chrome.apk.mapping | 206 out/Default/apks/ChromeModernPublic.apk.mapping |
| 207 etc. |
207 ``` | 208 ``` |
208 | 209 |
209 To deobfuscate a stack trace from a file, run | 210 Build the `java_deobfuscate` tool: |
210 | 211 |
211 ```shell | 212 ```shell |
212 build/android/stacktrace/java_deobfuscate.py PROGUARD_MAPPING_FILE.mapping --sta
cktrace STACKTRACE_FILE | 213 ninja -C out/Default java_deobfuscate |
213 ``` | 214 ``` |
214 | 215 |
215 Deobfuscation also works from `stdin`: | 216 Then run it via: |
216 | 217 |
217 ```shell | 218 ```shell |
218 adb logcat -d | build/android/stacktrace/java_deobfuscate.py PROGUARD_MAPPING_FI
LE.mapping | 219 # For a file: |
| 220 out/Default/bin/java_deobfuscate PROGUARD_MAPPING_FILE.mapping < FILE |
| 221 # For logcat: |
| 222 adb logcat | out/Default/bin/java_deobfuscate PROGUARD_MAPPING_FILE.mapping |
219 ``` | 223 ``` |
220 | 224 |
221 ## Get WebKit code to output to the adb log | 225 ## Get WebKit code to output to the adb log |
222 | 226 |
223 In your build environment: | 227 In your build environment: |
224 | 228 |
225 ```shell | 229 ```shell |
226 adb root | 230 adb root |
227 adb shell stop | 231 adb shell stop |
228 adb shell setprop log.redirect-stdio true | 232 adb shell setprop log.redirect-stdio true |
(...skipping 19 matching lines...) Expand all Loading... |
248 build/android/adb_gdb --output-directory=out/Default --package-name=org.chromium
.native_test | 252 build/android/adb_gdb --output-directory=out/Default --package-name=org.chromium
.native_test |
249 ``` | 253 ``` |
250 | 254 |
251 After attaching gdb to the process you can use it normally. For example: | 255 After attaching gdb to the process you can use it normally. For example: |
252 | 256 |
253 ``` | 257 ``` |
254 (gdb) break main | 258 (gdb) break main |
255 Breakpoint 1 at 0x9750793c: main. (2 locations) | 259 Breakpoint 1 at 0x9750793c: main. (2 locations) |
256 (gdb) continue | 260 (gdb) continue |
257 ``` | 261 ``` |
OLD | NEW |