This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: python: get string of gdb.value
- From: Andrà PÃnitz <andre dot poenitz at nokia dot com>
- To: gdb at sourceware dot org
- Date: Fri, 6 May 2011 19:20:42 +0200
- Subject: Re: python: get string of gdb.value
- References: <20110506150453.71920@gmx.net>
On Friday 06 May 2011 17:04:53 ext Klaus Rudolph wrote:
> Hi all,
>
> I have a gdb.value object, which is of a type my_enum_type_t and holds a value of 'ONE' which is int 6.
>
> if I write
> print var
> the output is 'ONE'
> bit if I try to do:
>
> if var == 'ONE':
enum E { ONE = 6 };
E e = ONE;
python print str(gdb.parse_and_eval("e")) == "ONE"
-> True
Regards
Andre'