简体   繁体   中英

How to add Qt sources to QtCreator in Ubuntu?

Edit The answers to this post either say compile yourself - which I don't want do to - or install qtbase5-dbg which is not part of Ubuntu releases anymore. So is there no way to achieve this without this package? And shouldn't there be different debug symbols for each Qt 5.X version?


I'm trying to add Qt sources - which I installed along Qt both using the Qt Maintenance tool - to QtCreator but am not able to get it to work. I've already looked at various websites for help but still no luck. I need to step into the Qt sources to see how Qt3D works since I'm trying to develop a Qt3D widget.

As for many others, when I go to Options > Debugger and there under Source Path Mappings click on Add Qt sources... it adds /home/qt/work/qt as Source Path and /home/[my username]/Qt/5.14.2/Src (the latter being the folder I selected).

Since I can't step into the Qt sources I assume the Source Path is wrong. I tried to follow the steps from this answer but when I move the mouse over a function call in the call stack after stopping at a breakpoint doesn't yield any path - just the function name and address.

Someone also pointed out that the compiled Qt libraries must not include stripped when getting info from them like this: file libQt... . But this is what file libQt53DCore.so.5.14.2 gave me:

libQt53DCore.so.5.14.2: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=d764882c0c26814e30d63a4d4719143e14e4c735, not stripped

So I assume that's fine. Although I built Qt myself and file libQt53DCore.so.5.15.0 yields

 libQt53DCore.so.5.15.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=88eeb269ff68f0b71e3612d1a538503676da3790, with debug_info, not stripped

ie an additional with debug_info .

Unfortunately, building Qt results in a 20 something GB build and I would have to do this for multiple Qt versions. So how can I setup QtCreator properly so that I can step into Qt sources.

A few minor versions ago, Qt added "Qt debug information files" to the maintenance tool. They contain the debug information of the libraries.

Which means, if you debug and want to step into human readable Qt library code you have to install them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM