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

And I’ve answered my own question! It’s the “debug” command in pydb: ~> cat -n /tmp/test_python.py 1 #!/usr/local/bin/python 2 3 def foo(): 4 print “hi” 5 print “bye” 6 7 exit(0) 8 ~> pydb /tmp/test_python.py (/tmp/test_python.py:7): <module> 7 exit(0) (Pydb) debug foo() ENTERING RECURSIVE DEBUGGER ————————Call level 11 (/tmp/test_python.py:3): foo 3 def foo(): ((Pydb)) s … Read more

Is it possible to step backwards in pdb?

The GNU debugger, gdb: It is extremely slow, as it undoes single machine instruction at a time. The Python debugger, pdb: The jump command takes you backwards in the code, but does not reverse the state of the program. For Python, the extended python debugger prototype, epdb, was created for this reason. Here is the … Read more

Attaching a process with pdb

At this time, pdb does not have the ability to halt and begin debugging on a running program. You have a few other options: GDB You can use GDB to debug at the C level. This is a bit more abstract because you’re poking around Python’s C source code rather than your actual Python script, … Read more

How do you watch a variable in pdb

data breakpoints with pdb …much like you can watch a memory address in gdb… GDB uses data breakpoints, this is made easy with hardware support (hardware watchpoints), this typically involves marking the memory pages read-only which then trips an exception handler on memory access. When hardware watchpoints are not available it uses software watchpoints, these … Read more

Getting started with the Python debugger, pdb [closed]

Here’s a list of resources to get started with the Python debugger: Read Steve Ferb’s article “Debugging in Python” Watch Eric Holscher’s screencast “Using pdb, the Python Debugger” Read the Python documentation for pdb — The Python Debugger Read Chapter 9—When You Don’t Even Know What to Log: Using Debuggers—of Karen Tracey’s Django 1.1 Testing … Read more