bug 1517811 - use mozdebug in mach to validate debugger arguments. r=froydnj
authorTed Mielczarek <ted@mielczarek.org>
Tue, 08 Jan 2019 16:10:36 +0000
changeset 452934 e08a0bb35c033607bdd78aa32d00e5debb218c41
parent 452933 01d64b7442cd23657d1135c9da9b254ba5317116
child 452946 e0e0d3ec5787906dcc10c615e4a4d45a26fc33dc
child 452947 18cb79bb1c78109448ad0817f8b6e435044000ab
push id35334
push userrmaries@mozilla.com
push dateTue, 08 Jan 2019 21:58:40 +0000
treeherdermozilla-central@e08a0bb35c03 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1517811
milestone66.0a1
first release with
nightly linux32
e08a0bb35c03 / 66.0a1 / 20190108215840 / files
nightly linux64
e08a0bb35c03 / 66.0a1 / 20190108215840 / files
nightly mac
e08a0bb35c03 / 66.0a1 / 20190108215840 / files
nightly win32
e08a0bb35c03 / 66.0a1 / 20190108215840 / files
nightly win64
e08a0bb35c03 / 66.0a1 / 20190108215840 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1517811 - use mozdebug in mach to validate debugger arguments. r=froydnj Differential Revision: https://phabricator.services.mozilla.com/D15847
python/mach/mach/main.py
--- a/python/mach/mach/main.py
+++ b/python/mach/mach/main.py
@@ -450,30 +450,29 @@ To see more help for a specific command,
         if args.settings_file:
             # Argument parsing has already happened, so settings that apply
             # to command line handling (e.g alias, defaults) will be ignored.
             self.load_settings(args.settings_file)
 
         def _check_debugger(program):
             """Checks if debugger specified in command line is installed.
 
-            This internal function calls an in-tree library 'which'.
+            Uses mozdebug to locate debuggers.
 
             If the call does not raise any exceptions, mach is permitted
             to continue execution.
 
             Otherwise, mach execution is halted.
 
             Args:
                 program (str): debugger program name.
             """
-            from which import which, WhichError
-            try:
-                which(program)
-            except WhichError:
+            import mozdebug
+            info = mozdebug.get_debugger_info(program)
+            if info is None:
                 print("Specified debugger '{}' is not found.\n".format(program) +
                       "Is it installed? Is it in your PATH?")
                 sys.exit(1)
 
         # For the codepath where ./mach <test_type> --debugger=<program>,
         # assert that debugger value exists first, then check if installed on system.
         if (hasattr(args.command_args, "debugger") and
                 getattr(args.command_args, "debugger") is not None):