GDB - Examining Data

From EdWiki

Examining Data

  • So far you’ve learned how to interrupt program flow at fixed, specified points, and how to continue stepping line-by-line.
  • However, sooner or later you’re going to want to see things like the values of variables, etc.
  • The print command prints the value of the variable specified, and print/x prints the value in hexadecimal:
(gdb) print my_var
(gdb) print/x my_var