Any good debuggers for Python? (was Re: using python debugger (pdb) inside emacs debugger mode ...)

Randall Hopper aa8vb at yahoo.com
Fri Sep 17 16:51:06 EDT 1999


Philip Lijnzaad:
 |Does anyone have experience with using M-x pdb inside emacs? This part of
...
 |then it gets stuck when stepping into a module that it can't find because
 |os.getcwd() is wrong.
 |
 |Aaarggh! what am I doing wrong? Any comments appreciated!

I feel your pain.  I spent several hours this week trying to find a
source-tracking debugger for Python that works well.  No luck.

[ Is there a "Python Debugger HOW-TO" lurking out there? ]

Of what I tried, PyDB with DDD is very cool:

     http://www.ipass.net/~dbhopper/aa8vb/TMP/DDD-PyDb.tif

This is the kind of interface I'm looking for.  Full source browse and
tracking, click to set a breakpoint, click to examine/watch a variable,
etc.  However it terminates abnormally a good bit, particularly with
multi-module programs.

 |This is in emacs 20.3, but emacs 20.4 has the same gud.el 

I'd like one for Emacs myself (ala gdb/dbx with source tracking).  GNU if
possible but I'll do XEmacs if needed.  However, no luck with the brief try
I gave PDB/pdb.el/XEmacs.  User friendly PDB is not (see attached for your
amusement).

No time to continue this search now.  Possibly the best route is to dig in
and help beef up PyDB.

Randall




-------------------------------------------------------------------------------
NEWBIE PDB SESSION (for your amusement)
  - Python's terse error msgs don't help
  - "<string>(0)?()" ?
-------------------------------------------------------------------------------

> python
Python 1.5.2 (#3, Jul  8 1999, 11:01:48) [C] on irix646-n32
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import pdb
>>> import MyModule   
>>> pdb.run( 'MyModule.run()' )
> <string>(0)?()
(Pdb) where
> <string>(0)?()
(Pdb) list
[EOF]
(Pdb) run
*** NameError: run
(Pdb) r
> <string>(1)?()
(Pdb) cont
en> <string>(0)?()
(Pdb) where
> <string>(0)?()
(Pdb) KeyboardInterrupt: <exceptions.K...e at 10281ee0>
> <string>(1)?()
(Pdb) where
> <string>(1)?()
  MyModule.py(615)run()
-> import pdb; pdb.run( 'root.mainloop()' )
  /home/rhh/software/python-1.5.2/lib/python1.5/pdb.py(855)run()
-> Pdb().run(statement, globals, locals)
  /home/rhh/software/python-1.5.2/lib/python1.5/bdb.py(343)run()
-> exec cmd in globals, locals
  <string>(0)?()
  <string>(0)?()
  /home/rhh/software/python-1.5.2/lib/python1.5/bdb.py(39)trace_dispatch()
-> return self.dispatch_line(frame)
  /home/rhh/software/python-1.5.2/lib/python1.5/bdb.py(51)dispatch_line()
-> self.user_line(frame)
  /home/rhh/software/python-1.5.2/lib/python1.5/pdb.py(90)user_line()
-> self.interaction(frame, None)
  /home/rhh/software/python-1.5.2/lib/python1.5/pdb.py(113)interaction()
-> self.cmdloop()
  /home/rhh/software/python-1.5.2/lib/python1.5/cmd.py(73)cmdloop()
-> line = raw_input(self.prompt)
(Pdb) print MyModule.run
<function run at 10265278>
(Pdb) print MyModule.run.root
*** AttributeError: root
(Pdb) quit
>>> 




More information about the Python-list mailing list