pydb [was: The DDD tree ...]

"R. Bernstein" <[email protected]>
Newsgroups gmane.comp.debugging.ddd.general
Message-ID <[email protected]>
David Relson writes:
 > Perchance, does the latest pydb remember breakpoints after a restart
 > command?  That's the feature I'd most like to see!

It's there. The older pydb didn't have a gdb "run" command, so ddd
*had* to do an "exec" of the program to restart.  The exec breakpoints
and any other debugger state. 

Interestly, the pydb program didn't offer a "restart" as a debugger
command -- ddd did this *outside* of the pydb. (So be grateful that
ddd even gave you that, because outside of ddd there wasn't even
that and still isn't in the stock python debugger pdb.)

When I started working on a Python debugger, the very first thing I
added *was* "run". In fact it was added even before I called the
debugger pydb! (Originally all I was doing was extending the stock
debugger pdb; there's a patch submitted around Jan '06 to the Python
pdb sources gathering dust.)

In current pydb, there is also a "restart" command which does a
re-exec. And sometimes that's really what you want. For example
"imports" occur only once so "restart" would be needed here if you
wanted to debug into an import.

I mention this in the litle demo of some pydb features that I made 
recently:

http://showmedo.com/videos/video?name=pythonBernsteinPydbIntro&fromSeriesID=28

 > 
 > Also, whenever I've tried the pp command, the result is the same as
 > the p command.  

It helps to understand what each does. ;-) 

And you can find the difference described somewhat cryptically here:
   http://bashdb.sourceforge.net/pydb/pydb/lib/subsection-data.html

(In the next pydb release I've expanded that a little to add a link to
the corresponding pprint documentation.)

 > Is there anything special I should do to get
 > different/better output?

If you have Python 2.5 installed that will give different/better
output for dictionaries. :-)

Personally, I don't use "p" all that much. The only thing it provides
is a repr() wrapping which elides output and ensures circular
references don't loop indefinitely. But most of the time I don't want
that as elision, and usually my objects aren't circular.

And I when want more detail about an object, I use examine, which uses
pprint output.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.