gdb - adhuliya/ws-misc GitHub Wiki

Notes on GDB Tutorial Handout

  • 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 as i r.

  • info all-registers gives a larger list of registers than info 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