using python to print inferior values

Joachim Protze joachim.protze@wh2.tu-dresden.de
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-7.2.50.20100713
> 
> -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")

-Joachim



More information about the Gdb mailing list