Chromium Code Reviews| Index: mojo/devtools/common/devtoolslib/shell_arguments.py |
| diff --git a/mojo/devtools/common/devtoolslib/shell_arguments.py b/mojo/devtools/common/devtoolslib/shell_arguments.py |
| index bf70f89300949e3af3333c156a9a006a3f8a111a..2a327d9f2d98da86c14a6a45f5d9a406e657185d 100644 |
| --- a/mojo/devtools/common/devtoolslib/shell_arguments.py |
| +++ b/mojo/devtools/common/devtoolslib/shell_arguments.py |
| @@ -12,6 +12,10 @@ _MAP_ORIGIN_PREFIX = '--map-origin=' |
| # so that caching works between subsequent runs with the same command line. |
| _MAP_ORIGIN_BASE_PORT = 31338 |
| +# Port on which the mojo:debugger http server will be available on the host |
| +# machine. |
| +_MOJO_DEBUGGER_PORT = 7777 |
| + |
| def _IsMapOrigin(arg): |
| """Returns whether |arg| is a --map-origin argument.""" |
| @@ -63,3 +67,16 @@ def RewriteMapOriginParameters(shell, original_arguments): |
| arguments.append(_RewriteMapOriginParameter(shell, mapping, next_port)) |
| next_port += 1 |
| return arguments |
| + |
| + |
| +def ConfigureDebugger(shell): |
| + """Configures mojo:debugger to run and sets up port forwarding for its http |
| + server if the shell is running on a device. |
| + |
| + Returns: |
| + Arguments that need to be appended to the shell argument list in order to |
| + run with the debugger. |
| + """ |
| + shell.ForwardHostPortToShell(_MOJO_DEBUGGER_PORT) |
| + return ['--args-for=mojo:debugger %d' % _MOJO_DEBUGGER_PORT, |
| + 'mojo:debugger'] |
|
qsr
2015/06/03 10:38:19
If you plan to run mojo:debuffer, you can pass the
ppi
2015/06/03 10:43:13
Done.
|