In continuation of
http://tech.queryhome.com/51444/gdb-cheat-sheet-part-1
http://tech.queryhome.com/51818/gdb-cheat-sheet-part-2
Variables and memory
Print content of variable/memory/register
gdb> print/format <what>
Print the information after each stepping instruction
gdb> display/format <what>
Enable Display
gdb> enable display <display#>
Disable Display
gdb> disable display <display#>
Print memory
gdb> x/nfu <address>
n: How many units to print (default 1).
f: Format character.
u: Unit - b: Byte, h: Half-word (two bytes) w: Word (four bytes) g: Giant word (eight bytes)
Manipulating the program
Change the content of a variable to the given value.
gdb> set var <variable_name>=<value>
gdb> return <expression>
Code Sources
Add directory to the list of directories that is searched for sources
gdb> directory <directory>
Listing the Code
gdb> list
gdb> list <filename>:<function>
gdb> list <filename>:<line_number>
gdb> list <first>,<last>
Get Informations
gdb> disassemble
gdb> disassemble <where>
gdb> info args
gdb> info breakpoints
gdb> info display
gdb> info locals
gdb> info sharedlibrary
gdb> info signals
gdb> info threads
gdb> show directories
gdb> show listsize
gdb> whatis variable_name