[Qt-creator] How to debug Qt Libraries

Rudenko Eugene erule.biz at gmail.com
Sun May 31 00:06:03 CEST 2009


29.05.2009, в 23:26, Andre Poenitz написал(а):

> On Fri, May 29, 2009 at 10:21:58PM +0400, Rudenko Eugene wrote:
>> Hello All.  I'd like to debug QT libraries from Qt-Creator on Ubuntu
>> 8.04 (TLS).  I installed QT-SDK (for qt-creator), Install qt-embedded
>> 4.5.0 with such keys: -qws -debug ...(keyboard and  mouse from qws).
>> and installed it.  In Qt Creator I compiled debugger helper and
>> configured this qt in QT  preferences.
>>
>> Then I tried to see what setFocus() function do on QWidget, and make
>> breakpoint on this call from my source-code.
>>
>> Run in debug mode, and press F11 and got in qwidget.h (which located
>> in /usr/local/Trolltech/qt-embedded-4.5.0), in this line: slot
>> QT_SLOT: inline setFocus() {setFocus(Qt::OtheFocusReason);}
>
> This line is inlined in your code, so it does not mean much that it is
> found.
>
Yes, I now, but I tried to show the steps I produced.

>> I push F11 (Step into) and after some time (over 1 second ), returned
>> back to my source code.
>>
>> In GDB window nothing changed, and in sources window of debug is the
>> list of installed headers.
>
> So it probably did not find the sources or the debug info I am not yet
> quite sure what your setup looks like: Did you compile your Qt  
> yourself?
> Did 'make install' strip the libraries?
>
> A usually working setup is to configure Qt with  -prefix=$PWD  without
> installing it.
Yes, I I compiled it by myself (there is no another way for qt- 
embedded :-) ), yes make install striped libraries,
and I used the way you show (configure Qt with  -prefix=$PWD without  
installing it). And result is same, not step in in library source code.

I can't understand how to show to debugger where is cpp files located.  
In Debug->Sources view I can see headers from $QT_DIR/include path.  
But how to show to debugger where sources to get and how to know that  
debugger didn't find sources or it's another error ?
For example in eclipse, during debuging, when debugger unable to find  
sources (for application or library), it's show   error string "unable  
to find sources for file xxx.cpp" in code editor view (where source  
code for debuging must be appear).
Also it's Interesting how the guys from qtsoftware (former trolls)  
debug this libraries? from gdb directly?

With best Regards, Rudenko Eugene.



More information about the Qt-creator-old mailing list