Results 1 to 3 of 3

Thread: How to build qt with debug symbols?

  1. #1
    Join Date
    May 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to build qt with debug symbols?

    Hello,
    I want to build qt with debug smybols but want to keep the optimized version of functions. It seems like that when I compile qt with the "./configure -debug" option some functions are replaced by "non-optimized"/more robust/... functions. I want to build qt just like a normal release build only with debug symbols enabled. I need this so that I can use oprofile. If there are no debug symbols included it won't show me which function is slow but it will only show me the library which is slow.

  2. #2
    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: How to build qt with debug symbols?

    Do you want to profile Qt or your application? It should be enough to do the latter. Regardless which is the case you have to force the compilation to include -g and -O3 options (for gcc). configure itself won't generate such combination automatically but you can probably change some variables in the proper file from the mkspecs directory temporarily and then build Qt. For building your application you can force variable changes through the .pro file.
    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.


  3. #3
    Join Date
    May 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to build qt with debug symbols?

    Hello,
    thanks for your feedback. I've build qt with the following g++.conf: http://pastebin.com/e47JwG5Y

    Unfortunately this doesn't help. When I use "nm" on a shared library I get the following:
    Qt Code:
    1. $ nm --debug-syms libQtGui.so.4.6.2
    2. nm: libQtGui.so.4.6.2: no symbols
    To copy to clipboard, switch view to plain text mode 

    I've attached an output from oprofile. As you can see a lot of time is spent in libQtGui.so.4.6.2 but unfortunately it doesn't show the function where it spents all this time.
    Attached Files Attached Files

Similar Threads

  1. Qt + Linux + Eclipse - debug using debug build?
    By will49 in forum Qt Programming
    Replies: 6
    Last Post: 13th April 2012, 06:27
  2. windows static compiling - debug symbols
    By eleanor in forum Installation and Deployment
    Replies: 7
    Last Post: 30th December 2009, 18:48
  3. DEBUG macro not defined in debug build using vc++
    By piotr.dobrogost in forum Qt Programming
    Replies: 0
    Last Post: 21st July 2009, 13:07
  4. Replies: 3
    Last Post: 28th December 2007, 11:02
  5. Replies: 11
    Last Post: 22nd March 2006, 19:06

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.