Difference between revisions of "Cheat Sheet"

m (Gnu Debugger (gdb))
m (Gnu Debugger (gdb))
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Gnu Debugger (gdb)  ==
 
== Gnu Debugger (gdb)  ==
 
<syntaxhighlight  lang=shell-session highlight="" line>
 
<syntaxhighlight  lang=shell-session highlight="" line>
# Navigation
+
 
 +
## Running
 +
gdb <program>
 +
gdb --args
 +
gdb --pid
 +
 
 +
set args
 +
run
 +
kill
 +
 
 +
## Navigation
 
info functions
 
info functions
 
info variables
 
info variables
 
info scope <function name>
 
info scope <function name>
  
### debugging
+
## Debugging
# Set a breakpoint
+
# Breakpoints
 
break *_start
 
break *_start
 +
delete breakpoint#
 +
clear # delete all
 +
enable/disable breakpoint#
  
# Move forward / step
+
# Watchpoints
 +
watch *_start
 +
delete/enable/disable watchpoint#
 +
 
 +
# Move around
 
move
 
move
 
m
 
m
 
step
 
step
 
s
 
s
 +
finish
 +
f
 +
continue
 +
c
 +
</syntaxhighlight>
 +
 +
== nm / Name List ==
 +
<syntaxhighlight  lang=shell-session highlight="" line>
 +
## Symbol Types
 +
A: Absolute Type
 +
B: In the uninitialized data section (BSS)
 +
D: In the initialized data section
 +
N: Debugging Symbol
 +
T: In the text section
 +
U: Undefined symbol
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 14:55, 24 May 2018

Gnu Debugger (gdb)

## Running
gdb <program>
gdb --args
gdb --pid

set args
run
kill

## Navigation
info functions
info variables
info scope <function name>

## Debugging
# Breakpoints
break *_start
delete breakpoint#
clear # delete all 
enable/disable breakpoint#

# Watchpoints
watch *_start
delete/enable/disable watchpoint#

# Move around
move
m
step
s
finish
f
continue
c

nm / Name List

## Symbol Types
A: Absolute Type
B: In the uninitialized data section (BSS)
D: In the initialized data section
N: Debugging Symbol
T: In the text section
U: Undefined symbol