Common pdb commands:

  • n (next): Execute the current line and move to the next line.
  • s (step): Step into a function call.
  • r (return): Continue execution until the current function returns.
  • c (continue): Continue execution until the next breakpoint or end of the program.
  • l (list): Show the current location in the code and a few surrounding lines.
  • p (print): Print the value of a variable.
  • pp (pretty-print): Print the value of a variable in a formatted way.
  • b <line_number> (breakpoint): Set a breakpoint at the specified line number. - cl <breakpoint_number> (clear): Clear a breakpoint.
  • w (where): Show the current position in the call stack.
  • u (up): Move up one level in the call stack.
  • d (down): Move down one level in the call stack.
  • q (quit): Exit the debugger.