aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/post_build_commands.py
diff options
context:
space:
mode:
authorOlaf Buddenhagen <antrik@users.sf.net>2015-12-24 02:12:44 +0100
committerOlaf Buddenhagen <antrik@users.sf.net>2015-12-24 14:26:31 +0100
commitf3cd5d2961d5493f17062562693608b73ced6128 (patch)
treeabdd330967eee14c7f9033d448079b5bd32e7c3b /python/servo/post_build_commands.py
parent9412e71460990f40ea7f9706fd79fbcd4eb0670a (diff)
downloadservo-f3cd5d2961d5493f17062562693608b73ced6128.tar.gz
servo-f3cd5d2961d5493f17062562693608b73ced6128.zip
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.)
Diffstat (limited to 'python/servo/post_build_commands.py')
-rw-r--r--python/servo/post_build_commands.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py
index af290fea111..a119f2a2712 100644
--- a/python/servo/post_build_commands.py
+++ b/python/servo/post_build_commands.py
@@ -95,8 +95,17 @@ class PostBuildCommands(CommandBase):
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
+ try:
+ subprocess.check_call([rustCommand, '--version'], env=env, stdout=open(os.devnull, 'w'))
+ command = rustCommand
+ except (OSError, subprocess.CalledProcessError):
+ pass
+
# Prepend the debugger args.
- args = ([self.debuggerInfo.path] + self.debuggerInfo.args +
+ args = ([command] + self.debuggerInfo.args +
args + params)
else:
args = args + params