[Qt-creator] Debugging Helper broken in 1.2?
Kendall Bennett
KendallB at amainhobbies.com
Wed Jul 8 23:52:07 CEST 2009
I did not get a response to this email. After thinking about this some more I think the solution to this problem is to create a custom debug helper for my typedef types? Where do I find information on creating custom debug helpers?
Regards,
Kendall Bennett, CEO
A Main Hobbies
424 Otterson Drive, Suite 160
Chico, CA 95928
1-800-705-2215 (Toll-Free)
1-530-894-0797 (Int'l & Local)
1-530-894-9049 (Fax)
http://www.amainhobbies.com
________________________________
From: Kendall Bennett <kendallb at amainhobbies.com>
Date: Tue, 07 Jul 2009 10:16:06 -0700
To: <qt-creator at trolltech.com>
Conversation: [Qt-creator] Debugging Helper broken in 1.2?
Subject: Re: [Qt-creator] Debugging Helper broken in 1.2?
Hi Andre',
I just tried the skip frames option, and it works great! I still have to step through inline constructor stuff that is still 'user code', but it does skip a lot of cruft in other places that was getting annoying.
Anyway, now that I saw this thread I started digging into the debug helpers, and I must say they are very cool! Seems to work nicely for me on Qt 1.2 on Mac OS, except I am seeing a similar problem to the Windows guys; simply that when I check the 'User debug helper' box, it always gets cleared. But in my case the debug helpers always work no matter what, so that is not an issue (but it did confuse me for a bit, as I will explain below).
So, the first thing I did is debug some of my code that is using Qlist's. Much to my dismay my Qlists's just showed up as anonymous unions, and I was not seeing anything useful. Hmm. Maybe I just did not understand how it was supposed to work, as my Qstring's looked nicely formatted. Then I saw a post from someone else about a bug they saw on Windows, with some sample code. I fired up the sample code and it worked just great in my version of Qt Creator! So, my next question was, why did my Qlist's not show up directly in the debugger? Simple. I used a typedef.
Here is some sample code showing that if you use a typedef on the Qlist type to simplify things, the debug helpers won't work. I have attached a screenshot of the debugger showing you the difference.
#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_;
};
typedef QList<Foo> FooList;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
FooList list;
list.append(Foo("Hello", 1));
list.append(Foo("World", 2));
QList<Foo> list2;
list2.append(Foo("Hello", 1));
list2.append(Foo("World", 2));
return a.exec();
}
Regards,
Kendall Bennett, CEO
A Main Hobbies
424 Otterson Drive, Suite 160
Chico, CA 95928
1-800-705-2215 (Toll-Free)
1-530-894-0797 (Int'l & Local)
1-530-894-9049 (Fax)
http://www.amainhobbies.com
________________________________
From: Andre Poenitz <andre.poenitz at mathematik.tu-chemnitz.de>
Reply-To: <qt-creator at trolltech.com>
Date: Fri, 26 Jun 2009 10:20:14 -0700
To: <qt-creator at trolltech.com>
Subject: Re: [Qt-creator] Debugging Helper broken in 1.2?
On Fri, Jun 26, 2009 at 01:22:47AM +0300, Patric wrote:
> for and skip known frames when stepping.
This is useful for single stepping. Single stepping Qt code is usually a
bit annoying as half of the time you walk through "uninteresting" code,
like reference counting or container accesses or such. With this option
checked, Creator compares the top most stack frame with a fixed set of
"uninteresting code" and continues to single-step until some "interesting"
code is met. User code is by definition "interesting".
Someone should start blogging about Debugging with Qt Creator ;-}
Andre'
_______________________________________________
Qt-creator mailing list
Qt-creator at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-creator
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20090708/caa38d3b/attachment.html
More information about the Qt-creator-old
mailing list