mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Auto merge of #9062 - antrik:rust-gdb, r=SimonSapin
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.) Note: I cobbled this together without *any* previous Python experience -- so if it violates three dozen rules, and only works by luck on my own system during a favourable moon phase, don't hesitate to suggest improvements :-) <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9062) <!-- Reviewable:end -->
This commit is contained in:
commit
4e3a435450
1 changed files with 10 additions and 1 deletions
|
@ -95,8 +95,17 @@ class PostBuildCommands(CommandBase):
|
||||||
print("Could not find a suitable debugger in your PATH.")
|
print("Could not find a suitable debugger in your PATH.")
|
||||||
return 1
|
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.
|
# Prepend the debugger args.
|
||||||
args = ([self.debuggerInfo.path] + self.debuggerInfo.args +
|
args = ([command] + self.debuggerInfo.args +
|
||||||
args + params)
|
args + params)
|
||||||
else:
|
else:
|
||||||
args = args + params
|
args = args + params
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue