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

R. Bernstein rocky at panix.com
Thu Oct 5 21:59:12 EDT 2006

Hi - 

Sorry if I've been out of touch for awhile. I just looked to see what
it would take to change the current svn sources to use pydb
(http://bashdb.sf.net/pydb) when it is available instead of the stock
pdb. I was very pleasantly pleased to find that, at least for python
2.5, the changes are fairly small.

(Last time I attempted doing this which was earlier this year, changes
were much more onerous and extensive. It looks like the code has
greatly been cleaned up. THANKS!)

Enclosed find a patch. Here is basically what happens. First I'm only
attempting this if Python 2.5 is installed. (The idea is to start
small and simple and if this is desirable/successful we can add other
Python versions later). I try to import pydb; if that fails then pdb
is imported. To make it clearer to folks which debugger they've got,
the prompt is also changed to "ipydb>" instead of "ipdb>". 

Note that in pydb we generally add a set of parenthesis around the
prompt whenever the debugger is called recursively (command "debug"
inside of the debugger).

Since pydb has a "restart" command which doesn't make sense in the
ipython contexts, that is made the same thing as "quit". Probably
better would be to issue a message indicating what's up (and then
quit). Perhaps later.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipython-pydb.diff
Type: application/octet-stream
Size: 3165 bytes
Desc: Patch to allow pydb to be used when it is available.
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20061005/4b14be16/attachment.obj>

More information about the IPython-dev mailing list