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.
This commit is contained in:
Gregory Szorc
2015-02-04 22:49:06 -08:00
parent e6e46590c7
commit c26a49ed7e

View File

@@ -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