gdb - adhuliya/ws-misc GitHub Wiki
GDB Tutorial Handout
Notes on-
Compile a program with
-g
flag added. For example,gcc [other flags] -g <source files> -o <output file>
-
info registers
shows all the registers;info registers eax
shows just the register eax. The command can be abbreviated asi r
. -
info all-registers
gives a larger list of registers thaninfo registers
. -
display $esp
continue display esp registers in gdb command line. -
x $eax
shows the contents at address the eax has as its contents.
See Also: https://stackoverflow.com/questions/5429137/how-to-print-register-values-in-gdb