qt with debugging symbols
Hi there!
I have installed the qt libraries with the debugging info with my package manager (I'm on linux).
I have also added in the .pro file the command: CONFIG+= debug
and I have cleaned the solution, done a qmake and recompiled.
The problem is that nothing has changed with the last configuration.
I just want to inspect the qt objects.. for instance, seeing what there is inside a qtreewidget or see the various fields of a QPushButton and so on..
Is there anything I've missed?
Cheers
Re: qt with debugging symbols
Re: qt with debugging symbols
If you're not doing a shadow build into different directories for debug and release, do a full rebuild.
Re: qt with debugging symbols
I'm using GDB
Yes I haven't a shadow build.. I have already tried several times to rebuild but no changes
Re: qt with debugging symbols
By "no changes" you mean make refuses to do a rebuild? If not, what exactly is the problem?
Re: qt with debugging symbols
Hi, by no changes I mean that the debugging data are the same, there's no additional data that I can see. I was expecting to be able to inspect the qt objects, all their fields
Re: qt with debugging symbols
Re: qt with debugging symbols
I told you.. I can inspect just inside my code not in the Qt one
Re: qt with debugging symbols
Do you mean that you cannot step into Qt functions? Or what exactly? You are not being clear, don't be surprised I can't understand you.
Re: qt with debugging symbols
You're right, I apologise. It just seemed obvious to me but actually it is not.
I'll try with an example.
Let assume we have this code:
Code:
// myclass.h
MyClass
{
public:
int x;
int y;
}
// main.cpp
#include "myclass.h"
// .. other stuff
MyClass foo;
foo.a = 4;
button->setText("hello");
when I start the debugger and my code reaches a breakpoint, in qt-creator, on the right, there's a window where there are the variable names and their content.
In the case of "foo" I can see that the "a" field contains the value 4 and I can see the whole structure of MyClass.
The same cannot be said about "button". In that case, I cannot see the QPushButton structure neither I can see the internal fields..
What I'm trying to do is to be able to inspect these internal fields as I do for all the other classes
Edit: It wouldn't be bad to be able to inspect the Qt code as well :)
Re: qt with debugging symbols
QPushButton does not have a structure. It just has a d pointer which you probably see. If not then maybe you're using a different Qt kit than the one you installed debugging symbols for.
Re: qt with debugging symbols
I just see an address.. the same for QTreeWidget
I just see: @0x50e5a90 as value so it's just it is a pointer..
is it not possible to inspect the structure pointed by that address?
Re: qt with debugging symbols
given,
QPushbutton* button;
what happens if you try to inspect (*button), instead of button ?
Re: qt with debugging symbols
I cannot inspect that, there's just the button field and it is a pointer..
Unfortunately, these Qt classes have a private copy contructor so it's not possible to copy them and inspect the copied element (unless you copy all the fields, value by value).
Re: qt with debugging symbols
you can normally add a 'watch variable' in any self respecting debugger. Just add one that is the button dereferenced.
looking here suggests that pointer data is expandable.
https://qt-project.org/doc/qtcreator...g-example.html
Re: qt with debugging symbols
the watch variable stuff should work, thanks.
About the pointer... yes, it should be expandable.. I can see all the stuff of the "this" pointer.. I don't know why I can't do it with others..
Re: qt with debugging symbols
Quote:
Originally Posted by
valerianst
About the pointer... yes, it should be expandable.. I can see all the stuff of the "this" pointer.. I don't know why I can't do it with others..
It could be that the debugger needs to be able to access Qt source code to be able to resolve the private pointer's structure.
Re: qt with debugging symbols
uhm.. yep, but now I've installed the Qt debug info packages so it should work..