Debugging an imported project is not working in QTcreator
I use QTCreator together with an imported project ( import project >> import existing project ).
The project actually builds a shared library that is loaded by another executable that is build outside QTcreator ( I don't have sources of it )
I can build the lib and run from QTcreator ( by setting correct Project run settings).
But it doesn't break at breakpoint's. ( lib is compiled with -g ). In the debugger window I see the message it can't find xxx.cpp source file. Not sure if this is related.
Debugger works on other projects so I think my setup is ok.
I use QTcreator 2.5 RC with QT 4.8.0 on CentOS ( gcc 4.1.2, gdb 7.0.1)
Any hint/idea on what could be wrong?
By the way I tried to build gdb myself ( to have a more recent version ) with the instructions "here":http://qt-project.org/wiki/QtCreatorBuildGdb
But it went wrong with the patches. Not sure if "these patches":http://download.qt.nokia.com/misc/gdb/7.2/build/ are ok:
You can try to use "Use Full Path" in the "Advanced" option block of the breakpoint properties (right-click on the breakpoint in the Brealpoints view) and check whether it makes a difference. If not, please attach the full debugger log (contents of the right pane of Windows->Views->Debugger Log)
In any case, the "official" minimal requirement for a gdb that can be used with Qt Creator 2.4 is 7.2. Suitable pre-built binaries are on http://download.qt.nokia.com/misc/gdb/7.2/ and http://builds.qt-project.org/. An plain build from unpatched 7.4 and 7.4.1 sources also works well. Make sure to have python development packages installed when configuring gdb, it will compile without complaints, but the result won't be usable with Qt Creator.
Thanks for the reply.
Setting "Use Full Path” and using gdb 7.4.1 doesn't help.
By the way, I have a simple project which uses dynamically loaded libraries and this works perfect. ( I mimmick in this project my real project as close as possible, like also building in a seperate dir etc.).
Is there something I could/should set in .gdbinit etc?
It should use "set breakpoint pending on", but that's set by default in Creator, so there's no need to modify .gdbinit. Can you please put the Debugger Log somewhere?
I put debugger log "Here...":http://www.2shared.com/document/0TrCbclG/dbg_log.html
mdb is main program, which dynamically loads the library i want to debug. I don't have sources for mdb. I can put breakpoint at main() where debugger does stop. ( this is not what I want though)
libsim.so is the dynamical lib I build in QtCreator and want to debug. I put breakpoint in test.cpp:1284, at which debugger doesn't break.
Starting with a side note:
~"SyntaxError: invalid syntax\n"
&"Error while executing Python code.\n"
This looks like the version of python your gdb uses is too old from Qt Creator's point of view. 2.6 is minimum. You won't have much fun with that setup further down the road.
Having said that, the breakpoint setting should work. The issued commands are ok, and work in a similar setup using "stock" GNU gdb (GDB) 7.0.1 for me (just tested)
Are you sure your .so has debug information?