Closed Bug 1129798 Opened 7 years ago Closed 7 years ago
mach command debugging improvements
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.
Attachment #8559624 - Flags: review?(ahalberstadt)
I initially thought I'd have multiple patches here. I wanted to use pdb.post_mortem() to automatically enter a debugger from the raise point. However, combining pdb.post_mortem() with pdb.runcall() doesn't seem to work well. When the post mortem debugger is entered, it shows the frame as the first function in the dispatched mach command. I suspect that the debugger instance sets some state and pdb.post_mortem() isn't clearing it. Most weird.
So the traceback from sys.exc_info() doesn't have the correct frame info when pdb.runcall() is used. Digging through the source of pdb.py and bdb.py, I suspect extreme Python magic. I think a patch could be written, but it would involve calling a bunch of low-level pdb APIs. I'm not going to bother.
Attachment #8559624 - Flags: review?(ahalberstadt) → review+
You need to log in before you can comment on or make changes to this bug.