Useful GDB and PDB Commands

Published: 24 Jul 2015 Category: linux_study

gdb --arg python demo.py 2>&1 | tee demo.log

import pdb
pdb.set_trace()

Shortcuts:

q quit

h help

b break, example: b 5

h command print command meaning

disable codenum

enable codenum

condition codenum xxx set break condition

c continue

n next

s step

w print code in current execution point

j codenum jump to line j

l list nearby code

p print var value

a print current func/var value

Enter repeat last command