This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 170491 - Qt variables display garbage
Summary: Qt variables display garbage
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: PC All
: P3 blocker (vote)
Assignee: Maria Tishkova
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-17 16:58 UTC by ilantal
Modified: 2016-07-06 14:38 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
picture of badly displayed Q variables (104.80 KB, text/plain)
2009-08-17 17:01 UTC, ilantal
Details
same picture with correct MIME type (104.80 KB, image/png)
2009-08-17 18:24 UTC, Alexey Vladykin
Details
makefile (8.41 KB, text/plain)
2009-09-14 06:37 UTC, ilantal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ilantal 2009-08-17 16:58:26 UTC
The link below has a screen shot which shows the problem
http://www.nabble.com/NetBeans-doesn%27t-show-Qt-variables-correctly-td25008862.html
(a picture is worth 1000 words)

In short, the debugger displays garbage for QString and QStringList.
I don't know of any Q variables which display correctly, but I gave an example with these 2.

Thanks,
Ilan
Comment 1 ilantal 2009-08-17 17:01:53 UTC
Created attachment 86332 [details]
picture of badly displayed Q variables
Comment 2 Alexey Vladykin 2009-08-17 18:16:31 UTC
Yes, NetBeans does not convert Qt types to human-readable form. (Although I wouldn't call it garbage :) There is a
simple workaround.
Download file http://websvn.kde.org/*checkout*/trunk/KDE/kdesdk/scripts/kde-devel-gdb?revision=992325 and add line
source /path/to/kde-devel-gdb
to your ~/.gdbinit.
Comment 3 Alexey Vladykin 2009-08-17 18:24:13 UTC
Created attachment 86342 [details]
same picture with correct MIME type
Comment 4 Alexey Vladykin 2009-08-18 11:15:41 UTC
It seems that one more step is needed to get friendly values of Qt types. Besides adding kde-devel-gdb to .gdbinit, Qt
variables should be evaluated with appropriate gdb macros defined in kde-devel-gdb, not with -data-evaluate-expression.
ValuePresenter technique is not enough, because desired friendly value can't always be extracted from its default
representation. Look at QString value on the screenshot.

CND debugger infrastructure needs to be extended to allow prettyprinting of Qt types. There is no simple workaround.
A hardcore workaround would be to enable gdb console and issue gdb commands manually to print desired variables.
Comment 5 ilantal 2009-09-14 06:32:09 UTC
Yesterday I tried again Qt-Creator as the "natural" debugger to display qt variables. I tried it on our Rosegarden
project and not the simple Hello World. I was surprised to see that it didn't do any better than NetBeans at showing qt
variables. It shows them in the same @d style as NetBeans, giving no real information.
I'm wondering if there could be 2 separate problems here:
1) NetBeans display of qt variables and
2) something in our makefile.

I will attach the makefile for inspection. If there are suggestions I can continue to compare NetBeans and Qt-Creator to
try to narrow down where the problem lies. (Personally, I find NetBeans much more useful than Qt-Creator, which I find
difficult to use.)
Comment 6 ilantal 2009-09-14 06:37:36 UTC
Created attachment 87576 [details]
makefile
Comment 7 Alexander Pepin 2010-11-02 17:17:52 UTC
It's not for 7.0.
Comment 8 Vladimir Voskresensky 2011-09-09 12:07:04 UTC
see also CR#7088700