[Qt-creator] CDB QList debugging helpers problem

Robert Caldecott robert.caldecott at gmail.com
Tue Jul 7 08:25:41 CEST 2009


I have found an issue where the contents of a QList will not display when
debugging using CDB.  I am running XP SP3 with Qt Creator 1.2 and a MSVC9
build of Qt 4.5.2.  The following sample code shows the problem:


#include <QtCore/QCoreApplication>
#include <QString>
#include <QList>

class Foo
{
public:
   Foo(const QString& str, const int n) :
           str_(str), n_(n)
   {
   }
private:
   QString str_;
   int n_;
};

int main(int argc, char *argv[])
{
   QCoreApplication a(argc, argv);

   QList<Foo> list;
   list.append(Foo("Hello", 1));
   list.append(Foo("World", 2));

   return a.exec();
}


If you put a breakpoint on the 'return a.exec()' line and attempt to inspect
the contents of 'list', the two 'Foo' items are not displayed.  If I use
gdb, then it works perfectly and I can display each 'Foo' object.
I thought that QList was supported with CDB?  Certainly QStringLists work
OK.

I have attached some screen dumps showing the differences between CDB and
gdb that I am seeing.

If I can get a build of Qt Creator that fixes the gdb restart bug then I
will stop using CDB for now, as even though it is faster, the gdb debugging
helpers are much more useful IMHO.

[image: cdb-qlist.png][image: gdb-qlist.png]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20090707/b1b4843e/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 10820 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20090707/b1b4843e/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 10216 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20090707/b1b4843e/attachment-0001.png 


More information about the Qt-creator-old mailing list