[Qt-creator] CDB debug helpers bug with reference parameters
Robert Caldecott
robert.caldecott at gmail.com
Mon Jul 6 10:47:08 CEST 2009
I am using Qt Creator 1.2 on Windows XP SP3 with a MSVC9 build of Qt
4.5.2 and the MS CDB cannot show Qt objects when they are passed to a
function by reference. For example:
#include <QtCore/QCoreApplication>
#include <QString>
void test(const QString& str)
{
// Do something with str
}
int main(int argc, char *argv[])
{
QString str = "Hello, world!";
test(str);
return 0;
}
If you put a breakpoint in 'main' on the 'test(str)' line, the
contents of the 'str' QString display fine. If you then step into the
'test' function then the passed QString contents are not displayed and
instead look like this:
str 0x0012ff58 class QString* QString*
I tried again using gdb and this works fine (but only the first time I
run Qt Creator due to the known issue with restarting gdb...).
I tend to use a lot of foreach loops with const reference parameters -
foreach (const QString& str, list) - and so this bug is quite
frustrating.
Regards.
More information about the Qt-creator-old
mailing list