Results 1 to 18 of 18

Thread: qt with debugging symbols

  1. #1

    Default 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

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qt with debugging symbols

    what debugger?
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qt with debugging symbols

    If you're not doing a shadow build into different directories for debug and release, do a full rebuild.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4

    Default 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

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qt with debugging symbols

    By "no changes" you mean make refuses to do a rebuild? If not, what exactly is the problem?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6

    Default 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

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qt with debugging symbols

    What do you see then?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #8

    Default Re: qt with debugging symbols

    I told you.. I can inspect just inside my code not in the Qt one

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  10. #10

    Default 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:

    Qt Code:
    1. // myclass.h
    2.  
    3. MyClass
    4. {
    5. public:
    6. int x;
    7. int y;
    8. }
    9.  
    10.  
    11. // main.cpp
    12. #include "myclass.h"
    13.  
    14. // .. other stuff
    15. MyClass foo;
    16.  
    17. foo.a = 4;
    18.  
    19. QPushButton *button = new QPushButton(this);
    20. button->setText("hello");
    To copy to clipboard, switch view to plain text mode 

    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

  11. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  12. #12

    Default 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?

  13. #13
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qt with debugging symbols

    given,
    QPushbutton* button;

    what happens if you try to inspect (*button), instead of button ?
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  14. #14

    Default 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).

  15. #15
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default 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
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  16. #16

    Default 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..

  17. #17
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qt with debugging symbols

    Quote Originally Posted by valerianst View Post
    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  18. #18

    Default Re: qt with debugging symbols

    uhm.. yep, but now I've installed the Qt debug info packages so it should work..

Similar Threads

  1. Replies: 3
    Last Post: 7th September 2010, 00:00
  2. /usr/bin/ld: Undefined symbols:
    By ataffard in forum Qt Programming
    Replies: 0
    Last Post: 2nd May 2008, 02:24
  3. highlighting text between the same symbols
    By kib2 in forum Qt Programming
    Replies: 3
    Last Post: 11th November 2007, 22:53
  4. math symbols
    By genick bar-meir in forum Qt Programming
    Replies: 3
    Last Post: 17th August 2007, 08:29
  5. greek symbols
    By genick bar-meir in forum Qt Programming
    Replies: 2
    Last Post: 17th July 2007, 23:44

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.