[Qt-interest] qt creator can't evaluate expression when debugging?
Thiago Macieira
thiago at kde.org
Tue Sep 13 19:55:24 CEST 2011
On Tuesday, 13 de September de 2011 23.41.07, Li Li wrote:
> hi all,
> I am using qt creator to debug. I have a QUrl local variable. I want to
> view it's value. But Locals and Expressions view don't show anything. And I
> add a line: QString ss=qurl.toString(); the locals and expressions view
> can display local variable ss. So I Insert NewWatch Item qurl.toString().
> but it says <no such values>. I also tried QString::number(1). it can't
> even evaluate this! What's wrong with it? I am using qt sdk 1.1.2 in
> ubuntu.
Calling C++ methods that allocate objects is very unstable in gdb. And you
shouldn't try, because the destructor is never run, so you're just going to
leak memory forever in gdb.
I'm actually surprised that I *could* call the method at all. Calling a method
that returns a non-trivial object (in the ABI's definition of "non-trivial")
requires the caller allocating space and passing an implicit first parameter.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110913/821bddf0/attachment.bin
More information about the Qt-interest-old
mailing list