[Qt-creator] gdb Debugg Helpers - typedef bug

Nico Kruber kruber at zib.de
Mon Jul 20 12:42:51 CEST 2009


On Monday 20 July 2009 12:19:57 André Pönitz wrote:
> 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  .

Couldn't you add the "QList<int>" to the view as if it was a super-class of 
List and only evaluate it further if the user expands that view with the 
little "+" symbol?
-> that way you won't slow down the process on default but allow for further 
evaluation..

Nico
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20090720/c2bc12d5/attachment.bin 


More information about the Qt-creator-old mailing list