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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user