commit | f932ccf42907b8f31fc705f1da7b0705e99e97fc | [log] [tgz] |
---|---|---|
author | Przemyslaw Pietrzkiewicz <ppi@chromium.org> | Thu Jul 30 14:24:54 2015 +0200 |
committer | Przemyslaw Pietrzkiewicz <ppi@chromium.org> | Thu Jul 30 14:24:54 2015 +0200 |
tree | 9e8e2f4c421a1f4af05b12781c4aa4e1cc47624c | |
parent | 68861d324cf591265fc95512fbab47bd3630c0f7 [diff] |
Use argument groups for Android and desktop-only arguments. This makes the `--help` output more readable. R=qsr@chromium.org Review URL: https://codereview.chromium.org/1268703002 . Cr-Mirrored-From: https://github.com/domokit/mojo Cr-Mirrored-Commit: c8fed9b2aa609b3edbd92467517b0842b3a701ea
Unopinionated tools for running, debugging and testing Mojo apps.
git clone https://github.com/domokit/devtools.git
Devtools offers the following tools:
mojo_run
- shell runnermojo_test
- apptest runnermojo_debug
- debugger supporting interactive tracing and debugging of a running mojo shellAdditionally, remote_adb_setup
script helps to configure adb on a remote machine to communicate with a device attached to a local machine, forwarding the ports used by mojo_run
.
The mojo_debug
script allows you to interactively inspect a running shell, collect performance traces and attach a gdb debugger.
To collect performance traces and retrieve the result:
mojo_debug tracing start mojo_debug tracing stop [result.json]
The trace file can be then loaded using the trace viewer in Chrome available at about://tracing
.
It is possible to inspect a Mojo Shell process using GDB. The mojo_debug
script can be used to launch GDB and attach it to a running shell process (android only):
mojo_debug gdb attach
Once started, GDB will first stop the Mojo Shell execution, then load symbols from loaded Mojo applications. Please note that this initial step can take some time (up to several minutes in the worst case).
After each execution pause, GDB will update the set of loaded symbols based on the selected thread only. If you need symbols for all threads, use the update-symbols
GDB command:
(gdb) update-symbols
If you only want to update symbols for the current selected thread (for example, after changing threads), use the current
option:
(gdb) update-symbols current
When Mojo shell crashes on Android (“Unfortunately, Mojo shell has stopped.”) due to a crash in native code, mojo_debug
can be used to find and symbolize the stack trace present in the device log:
mojo_debug device stack
devtoolslib is a Python module containing the core scripting functionality for running Mojo apps: shell abstraction with implementations for Android and Linux and support for apptest frameworks. The executable scripts in devtools are based on this module. One can also choose to embed the functionality provided by devtoolslib in their own wrapper.
The library is canonically developed in the mojo repository, https://github.com/domokit/devtools is a mirror allowing to consume it separately.