| 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 ``` | 230 ``` |
| 231 | 231 |
| 232 In the source itself, use `fprintf(stderr, "message");` whenever you need to | 232 In the source itself, use `fprintf(stderr, "message");` whenever you need to |
| 233 output a message. | 233 output a message. |
| 234 | 234 |
| 235 ## Debug unit tests with GDB | 235 ## Debug unit tests with GDB |
| 236 | 236 |
| 237 To run unit tests use the following command: | 237 To run unit tests use the following command: |
| 238 | 238 |
| 239 ```shell | 239 ```shell |
| 240 out/Debug/bin/run_test_name -f <test_filter_if_any> --test-arguments=--wait-for-
debugger -t 6000 | 240 out/Debug/bin/run_test_name -f <test_filter_if_any> --wait-for-debugger -t 6000 |
| 241 ``` | 241 ``` |
| 242 | 242 |
| 243 That command will cause the test process to wait until a debugger is attached. | 243 That command will cause the test process to wait until a debugger is attached. |
| 244 | 244 |
| 245 To attach a debugger: | 245 To attach a debugger: |
| 246 | 246 |
| 247 ```shell | 247 ```shell |
| 248 build/android/adb_gdb --output-directory=out/Default --package-name=org.chromium
.native_test | 248 build/android/adb_gdb --output-directory=out/Default --package-name=org.chromium
.native_test |
| 249 ``` | 249 ``` |
| 250 | 250 |
| 251 After attaching gdb to the process you can use it normally. For example: | 251 After attaching gdb to the process you can use it normally. For example: |
| 252 | 252 |
| 253 ``` | 253 ``` |
| 254 (gdb) break main | 254 (gdb) break main |
| 255 Breakpoint 1 at 0x9750793c: main. (2 locations) | 255 Breakpoint 1 at 0x9750793c: main. (2 locations) |
| 256 (gdb) continue | 256 (gdb) continue |
| 257 ``` | 257 ``` |
| OLD | NEW |