mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 17:23:59 +00:00
Bug 857600 - Add a mach command for debugging using gdb; r=gps
--HG-- extra : rebase_source : 85d0d7e717eb8ee92a61bd0ce7fd310ac2d3d715
This commit is contained in:
parent
14c8cf8947
commit
ac14fd4510
@ -423,6 +423,34 @@ class RunProgram(MachCommandBase):
|
||||
return self.run_process(args=args, ensure_exit_code=False,
|
||||
pass_thru=True)
|
||||
|
||||
@CommandProvider
|
||||
class DebugProgram(MachCommandBase):
|
||||
"""Debug the compiled binary"""
|
||||
|
||||
@Command('debug', help='Debug the compiled program.', prefix_chars='+')
|
||||
@CommandArgument('params', default=None, nargs='*',
|
||||
help='Command-line arguments to pass to the program.')
|
||||
def debug(self, params):
|
||||
import which
|
||||
try:
|
||||
debugger = which.which('gdb')
|
||||
except Exception as e:
|
||||
print("You don't have gdb in your PATH")
|
||||
print(e)
|
||||
return 1
|
||||
try:
|
||||
args = [debugger, self.get_binary_path('app')]
|
||||
except Exception as e:
|
||||
print("It looks like your program isn't built.",
|
||||
"You can run |mach build| to build it.")
|
||||
print(e)
|
||||
return 1
|
||||
if params:
|
||||
args.insert(1, '--args')
|
||||
args.extend(params)
|
||||
return self.run_process(args=args, ensure_exit_code=False,
|
||||
pass_thru=True)
|
||||
|
||||
@CommandProvider
|
||||
class Buildsymbols(MachCommandBase):
|
||||
"""Produce a package of debug symbols suitable for use with Breakpad."""
|
||||
|
Loading…
Reference in New Issue
Block a user