pdb.py - why is this debugger different from all other debuggers?

Fernando Perez fperez.net at gmail.com
Thu Jan 5 19:15:38 EST 2006


rurpy at yahoo.com wrote:


> I hope some of the other problems with it get
> addressed some day:
> - There is no way (I know of) to start a python script
>   from the command line with the debugger active;
>   I always have to modify the source to insert a
>   pdb.set_trace().  I would like something like Perl's
>   -d option.

You may want to try out ipython (the current release candidate from
http://ipython.scipy.org/dist/testing/, which has many improvements on this
front).  The %pdb magic will trigger automatic activation of pdb at any
uncaught exception, and '%run -d' will run your script under the control of
pdb, without any modifications to your source necessary.

> - Exceptions often don't stop debugger in routine
>   where they occurred; instead you are dumped
>   into a higher (lower?) stack frame and have to
>   navigate back to the frame the exception
>   occurred in.
> - It needs something like the Perl debugger's
>   X command to display full information about
>   an object (value and attributes).


The pdb that ships with ipython is also modified to have tab completion, color
highlighting for listings and better stack handling than the default pdb. 
With tab completion, it is trivial to explore an object dynamically (better
IMHO than dumping a potentially gigantic namespace on screen).

Regards,

f





More information about the Python-list mailing list