bug 1517793 - fix `mach run --debug` to not hit an exception if no debugger can be found. r=nalexander
authorTed Mielczarek <ted@mielczarek.org>
Mon, 14 Jan 2019 18:09:48 +0000
changeset 513897 7e9a290c0e917ec56c699c53784a648760c4ed9f
parent 513896 d5245076458f441cbd812737fdb5d515d6bc20de
child 513898 fc12f3d8c2d7163730fe829ace5e366424f66d09
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1517793
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1517793 - fix `mach run --debug` to not hit an exception if no debugger can be found. r=nalexander This change simply moves a check for the "no debugger found" situation out of a conditional so it will catch more cases. Differential Revision: https://phabricator.services.mozilla.com/D16476
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -984,19 +984,20 @@ class RunProgram(MachCommandBase):
             import mozdebug
             if not debugger:
                 # No debugger name was provided. Look for the default ones on
                 # current OS.
                 debugger = mozdebug.get_default_debugger_name(mozdebug.DebuggerSearch.KeepLooking)
 
             if debugger:
                 self.debuggerInfo = mozdebug.get_debugger_info(debugger, debugger_args)
-                if not self.debuggerInfo:
-                    print("Could not find a suitable debugger in your PATH.")
-                    return 1
+
+            if not debugger or not self.debuggerInfo:
+                print("Could not find a suitable debugger in your PATH.")
+                return 1
 
             # Parameters come from the CLI. We need to convert them before
             # their use.
             if debugger_args:
                 from mozbuild import shellutil
                 try:
                     debugger_args = shellutil.split(debugger_args)
                 except shellutil.MetaCharacterException as e: