debugging plugins

Thomas Baumgart thb at net-bembel.de
Fri Apr 8 07:59:12 BST 2022


Hi,

On Freitag, 8. April 2022 01:14:06 CEST Chris via KMyMoney-devel wrote:

> Hi
> 
> I am compiling kmymoney to run the debugger over a couple of plugins. When I 
> do so setting a breakpoint fails in the source code of the plugin I want to 
> debug (csv import).
> 
> I read that its best to statically link the plugins for debugging purposes 
> so I recompiled using -DBUILD_SHARED=OFF -DBUILD_STATIC_PLUGINS=ON to 
> statically link the shared libs

There is an initiative to link KMyMoney statically with all the plugins included
and that maybe where this fits in. Rest assured, one can debug the plugins
even if they are linked dynamically. I do this all the time. A few things have
to be kept in mind, though. Please see below.

> However now when kmymoney starts it says it "couldn't find any plugin for 
> opening storage". When I look under Settings=>Configure KmyMoney there are 
> no plugins shown

That shows, that you build the application and plugins but did not install them.
For KMyMoney to pick them up, you need to install the application in your KDE
environment (my preferred way) or modify settings (env variables) so that
KDE will search your build environment (too). For the install process to work
properly you have to uninstall any version that come with your distro before.

> if I use ldd I get the text below which doesn't include the libraries I am 
> expecting it to include.

That is what differentiates shared libs and plugins: ldd finds the shared libs
which are loaded 'before' the application starts. In contrast, plugins are 
searched and loaded at runtime by the application through the plugin mechanism.
This mechanism searches the plugins in pre-defined locations.

> Version 5.0.8-d0ad2084c
> KDE Frameworks 5.54.0
> Qt 5.11.3 (built against 5.11.3)
> The xcb windowing system
> 
> I tried to compile the latest kmymoney but I am on Debian 10 buster and it 
> doesn't compile.
> 
> 
> Can any one advise what else I need to do to statically link the libs so I 
> can debug this application? or if there is another preferred way.
> 
> BTW I am using kdevelop as my IDE and I am not trying to fix the plugin I am 
> looking to alter the way it works. so there is no bug report.

I am using KDevelop myself and have no problems with debugging the plugins
when the application and plugins are 'installed' using 'sudo make install'.
In case you modify a plugin, you have to install it that way *before* you
start the next debug session. Otherwise, it will use the previous installed
one and you see strange results.

-- 

Regards

Thomas Baumgart

https://www.signal.org/       Signal, the better WhatsApp
-------------------------------------------------------------
Happiness often sneaks in through a door you didn't know you left open.
(John Barrymore)
-------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 868 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20220408/b644adb1/attachment.sig>


More information about the KMyMoney-devel mailing list