Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 Hacking on Sky | 1 Hacking on Sky |
| 2 ============== | 2 ============== |
| 3 | 3 |
| 4 Building | 4 Building |
| 5 -------- | 5 -------- |
| 6 | 6 |
| 7 * Follow the setup & build instructions for [Mojo](https://github.com/domokit/mo jo) | 7 * Follow the setup & build instructions for [Mojo](https://github.com/domokit/mo jo) |
| 8 | 8 |
| 9 The build directory will be `out/Debug` for Linux debug builds, and | 9 The build directory will be `out/Debug` for Linux debug builds, and |
| 10 `out/Release` for Linux release builds. For Android builds, prefix | 10 `out/Release` for Linux release builds. For Android builds, prefix |
| 11 `android_`, as in, `android_Debug`. | 11 `android_`, as in, `android_Debug`. |
| 12 | 12 |
| 13 For Sky on iOS, you can try following these [experimental instructions](https:// docs.google.com/document/d/1qm8Vvyz8Mngw6EsSg4FELQ7FOegjBJ5Itg9OBJGN5JM/edit#hea ding=h.ikz9bdwswdct). | 13 For Sky on iOS, you can try following these [experimental instructions](https:// docs.google.com/document/d/1qm8Vvyz8Mngw6EsSg4FELQ7FOegjBJ5Itg9OBJGN5JM/edit#hea ding=h.ikz9bdwswdct). |
| 14 | 14 |
| 15 Running applications | 15 Running applications |
| 16 -------------------- | 16 -------------------- |
| 17 | 17 |
| 18 To run an application on your device, run: | 18 To run an application on your device, run: |
| 19 | 19 |
| 20 * ``./mojo/tools/mojodb start out/android_Debug [url]`` | 20 * `mojo/devtools/common/mojo_shell --sky [url] --android` |
| 21 | 21 |
| 22 `mojodb` has numerous commands, visible via `mojodb help`. Common ones include: | 22 When the shell is running, `mojo/devtools/common/debugger` allows you to |
| 23 * `mojodb start` BUILD_DIR [url] | 23 collect traces, symbolize stack crashes and attach gdb if needed. Refer to the |
| 24 * `mojodb load` [url] | 24 [documentation](https://github.com/domokit/mojo#debugging-tracing-profiling) |
| 25 * `mojodb stop` | 25 for the details. |
| 26 * `mojodb start_tracing` # Starts recoding a performance trace (use stop_tracing to stop) | |
| 27 * `mojodb print_crash` # Symbolicate the most recent crash from android. | |
| 28 | |
| 29 Once `mojodb start` is issued, all subsequent commands will be sent to | |
| 30 the running mojo_shell instance (even on an attached android device). | |
| 31 `mojodb start` reads gn args from the passed build directory to | |
| 32 determine whether its using android, for example. | |
| 33 | 26 |
| 34 Running tests | 27 Running tests |
| 35 ------------- | 28 ------------- |
| 36 | 29 |
| 37 Tests are only supported on Linux currently. | 30 Tests are only supported on Linux currently. |
| 38 | 31 |
| 39 * ``./sky/tools/test_sky --debug`` | 32 * ``sky/tools/test_sky --debug`` |
| 40 * This runs the tests against ``//out/Debug``. If you want to run against | 33 * This runs the tests against ``//out/Debug``. If you want to run against |
| 41 ``//out/Release``, omit the ``--debug`` flag. | 34 ``//out/Release``, omit the ``--debug`` flag. |
| 42 | 35 |
| 43 Running tests manually | 36 Running tests manually |
| 44 ---------------------- | 37 ---------------------- |
| 45 | 38 |
| 46 Running tests manually lets you more quickly iterate during | 39 Running tests manually lets you more quickly iterate during |
| 47 development; rather than having to compile and rerun all the tests, | 40 development; rather than having to compile and rerun all the tests, |
| 48 then trawl through the build output to find the current results, you | 41 then trawl through the build output to find the current results, you |
| 49 can just run the test you're working on and reload it over and over, | 42 can just run the test you're working on and reload it over and over, |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 63 See [``sky/tests/raw/color_bounds.dart``](tests/raw/color_bounds.dart) | 56 See [``sky/tests/raw/color_bounds.dart``](tests/raw/color_bounds.dart) |
| 64 for an example. | 57 for an example. |
| 65 | 58 |
| 66 Debugging Sky | 59 Debugging Sky |
| 67 ------------- | 60 ------------- |
| 68 | 61 |
| 69 This document aims to explain how to debug Sky itself. | 62 This document aims to explain how to debug Sky itself. |
| 70 | 63 |
| 71 ### C++ | 64 ### C++ |
| 72 | 65 |
| 73 Launch a debug Sky build on Linux as follows (where `app.dart` is the | 66 Launch a debug Sky build on Android as usual: |
| 74 test you are running and trying to debug): | |
| 75 | 67 |
| 76 ```bash | 68 ``` |
| 77 mojodb start --gdb out/Debug app.dart | 69 mojo/devtools/common/mojo_shell --sky [url] --android` |
| 78 mojodb gdb_attach | |
| 79 ``` | 70 ``` |
| 80 | 71 |
| 81 Once gdb has loaded, hit `c` to start the app. The linux simulator | 72 and use the debugger to attach gdb: |
| 82 will load (slowly), after spawning many threads. When your app | 73 ``` |
|
Hixie
2015/07/16 15:40:39
Is it no longer slow? That's great news if so!
| |
| 83 crashes, it will pause in the debugger. At that point, regular gdb | 74 mojo/devtools/common/debugger gdb attach |
| 84 commands will work: `n` to step over the current statement, `s` to | 75 ``` |
| 85 step into the current statement, `f` to step out of the current block, | 76 |
| 86 `c` to continue until the next breakpoint or exception. | 77 Once gdb has loaded, hit `c` to continue the execution. When your app crashes, |
| 78 it will pause in the debugger. At that point, regular gdb commands will work: | |
| 79 `n` to step over the current statement, `s` to step into the current statement, | |
| 80 `f` to step out of the current block, `c` to continue until the next breakpoint | |
| 81 or exception. | |
| 87 | 82 |
| 88 ### Dart | 83 ### Dart |
| 89 | 84 |
| 90 Use Observatory. | 85 Use Observatory. |
| OLD | NEW |