Skip to content
Browse files

mach run --debug: Try using rust-gdb/rust-lldb if available

If the selected debugger (requested explicitly or detected by mozdebug)
is gdb or lldb, use rust-gdb or rust-lldb instead, if it's available in
the path and appears to be working.

(This should usually be the case when using the default debugger on
GNU/Linux or MacOS, as rust-gdb or rust-lldb is provided by the Rust
snapshot in use.)
  • Loading branch information...
antrik committed Dec 24, 2015
1 parent 9412e71 commit f3cd5d2961d5493f17062562693608b73ced6128
Showing with 10 additions and 1 deletion.
  1. +10 −1 python/servo/
@@ -95,8 +95,17 @@ def run(self, params, release=False, dev=False, android=False, debug=False, debu
print("Could not find a suitable debugger in your PATH.")
return 1

command = self.debuggerInfo.path
if debugger == 'gdb' or debugger == 'lldb':
rustCommand = 'rust-' + debugger
subprocess.check_call([rustCommand, '--version'], env=env, stdout=open(os.devnull, 'w'))
command = rustCommand
except (OSError, subprocess.CalledProcessError):

# Prepend the debugger args.
args = ([self.debuggerInfo.path] + self.debuggerInfo.args +
args = ([command] + self.debuggerInfo.args +
args + params)
args = args + params

0 comments on commit f3cd5d2

Please sign in to comment.
You can’t perform that action at this time.