[Qt-creator] Qt creator, gdb and anonymous unions.
paulo
paulo.jnkml at gmail.com
Wed Feb 17 14:14:59 CET 2010
Hi,
the py script now works for nested anonymous unions, but apparently the
hash used in the process (inconveniently) sorts the names.
I think it would be better to keep the groupings. (just remove the sorting)
ex:
struct S {
union {
struct { float a, z; };
struct { float b, y; };
};
} s;
sould be formatted as:
$1 +
+-+a
| +z
|
+-+b
+x
and not
$1 +
+a
+b
+y
+z
Cheers,
Paulo
André Pönitz wrote:
> 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'
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-creator
>
More information about the Qt-creator-old
mailing list