How to debug marble-qt in build folder without sudo make install

王璀 WANG Cui iucgnaw at msn.com
Mon Mar 20 16:14:21 GMT 2023


Hi Torsten,
I used below trick to avoid install those plugin .so files after each time change/rebuild:
- Manually create /usr/local/lib/marble/plugins/ folder
- Create symbolic link for every plugin .so like: sudo ln -f -s /home/ubuntu/Git/GitHub/KDE/marble-vscode/build/Debug/src/plugins/positionprovider/flightgear/FlightGearPositionProviderPlugin.so /usr/local/lib/marble/plugins/FlightGearPositionProviderPlugin.so
- Now ./marble-qt can load all plugins from build folder directly and run as if being installed.
--------
…
Marble::RenderPlugin plugin loaded from "/home/ubuntu/Git/GitHub/KDE/marble-vscode/build/Debug/src/plugins/render/annotate/AnnotatePlugin.so"
Marble::RenderPlugin plugin loaded from "/home/ubuntu/Git/GitHub/KDE/marble-vscode/build/Debug/src/plugins/render/aprs/AprsPlugin.so"
Marble::RenderPlugin plugin loaded from "/home/ubuntu/Git/GitHub/KDE/marble-vscode/build/Debug/src/plugins/render/atmosphere/AtmospherePlugin.so"
Marble::ParseRunnerPlugin plugin loaded from "/home/ubuntu/Git/GitHub/KDE/marble-vscode/build/Debug/src/plugins/runner/cache/CachePlugin.so"
…
--------

For build/install, thanks for your recommendation, it is quite typical practice. Actually for convenience, I am using VSCode with CMake Tools addon and C/C++ addon, to build and debug accordingly. See attached screenshot please.

However, the challenge I am facing now is, I can set breakpoint in source code and break when needed. But step the code is very slow, take more 10 seconds to step to next line. Not sure whether it is caused by symbolic links.
I am seeking your advice, what is your way to debug marble? What tools are used? Any document/tutorial to refer?
If install is mandatory, of course, I can do install for debug performance sake.

BTW, you mentioned about using Qt Creator, but I don’t see any .pro file in marble repository, how to utilize Qt Creator for marble programing/debug?

WANG Cui

From: Torsten Rahn <tackat at t-online.de>
Sent: Monday, March 20, 2023 3:21 PM
To: 王璀 WANG Cui <iucgnaw at msn.com>; Mailinglist, Marble-Devel <marble-devel at kde.org>
Subject: AW: How to debug marble-qt in build folder without sudo make install


Hello Cui,



> ./marble --marbledatapath=<prefix>/marble/data



Oh that looks like the source directory.



> Do you also need to do the manual install/copy step to setup environment?



Yes that is the preferred way to do it. You can try to find your way keeping things in the build directory - and it's possible to do that - but it you need to make the adjustments to the data and plugin path in that case.



So better do the install, e.g. like this:



After doing the compilation via "make", have you actually installed the application (via make install)?



Let me quickly tell how this works on the commandline:



Create a build directory next to your sources - which I have  located in ~/marble/sources in my example:



tackat at tackat-ThinkPad-T440p:~/marble$ mkdir mybuild



tackat at tackat-ThinkPad-T440p:~/marble$ cd mybuild/

(if you have Qt installed via the maintenance tool then you might need to tell where your Qt installation is e.g. via:  export Qt5_DIR=/opt/Qt/5.14.2/gcc_64/)



Start the build via:



tackat at tackat-ThinkPad-T440p:~/marble/mybuild$ cmake ../sources

Do the "install" step via:



tackat at tackat-ThinkPad-T440p:~/marble/mybuild$ sudo cmake --build . --target all && sudo cmake --build . --target install

If you use Qt Creator you probably need to add the last step under the project tab in the build section.



Best regards

Torsten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20230320/d16f0a49/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screenshot.jpg
Type: image/jpeg
Size: 94014 bytes
Desc: screenshot.jpg
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20230320/d16f0a49/attachment-0001.jpg>


More information about the Marble-devel mailing list