using python to print inferior values

Joachim Protze
Tue Aug 10 08:27:00 GMT 2010

Am 10.08.2010 03:51, schrieb Mathew Yeates:
> Okay. I'm stumped. I have an integer named foo. How do I print it's value?
> This is gdb-weekly-CVS-
> -Mathew

(gdb) python print gdb.selected_frame().read_var("foo")

If you want to typecast it in c-space first:

(gdb) python print gdb.parse_and_eval("(unsigned int)foo")


More information about the Gdb mailing list