gecko-dev/python
Aaron Klotz 31c74eb891 Bug 1581971: Part 6 - Support mach run --debug with lldb for Android; r=mhentges
* 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
2021-02-19 21:07:20 +00:00
..
devtools/migrate-l10n Bug 1654103: Standardize on Black for Python code in `mozilla-central`. 2020-10-26 18:34:53 +00:00
docs
gdbpp/gdbpp Bug 1654103: Standardize on Black for Python code in `mozilla-central`. 2020-10-26 18:34:53 +00:00
l10n no bug - fix(fluent) - Remove Windows CR r=zbraniecki DONTBUILD 2021-02-17 20:50:25 +00:00
lldbutils Bug 1654103: Standardize on Black for Python code in `mozilla-central`. 2020-10-26 18:34:53 +00:00
mach Bug 1678668: print sentry error report number on mach command failure r=firefox-build-system-reviewers,mhentges 2021-01-05 16:39:22 +00:00
mozboot Bug 1581971: Part 1 - Bump Android NDK requirement to 21d; r=snorp,firefox-build-system-reviewers,mhentges 2021-02-19 21:07:18 +00:00
mozbuild Bug 1581971: Part 6 - Support mach run --debug with lldb for Android; r=mhentges 2021-02-19 21:07:20 +00:00
mozlint Bug 1591991 Add lint Fixed count support to linters r=sylvestre 2021-02-08 19:00:10 +00:00
mozperftest Bug 1681669 - Add vision document for mozperftest. r=davehunt 2021-02-16 18:37:23 +00:00
mozrelease Bug 1648832: Make updater/Balrog support AArch64 macOS. r=aki 2020-11-13 18:41:56 +00:00
mozterm Bug 1680345 - python3 - Require six 1.13.0 in non third_party and non web-platform packages r=jgraham,jmaher 2020-12-03 22:54:35 +00:00
mozversioncontrol Backed out changeset 5153f0eaf518 (bug 1676533) as requested by glandium. CLOSED TREE 2020-12-02 07:58:47 +02:00
README
mach_commands.py Bug 1680802: Install pylint requirements with legacy resolver r=firefox-build-system-reviewers,sheehan,glandium 2021-01-05 20:14:25 +00:00
moz.build Bug 1654103: Standardize on Black for Python code in `mozilla-central`. 2020-10-26 18:34:53 +00:00

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