[Qt-creator] gdb Debugg Helpers - typedef bug
André Pönitz
andre.poenitz at nokia.com
Mon Jul 20 12:19:57 CEST 2009
On Sunday 19 July 2009 20:54:33 ext Robert Caldecott wrote:
> I think this may of been posted before but if you typedef a QMap,
> QList, etc. you cannot view the contents with the debugging helpers,
> e.g.:
>
> #include <QtCore/QCoreApplication>
> #include <QMap>
> #include <QString>
> #include <QListv
>
> int main(int argc, char *argv[])
> {
> QCoreApplication a(argc, argv);
> QMap<QString, QString> map1;
> map1["Hello"] = "World!";
>
> typedef QMap<QString, QString> Map;
> Map map2;
> map2["Hello"] = "World!";
>
> QList<int> list1;
> list1.append(1234);
>
> typedef <int> List;
> List list2;
> list2.append(1234);
> return a.exec();
> }
>
> map1 and list1 are fine, map2 and list2 won;t display. I am on the
> latest 1.2.1 on XP SP3.
That's closer to a missing feature than to a bug, at least not in Creator.
The type reported by gdb is 'List'. I could resolve this to 'QList<int>'
'manually', However, doing so would generally impact the debugging
helper performance as this would need an additional roundtrip for
each item in the Locals&Watchers view (and an roundtrip takes
several dozen milliseconds even on fast machines, so we are talking
about slowing down each 'step' by a second or so.)
You can get a 'nice' display of list2 'manually' by creating a 'Watcher'
with expression *('QList<int>'*)&list2 .
I understand this is neither obvious nor convenient, but I am also
a bit afraid of the general slowdown.
So for now I am tempted to leave it as it is.
Andre'
More information about the Qt-creator-old
mailing list