1.3 The Debugger Module (pydb) and Class (Pdb)

The module pydb defines an interactive source code debugger for Python programs. It supports setting (conditional) breakpoints and single stepping at the source-line level, inspection of stack frames, source-code listing, and evaluation of arbitrary Python code in the context of any stack frame. It also supports disassembly of code and post-mortem debugging and can be called under program control.

The debugger is extensible--it is defined as the class Pdb. This is currently undocumented but easily understood by reading the source. The extension interface uses the modules bdb (undocumented) and cmd.

All of the methods intended for outside use are documented. In fact the help documentation for commands comes from the document strings of the corresponding methods.

One group of methods that may be useful to subclass would be the output methods errmsg, msg, and msg_nocr. In early regression development I subclassed these so that I could capture debugger output. It turned out, however, that I needed far too many tests and working this way would not scale.



Subsections
See About this document... for information on suggesting changes.