[Qt-creator] Qt creator, gdb and anonymous unions.
André Pönitz
andre.poenitz at nokia.com
Mon Feb 15 17:19:31 CET 2010
On Sunday 14 February 2010 19:08:35 ext Andre Poenitz wrote:
> On Sun, Feb 14, 2010 at 09:38:26PM +0900, paulo wrote:
> > Hi friends at the qt-creator mailing list.
> >
> > I'm wondering if it's possible to get qt-creator debugger view to show
> > some anonymous unions the same way gdb does.
> >
> > That is, for something like:
> > struct A {
> > union {
> > struct { float b; };
> > struct { float c; };
> > };
> > } a;
> >
> > a.b = 0;
> >
> > gdb will print p a:
> > $1 = {{b = 0},{c = 0}}
> >
> > on the other hand qt-creator just says it's an anonymous union and will
> > refuse to print visualize anything, making me add it by hand to the
> > watchers window (very annoying).
>
> I works for a 'plain' anonymous union, but you have nested anonymous
> structs, too. This is an oversight on my part, I'll have a look tomorrow.
Ok. This is fixed now for "python enabled" versions of gdb, both for
display and editing.
For non-python gdb there's no direct solution. gdb/MI does not seem
to give access to the necessary data in this case. I can work around
and manually extract data from gdb/CLI output, but I am not sure this
is worth the trouble. Do you use such nested anon structures often?
Andre'
More information about the Qt-creator-old
mailing list