This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug python/17728] gdb.LazyString is confused by typedefs
- From: "jwakely.gcc at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Thu, 18 Dec 2014 14:00:50 +0000
- Subject: [Bug python/17728] gdb.LazyString is confused by typedefs
- Auto-submitted: auto-generated
- References: <bug-17728-4717 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=17728
--- Comment #1 from Jonathan Wakely <jwakely.gcc at gmail dot com> ---
This seems odd:
(gdb) python print StrPrinter(gdb.parse_and_eval('foo')).to_string().type
const char
(gdb) python print StrPrinter(gdb.parse_and_eval('bar')).to_string().type
Bar::pointer
https://sourceware.org/gdb/onlinedocs/gdb/Lazy-Strings-In-Python.html says type
"will always be a pointer type" but the lazy string for foo is not a pointer.
The lazy string for bar is a typedef for a pointer, but doesn't work correctly.
Also odd:
(gdb) python print StrPrinter(gdb.parse_and_eval('foo')).to_string().value()
102 'f'
(gdb) python print StrPrinter(gdb.parse_and_eval('bar')).to_string().value()
0x4006b4 "bar"
The LazyString.value() method shows the right thing for bar, but not for foo
(which is at least consistent with the .type attribute which says that foo's
type is just a char not a char*)
--
You are receiving this mail because:
You are on the CC list for the bug.