[IPython-dev] Patches to use pydb instead of pdb for debugging

R. Bernstein rocky at panix.com
Fri Oct 6 13:10:36 CDT 2006


Sorry for the deluge of posting. Some information based on recent
investigation. 

1. do_list
===========

What I wrote about being able to decorate pydb's list command is,
alas, not useful here. In looking over ipython's replacement of pdb's
do_list, I see that unspecified lines of a file (such as in a list of
strings) is not sufficient.  What's also needed is the filename, and
line numbers so that ipython can mark breakpoints and the current line
in the listing whenever they occurs.

So in pydb's CVS, I've broken up the "list" command into two parts, a
parsing part and a listing part. (In pydb the listing part is still
called "do_list" and calls the parsing part first). However ipython's
"do_list" can now also be broken up into the parsing part and a
listing part (and here it's the listing part that is still called
"do_list" but it calls a split out parsing part. I tried this out, and
will submit a patch after the previous batch goes through if there's
interest.

2. Help docstrings for decorated fns do_up and do_down
======================================================

pdb doesn't have docstrings for the "up" and "down" commands. These
are decorated in ipython. But pydb does have docstrings. In other
words in pdb if you type "help up" you get nothing, whereas in pydb
you do get the syntax and semantics of the command. Based on a recent
posting by Duncan Booth in comp.lang.python, I've written a wrapper
function which takes a decorator function and the function it
decorates and adds the docstring to the decorator function. This is of
benefit for the ipython do_up, do_down routines when pydb is used.




More information about the IPython-dev mailing list