Emacs and pdb after upgrading to Ubuntu Feisty

levander levander404 at gmail.com
Sun May 6 00:46:28 EDT 2007


I've been using pdb under emacs on an Ubuntu box to debug python
programs.  I just upgraded from Ubuntu Edgy to Feisty and this combo
has stopped working.  Python is at 2.5.1 now, and emacs is at 21.41.1.

It used to be I could just "M-x pdb RET pdb <script-name> RET" and be
presented with a prompt where I could debug my script, as well as an
arrow in another source code buffer indicating where I am in the
source code.

Now however, when I do "M-x pdb RET pdb ~/grabbers/npr-grabber.py -s
WESUN", I get this is in a buffer called *gud*:

Current directory is /home/levander/grabbers/

No prompt or anything follows it, just that one line.  It doesn't pop
up an arrow in the other buffer either.  None of the regular commands
like 'n', 's', or 'l' do anything here.  So, I did a 'Ctrl-C' and got:

> /home/levander/grabbers/npr-grabber.py(24)<module>()
-> """
(Pdb) > /home/levander/grabbers/npr-grabber.py(30)<module>()
-> import getopt
(Pdb) Traceback (most recent call last):
  File "/usr/bin/pdb", line 1213, in main
    pdb._runscript(mainpyfile)
  File "/usr/bin/pdb", line 1138, in _runscript
    self.run(statement, globals=globals_, locals=locals_)
  File "bdb.py", line 366, in run
    exec cmd in globals, locals
  File "<string>", line 1, in <module>
  File "/home/levander/grabbers/npr-grabber.py", line 30, in <module>
    import getopt
  File "/home/levander/grabbers/npr-grabber.py", line 30, in <module>
    import getopt
  File "bdb.py", line 48, in trace_dispatch
    return self.dispatch_line(frame)
  File "bdb.py", line 66, in dispatch_line
    self.user_line(frame)
  File "/usr/bin/pdb", line 144, in user_line
    self.interaction(frame, None)
  File "/usr/bin/pdb", line 187, in interaction
    self.cmdloop()
  File "cmd.py", line 130, in cmdloop
    line = raw_input(self.prompt)
KeyboardInterrupt
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> /home/levander/grabbers/cmd.py(151)cmdloop()
-> pass
(Pdb)

It's wierd because at the bottom of that call stack, it does look like
it's wating for input, but no input works...  And, after I hit Ctrl-C
I do get a prompt as you see at the bottom of that listing just
above.  Now I type "quit" and get:

Post mortem debugger finished. The /home/cponder/grabbers/npr-
grabber.py will be restarted

Anybody can tell me who to get pdb working under emacs on Ubuntu
Feisty?




More information about the Python-list mailing list