Snippet GDB cheat sheet

Snippet The command for GDB debug

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Start GDB with a core file
gdb program corefile

# Show backtrace
bt

# Check local variables
info locals

# Check arguments
info args

# Navigate through stack frames
frame 1

# List the souce code
list

# Inspect memory
x/8x 0x12345678

# Step over
n

# Step into
s

# Step out
finish

# Quit
q