Debugging an imported project is not working in QTcreator
-
Hi,
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:
Thanks,
Best regards,
Gino
-
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?
-
I put debugger log "Here...":http://www.2shared.com/document/0TrCbclG/dbg_log.html
Some explanation:
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.
Any idea?
-
Starting with a side note:
@>~" ^\n"
~"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)
@>31^done,BreakpointTable={nr_rows="1",...],body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x03f1b4d5",func="pluginTest",file="simple_test_plugin.cpp",fullname="/data/dev/creator/tests/manual/debugger/simple/simple_test_plugin.cpp",line="40",times="1",original-location="\"simple_test_plugin.cpp":40"}]}
@Are you sure your .so has debug information?