зеркало из https://github.com/mozilla/gecko-dev.git
31c74eb891
* We add new options to the Android variant of `mach run`: * `--debug`: enables running with a debugger; * `--debugger`: Allows the user to override the default debugger (`lldb`). The provided argument must still be `lldb` compatible; this is for enabling the ability to specify some kind of wrapper script or other debugger front-end, if desired; * `--debugger-args`: Additional arguments to pass to the debugger's command line; * `--no-attach`: Runs the app and prepares the device for debugging, but does not actually attach any debuggers. The required ports are printed to the log, and then `mach` exits, thus allowing for the user to manually connect. * `--use-existing-process`: This allows the user to attach to an existing process, instead of killing existing process(es) and starting from scratch. This is useful for users who want to attach to an existing process that is already in a desired state. When debugging is enabled: BEFORE the app starts: * `verify_android_device` will install `lldb-server` if necessary; * We run `am set-debug-app -w --persistent` to ensure that the app is set as the device's debug app. Since we pass `-w`, when Android starts the target app, it will wait for `jdb` to attach before proceeding. AFTER the app starts: * We start `lldb-server` and obtain the name of its socket file; * We obtain the pid of the parent process. Alternatively, if `--use-existing-process` was specified and there are already extant child processes, we prompt the user to choose which process to which they would initially like to attach. * We forward a local TCP port for `jdb` debugging. * We run `jdb` in the background to connect to the process and then quit. This is solely for the purpose of dismissing Android's "waiting for debugger" dialog. * In the foreground, we run `lldb`, specifying a set of initial commands that are required to for symbol resolution and to automatically connect to the target pid. Why `lldb`? I chose it for consistency with Android Studio. Somebody else is welcome to implement `gdb` support if they wish. :-) Differential Revision: https://phabricator.services.mozilla.com/D94384 |
||
---|---|---|
.. | ||
devtools/migrate-l10n | ||
docs | ||
gdbpp/gdbpp | ||
l10n | ||
lldbutils | ||
mach | ||
mozboot | ||
mozbuild | ||
mozlint | ||
mozperftest | ||
mozrelease | ||
mozterm | ||
mozversioncontrol | ||
README | ||
mach_commands.py | ||
moz.build |
README
This directory contains common Python code. The basic rule is that if Python code is cross-module (that's "module" in the Mozilla meaning - as in "module ownership") and is MPL-compatible, it should go here. What should not go here: * Vendored python modules (use third_party/python instead) * Python that is not MPL-compatible (see other-licenses/) * Python that has good reason to remain close to its "owning" (Mozilla) module (e.g. it is only being consumed from there). Historical information can be found at https://bugzilla.mozilla.org/show_bug.cgi?id=775243 https://bugzilla.mozilla.org/show_bug.cgi?id=1346025