Skip to content

Instantly share code, notes, and snippets.

@kolygri
Created August 21, 2019 06:32
Show Gist options
  • Save kolygri/18d0a0d90f4651d30ef8fa444333ca47 to your computer and use it in GitHub Desktop.
Save kolygri/18d0a0d90f4651d30ef8fa444333ca47 to your computer and use it in GitHub Desktop.
# help: Print the list of all commands
h
# help: Print help about the certain command
h break
# print: Print the value of the expression
p some_obj
pp some_obj
# Print detailed information about the object
pinfo some_obj
pinfo2 some_obj
# args: Print arguments with their values of the current function
a
# list: List 11 lines of source code around the current line
l
# list: List 11 lines of source code around line 123
l 123
# longlist: List all source code for the current function or frame
ll
# jump: Jump to line 123, skip the execution of anything between
j 123
# args: List all arguments of the current function
a
# step: Execute code line by line, it may jump to another frame when a function call is encountered
s
# next: Execute code line by line, it doesn't enter functions called from the statement being executed
n
# return: Continue execution until the current function returns.
r
# continue: Continue execution, only stop when a breakpoint is encountered
c
# break: List all breakpoints
b
# break: Set a breakpoint at line 123
b 123
# break: Set a breakpoint at line 123 of file.py
b path/to/file.py:123
# break: Set a breakpoint on some_func that will be triggered if some_arg == 0
b some_func, some_arg == 0
# clear: Clear all breakpoints
clear
# where: Print a stack trace
w
# up: Move the current frame one level up in the stack trace
u
# down: Move the current frame one level down in the stack trace
d
# quit: Quit debugging
q
# use ! to run Python code that may conflict with pdb's built-in commands
!r = 123
!r = 123; c = 455
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment