[Qt-creator] CDB debug helpers bug with reference parameters

Andre Poenitz andre.poenitz at mathematik.tu-chemnitz.de
Mon Jul 6 18:48:13 CEST 2009


On Mon, Jul 06, 2009 at 09:47:08AM +0100, Robert Caldecott wrote:
> 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.

Thanks for the report.

Andre'



More information about the Qt-creator-old mailing list