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