| OLD | NEW |
| 1 # Tips for debugging on Linux | 1 # Tips for debugging on Linux |
| 2 | 2 |
| 3 This page is for Chromium-specific debugging tips; learning how to run gdb is | 3 This page is for Chromium-specific debugging tips; learning how to run gdb is |
| 4 out of scope. | 4 out of scope. |
| 5 | 5 |
| 6 [TOC] | 6 [TOC] |
| 7 | 7 |
| 8 ## Symbolized stack trace | 8 ## Symbolized stack trace |
| 9 | 9 |
| 10 The sandbox can interfere with the internal symbolizer. Use `--no-sandbox` (but | 10 The sandbox can interfere with the internal symbolizer. Use `--no-sandbox` (but |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 the renderers won't be sandboxed. It is generally not an issue, except when you | 73 the renderers won't be sandboxed. It is generally not an issue, except when you |
| 74 are trying to debug interactions with the sandbox. If that's what you are doing, | 74 are trying to debug interactions with the sandbox. If that's what you are doing, |
| 75 you will need to attach your debugger to a running renderer process (see below). | 75 you will need to attach your debugger to a running renderer process (see below). |
| 76 *** | 76 *** |
| 77 | 77 |
| 78 You may also want to pass `--disable-hang-monitor` to suppress the hang monitor, | 78 You may also want to pass `--disable-hang-monitor` to suppress the hang monitor, |
| 79 which is rather annoying. | 79 which is rather annoying. |
| 80 | 80 |
| 81 You can also use `--renderer-startup-dialog` and attach to the process in order | 81 You can also use `--renderer-startup-dialog` and attach to the process in order |
| 82 to debug the renderer code. Go to | 82 to debug the renderer code. Go to |
| 83 http://www.chromium.org/blink/getting-started-with-blink-debugging for more | 83 https://www.chromium.org/blink/getting-started-with-blink-debugging for more |
| 84 information on how this can be done. | 84 information on how this can be done. |
| 85 | 85 |
| 86 #### Choosing which renderers to debug | 86 #### Choosing which renderers to debug |
| 87 | 87 |
| 88 If you are starting multiple renderers then the above means that multiple gdb's | 88 If you are starting multiple renderers then the above means that multiple gdb's |
| 89 start and fight over the console. Instead, you can set the prefix to point to | 89 start and fight over the console. Instead, you can set the prefix to point to |
| 90 this shell script: | 90 this shell script: |
| 91 | 91 |
| 92 ```sh | 92 ```sh |
| 93 #!/bin/sh | 93 #!/bin/sh |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 #### Single-Process mode | 189 #### Single-Process mode |
| 190 | 190 |
| 191 Depending on whether it's relevant to the problem, it's often easier to just run | 191 Depending on whether it's relevant to the problem, it's often easier to just run |
| 192 in "single process" mode where the renderer threads are in-process. Then you can | 192 in "single process" mode where the renderer threads are in-process. Then you can |
| 193 just run gdb on the main process. | 193 just run gdb on the main process. |
| 194 | 194 |
| 195 gdb --args chrome --single-process | 195 gdb --args chrome --single-process |
| 196 | 196 |
| 197 Currently, the `--disable-gpu` flag is also required, as there are known crashes | 197 Currently, the `--disable-gpu` flag is also required, as there are known crashes |
| 198 that occur under TextureImageTransportSurface without it. The crash described in | 198 that occur under TextureImageTransportSurface without it. The crash described in |
| 199 http://crbug.com/361689 can also sometimes occur, but that crash can be | 199 https://crbug.com/361689 can also sometimes occur, but that crash can be |
| 200 continued from without harm. | 200 continued from without harm. |
| 201 | 201 |
| 202 Note that for technical reasons plugins cannot be in-process, so | 202 Note that for technical reasons plugins cannot be in-process, so |
| 203 `--single-process` only puts the renderers in the browser process. The flag is | 203 `--single-process` only puts the renderers in the browser process. The flag is |
| 204 still useful for debugging plugins (since it's only two processes instead of | 204 still useful for debugging plugins (since it's only two processes instead of |
| 205 three) but you'll still need to use `--plugin-launcher` or another approach. | 205 three) but you'll still need to use `--plugin-launcher` or another approach. |
| 206 | 206 |
| 207 ### Printing Chromium types | 207 ### Printing Chromium types |
| 208 | 208 |
| 209 gdb 7 lets us use Python to write pretty-printers for Chromium types. The | 209 gdb 7 lets us use Python to write pretty-printers for Chromium types. The |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 locally now - and often nearly 100% of the time. | 387 locally now - and often nearly 100% of the time. |
| 388 | 388 |
| 389 ## Logging | 389 ## Logging |
| 390 | 390 |
| 391 ### Seeing all LOG(foo) messages | 391 ### Seeing all LOG(foo) messages |
| 392 | 392 |
| 393 Default log level hides `LOG(INFO)`. Run with `--log-level=0` and | 393 Default log level hides `LOG(INFO)`. Run with `--log-level=0` and |
| 394 `--enable-logging=stderr` flags. | 394 `--enable-logging=stderr` flags. |
| 395 | 395 |
| 396 Newer versions of Chromium with VLOG may need --v=1 too. For more VLOG tips, see | 396 Newer versions of Chromium with VLOG may need --v=1 too. For more VLOG tips, see |
| 397 [the chromium-dev thread](http://groups.google.com/a/chromium.org/group/chromium
-dev/browse_thread/thread/dcd0cd7752b35de6?pli=1). | 397 [the chromium-dev thread](https://groups.google.com/a/chromium.org/group/chromiu
m-dev/browse_thread/thread/dcd0cd7752b35de6?pli=1). |
| 398 | 398 |
| 399 ### Seeing IPC debug messages | 399 ### Seeing IPC debug messages |
| 400 | 400 |
| 401 Run with `CHROME_IPC_LOGGING=1` eg. | 401 Run with `CHROME_IPC_LOGGING=1` eg. |
| 402 | 402 |
| 403 CHROME_IPC_LOGGING=1 out/Debug/chrome | 403 CHROME_IPC_LOGGING=1 out/Debug/chrome |
| 404 | 404 |
| 405 or within gdb: | 405 or within gdb: |
| 406 | 406 |
| 407 set environment CHROME_IPC_LOGGING 1 | 407 set environment CHROME_IPC_LOGGING 1 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 If you break in a debugger during a drag, Chrome will have grabbed your mouse | 478 If you break in a debugger during a drag, Chrome will have grabbed your mouse |
| 479 and keyboard so you won't be able to interact with the debugger! To work around | 479 and keyboard so you won't be able to interact with the debugger! To work around |
| 480 this, run via `Xephyr`. Instructions for how to use `Xephyr` are on the | 480 this, run via `Xephyr`. Instructions for how to use `Xephyr` are on the |
| 481 [Running layout tests on Linux](layout_tests_linux.md) page. | 481 [Running layout tests on Linux](layout_tests_linux.md) page. |
| 482 | 482 |
| 483 ## Tracking Down Bugs | 483 ## Tracking Down Bugs |
| 484 | 484 |
| 485 ### Isolating Regressions | 485 ### Isolating Regressions |
| 486 | 486 |
| 487 Old builds are archived here: | 487 Old builds are archived here: |
| 488 http://build.chromium.org/buildbot/snapshots/chromium-rel-linux/ | 488 https://build.chromium.org/buildbot/snapshots/chromium-rel-linux/ |
| 489 (TODO: does not exist). | 489 (TODO: does not exist). |
| 490 | 490 |
| 491 `tools/bisect-builds.py` in the tree automates bisecting through the archived | 491 `tools/bisect-builds.py` in the tree automates bisecting through the archived |
| 492 builds. Despite a computer science education, I am still amazed how quickly | 492 builds. Despite a computer science education, I am still amazed how quickly |
| 493 binary search will find its target. | 493 binary search will find its target. |
| 494 | 494 |
| 495 ### Screen recording for bug reports | 495 ### Screen recording for bug reports |
| 496 | 496 |
| 497 sudo apt-get install gtk-recordmydesktop | 497 sudo apt-get install gtk-recordmydesktop |
| 498 | 498 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 [Running layout tests on Linux](layout_tests_linux.md) page. | 537 [Running layout tests on Linux](layout_tests_linux.md) page. |
| 538 | 538 |
| 539 If you need to test something with hardware accelerated compositing | 539 If you need to test something with hardware accelerated compositing |
| 540 (e.g., compiz), you can use `Xgl` (`sudo apt-get install xserver-xgl`). E.g.: | 540 (e.g., compiz), you can use `Xgl` (`sudo apt-get install xserver-xgl`). E.g.: |
| 541 | 541 |
| 542 Xgl :1 -ac -accel glx:pbuffer -accel xv:pbuffer -screen 1024x768 | 542 Xgl :1 -ac -accel glx:pbuffer -accel xv:pbuffer -screen 1024x768 |
| 543 | 543 |
| 544 ## Mozilla Tips | 544 ## Mozilla Tips |
| 545 | 545 |
| 546 https://developer.mozilla.org/en/Debugging_Mozilla_on_Linux_FAQ | 546 https://developer.mozilla.org/en/Debugging_Mozilla_on_Linux_FAQ |
| OLD | NEW |