[IPython-dev] ipython as a debugger command-line interface?

Rocky Bernstein rocky at gnu.org
Tue Mar 10 11:18:50 EDT 2009


Recently, I've been rewriting the stock Python debugger
<goog_1236623323311>(or more precisely the pydb fork of that) from the
ground up using some
ideas and experience gained in working
ruby-debug<http://rubyforge.org/docman/?group_id=1900>
.

One comment sometimes heard with respect to debuggers is "Gee, I don't need
a debugger because I write modular code and so I just go into a Python or
the cooler IPython shell and enter from that what I need." I find this
remark a little odd (the not needing a debugger part, not the coolness of
the IPython part), because I don't see a good debugger as that much
different from one of these shells. True, the automatic string evaluation in
pdb and pydb of commands that aren't seen as debugger commands is a little
lame compared to IPython, but to that end in the various debuggers I've
tried to make more and more like a Python shell. (I write "Python" here
rather than "IPython" because Python's an easier target to hit :-). So you
can write things like:
 (Pydbgr)  x = 5
 (Pydbgr)  list x+1  # Admittedly this is contrived

But perhaps I've not been going far enough. Although in pydb and pydbgr
there are commands to go into Python or IPython, but maybe more should be
done here. In ruby-debug right now there's a
setting<http://bashdb.sourceforge.net/ruby-debug.html#IDX105>to
*automatically* enter irb initially; the same could be done in
pydbgr<http://code.google.com/p/pydbgr/>to enter python or ipython. So
maybe what should be done is to add add
debugger commands "step", "list", "continue" and so on into these
invocations of these shells.

Thoughts on whether this would be a desirable? Or how easy or difficult
would it be to do?

Finally, I should note that the rewrite allows for multiple command
interfaces. So adding a python or ipython shell interface is not exclusive
of say a gdb-style or DBGp <http://www.xdebug.org/docs-dbgp.php>interfaces.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20090310/4745b8d3/attachment.html>


More information about the IPython-dev mailing list