Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(838)

Unified Diff: mojo/devtools/common/devtoolslib/shell_arguments.py

Issue 1159063004: Support running with mojo:debugger in devtools. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/devtools/common/devtoolslib/shell.py ('k') | mojo/tools/android_mojo_shell.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « mojo/devtools/common/devtoolslib/shell.py ('k') | mojo/tools/android_mojo_shell.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698