pdb-python

How do you break into the debugger from Python source code?

What do you insert into Python source code to have it break into pdb (when execution gets to that spot)? ...

Is there a free python debugger that has watchpoints?

pdb and winpdb both seem to be missing this essential (to me) feature. I saw something suggesting WingIDE has it but I'd prefer a solution that is free, and if I do have to pay, I'd prefer to pay for something that is better than Wing. ...

Python debugger: Stepping into a function that you have called interactively

Python is quite cool, but unfortunately, its debugger is not as good as perl -d. One thing that I do very commonly when experimenting with code is to call and step into a function interactively, like such: # NOTE THAT THIS PROGRAM EXITS IMMEDIATELY WITHOUT CALLING FOO() ~> cat -n /tmp/show_perl.pl 1 #!/usr/local/bin/perl 2 3 sub fo...

How to show the output of 'l' in python pdb after every command entered

I would like to have the output of the python pdb 'l' command printed to the screen after every command I enter in an interactive debugging session. Is there a way to setup python pdb to do this? ...

Can I make pdb start debugging right away?

I want to debug a python project The problem is, I don't know where to set a break point, what I want to do, is be able to call a method SomeClass( some_ctor_arguments ).some_method()` and have the debugger be fired right away How do I do that? I tried pdb.run( string_command ) but it doesn't seem to work right >>> import pdb >>...

How to make pdb recognize that the source has changed between runs?

From what I can tell, pdb does not recognize when the source code has changed between "runs". That is, if I'm debugging, notice a bug, fix that bug, and rerun the program in pdb (i.e. without exiting pdb), pdb will not recompile the code. I'll still be debugging the old version of the code, even if pdb lists the new source code. So, doe...

Getting pdb-style caller information in python

Let's say I have the following method (in a class or a module, I don't think it matters): def someMethod(): pass I'd like to access the caller's state at the time this method is called. traceback.extract_stack just gives me some strings about the call stack. I'd like something like pdb in which I can set a breakpoint in someMeth...

How do you pass script arguments to pdb (Python)?

I've got python script (ala #! /usr/bin/python) and I want to debug it with pdb. How can I pass arguments to the script? ...

Is it possible to go into ipython from code?

For my debugging needs,pdb is pretty good. However, it would be MUCH cooler ( and helpful ) if I could go into ipython. Is this thing possible? ...

How do I set sys.excepthook to invoke pdb globally in python?

From Python docs: sys.excepthook(type, value, traceback)¶ This function prints out a given traceback and exception to sys.stderr. When an exception is raised and uncaught, the interpreter calls sys.excepthook with three arguments, the exception class, exception instance, and a traceback object. In an interactive session this ...

cannot override sys.excepthook

I try to customize behavior of sys.excepthook as described by the recipe. in ipython: :import pdb, sys, traceback :def info(type, value, tb): : traceback.print_exception(type, value, tb) : pdb.pm() :sys.excepthook = info :-- >>> x[10] = 5 ------------------------------------------------- Traceback (most recent call last): File...

In pdb how do you reset the list (l) command line count?

From PDB (Pdb) help l l(ist) [first [,last]] List source code for the current file. Without arguments, list 11 lines around the current line or continue the previous listing. With one argument, list 11 lines starting at that line. With two arguments, list the given range; if the second argument is less than the first, it is ...

python pdb not breaking in files properly?

Hi Folks, I wish I could provide a simple sample case that occurs using standard library code, but unfortunately it only happens when using one of our in-house libraries that in turn is built on top of sql alchemy. Basically, the problem is that this break command: (Pdb) print sqlalchemy.engine.base.__file__ /prod/eggs/SQLAlchemy-0.5....

Running commands from a file in PDB

I would like to run a set of python commands from a file in the PDB debugger. Related to this, can I set up a file that is automatically run when PDB starts? ...

IronPython and pdb.set_trace()

Does anyone know if IronPython 2.6 is planned to have support for pdb.set_trace() to enable setting breakpoints in an ironpython module? If not does anyone have a suggestion for accomplishing this without pdb? ...

Why is pdb displaying "*** Blank or comment" when I try to set a Break?

I'm working with my Django app. For some reason an element of a list is being assigned incorrectly. I'm trying to set a break where I think the error is occurring. ( line 20 ) I'm invoking pdb with this line of code: import pdb; pdb.set_trace() However, inside the code, I can't seem to set a Break. (Pdb) b 20 *** Blank or comment ...

best way to deal with python pdb flakiness re/stdout?

I love python and hate the pdb debugger. For instance, if I have a program where stdout is redirected, my pdb prompts all go to the redirection, because the library was written to write to stdout. Oftentimes this problem is subtle, causing me to think a program is hanging when it's really waiting for input. How do people work around ...

Making filenames/linums linkable in emacs gud buffer

I'm running pdb on my testcases in Python through the gud buffer. When I get a stacktrace/failure in my testcase, it looks like this: FAIL: test_foo_function (__main__.TestFoo) ---------------------------------------------------------------------- Traceback (most recent call last): File "test/testfoo.py", line 499, in test_foo_functi...

How can I step into pdb to diagnose this error on a production server? ProgrammingError(1110, "Column 'about' specified twice"

ProgrammingError(1110, "Column 'about' specified twice" /usr/local/lib/python2.5/site-packages/MySQLdb/connections.py errorclass <class '_mysql_exceptions.ProgrammingError'> errorvalue ProgrammingError(1110, "Column 'about' specified twice") This error seems to be happening here in django_authopenid/views.py: if 'bnewa...

Using a debugger and curses at the same time?

I'm calling python -m pdb myapp.py, when an exception fires, and I'd normally be thrown back to the pdb interpreter to investigate the problem. However this exception is being thrown after I've called through curses.wrapper() and entered curses mode, rendering the pdb interpreter useless. How can I work around this? ...