[Development] Debugging into Qt binaries

Ziller Eike Eike.Ziller at digia.com
Fri Jan 10 12:07:12 CET 2014


On Jan 9, 2014, at 6:05 PM, Kuba Ober <kuba at mareimbrium.org> wrote:

> I’m trying to figure out the most constructive way of ensuring that an OS X build of Qt, installed with the source code, can be actually debugged by stepping into the C++ source code in the Qt library. So far I can only step into disassembly. This doesn't work out of the box on a fresh install of Qt 5.2, and it really has never worked with Qt 5 builds. I never got it working for a Qt 4 build either.
> 
> For Qt 5.2, the Debugger Log pane is full of messages like the below:
>  Could not find object file "/work/build/qt5_workdir/w/s/qtbase/src/widgets/.obj/debug/qtabbar.o" - no debug information available for "qtabbar.cpp”.
> Presumably this is because the Qt build has debug info, but the paths in the debug info refer to paths on the build host.

The Qt libraries do not ship the debug information. They are left behind in the object (.o) files on the build machines.

> Is there a magic incantation for gdb that would let it translate those object file locations to locations on the installed variant of Qt? This is presumably not the same as the incantations needed to translate source file locations...
> 
> Is there no way of getting it working out of the box? Is it an oversight? Or nobody has time to deal with this? Any pointers on where to start? I would at least like to have a working procedure assembled that ends up with Qt being debuggable. This is quite puzzling since there are debug libraries installed for all the Qt frameworks, and I have the sources installed as well.
> 
> Isn’t it a reasonable expectation that this should work out of the box as long as you install the sources when installing the official Qt build?


Please see my comment on QTBUG-28496:

<quote>
basically to solve this completely, including debugging into Qt code, we need to
	• make sure we package the debugging symbols (dsymutil, or maybe there's a compiler flag that does that during link-time?)
	• think about if the debugging symbols should be in a separate component, it will make the package significantly larger I guess (like Qt libraries 4.8.4 for Mac (185 MB) and debug libraries (480 MB))
	• make it actually find the Qt sources. I've no clue at the moment how to achieve that with apple's gdb, or if we can patch the debug info in the dsym at install time
</quote>

-- 
Eike Ziller, Senior Software Engineer - Digia, Qt
 
Digia Germany GmbH, Rudower Chaussee 13, D-12489 Berlin
Geschäftsführer: Mika Pälsi, Juha Varelius, Tuula Haataja
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B




More information about the Development mailing list