PDA

View Full Version : How to build qt with debug symbols?



StMartin81
5th May 2010, 16:40
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.

wysota
5th May 2010, 22:55
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.

StMartin81
6th May 2010, 09:32
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:

$ nm --debug-syms libQtGui.so.4.6.2
nm: libQtGui.so.4.6.2: no symbols

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.