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