Breakpoints?

Asked by Nikolay Kudryavtsev

Hello.

I'm trying to use breakpoints with python-mode and so far I had no luck. Is there something I'm missing?

When I set normal pdb breakpoint. I get this:
> <stdin>(25)<module>()
(Pdb)
Traceback (most recent call last):
  File "<stdin>", line 25, in <module>
  File "<stdin>", line 25, in <module>
  File "C:\Python33x32\lib\bdb.py", line 47, in trace_dispatch
    return self.dispatch_line(frame)
  File "C:\Python33x32\lib\bdb.py", line 66, in dispatch_line
    if self.quitting: raise BdbQuit
bdb.BdbQuit

If I set ipdb breakpoint i get:
ipdb>
Exiting Debugger.

This tutorial seems to suggest that setting breakpoints like this worked at least in 2010:
http://pedrokroger.net/2010/07/configuring-emacs-as-a-python-ide-2/

Question information

Language:
English Edit question
Status:
Answered
For:
python-mode.el Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Andreas Roehler (a-roehler) said :
#1

WRT to the recipe given, you need two parts in your code

first

import pdb

in order to import the debugging module.
If using ipdb, import ipdb

Then set the breakpoint in your code, by inserting

pdb.set_trace()

resp. ipdb.set_trace() when using ipdb

When Python reaches the spot, debugger should appear.

Please open a bug-report, giving some more details, emacs-version etc. should that not work that way.
Maybe send some example code, which triggers the bug.

Can you help with this problem?

Provide an answer of your own, or ask Nikolay Kudryavtsev for more information if necessary.

To post a message you must log in.