From c26a49ed7e3cb0396b51bea7cbaf7a0129ebf020 Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Wed, 4 Feb 2015 22:49:06 -0800 Subject: [PATCH] Bug 1129798 - Use pdb.runcall to debug mach commands; r=ahal The previous debugger was setting a breakpoint in the mach dispatcher. This required users to step into the main function to be called into. Using pdb.runcall(), the debugger starts at the first line in the executed command, which is far more useful. --- python/mach/mach/main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/mach/mach/main.py b/python/mach/mach/main.py index 9e09fb017bf2..ab2504cfa120 100644 --- a/python/mach/mach/main.py +++ b/python/mach/mach/main.py @@ -445,12 +445,12 @@ To see more help for a specific command, run: fn = getattr(instance, handler.method) - if args.debug_command: - import pdb - pdb.set_trace() - try: - result = fn(**vars(args.command_args)) + if args.debug_command: + import pdb + result = pdb.runcall(fn, **vars(args.command_args)) + else: + result = fn(**vars(args.command_args)) if not result: result = 0