GDB - Examining Data

From EdWiki

Revision as of 09:31, 23 June 2015 by Jshankar (Talk | contribs) (1 revision imported: EdWiki -- Emsys pages from Shukra)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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