KCrash
Kevin Ottens
ervin at kde.org
Sun Jan 19 19:44:48 UTC 2014
Hello,
On Sunday 19 January 2014 18:43:01 David Faure wrote:
> KCrash automatically initializes itself with the use of
> Q_COREAPP_STARTUP_FUNCTION, provided that apps link to that lib.
>
> This works OK, except for one thing: it gives no chance for KCrash to add
> --nocrashhandler to QCommandLineParser (in the case where the app uses
> that).
>
> Which makes me reconsider the idea of automatic initialization, and rather
> adding something explicit like
> KCrash::initialize(&parser);
> .... in all apps, when porting away from KApplication.
That would be a loss though.
> And moving all of the startup function code into that.
> Otherwise, we run the risk of apps magically using KCrash without knowing
> it, not defining the option in QCommandLineParser, leading to
> "no such option --nocrashhandler" (and an immediate abort) when kcrash
> restarts the crashed app with that option.
>
>
> Ah!
> There is one alternative....
>
> Getting rid of --nocrashhandler altogether and using an environment variable
> instead. KDE_DEBUG=1 is the existing name for this env var, in the kde4/kf5
> code. I don't like it very much though, since it's not very descriptive. So
> how about
> - adding support for another env var in kcrash.cpp, say KCRASH_DISABLE=1?
> - changing kcrash.cpp to set that var in startProcess()
> (a bit tricky, this can involve kdeinit, but iirc it supports setting env
> vars...)
Yes, sounds like a good solution to me, let's use an env var for that.
> (Even KCRASH_DISABLE isn't very descriptive technically; we don't disable
> the fact that a crash handler gets called, but the launching of drkonqi
> from there. But from a user point of view I guess that's all that matters).
What about KCRASH_NO_CRASH_HANDLER ? It's long but it makes it at least
descriptive.
Cheers.
--
Kévin Ottens, http://ervin.ipsquad.net
KDAB - proud supporter of KDE, http://www.kdab.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140119/77f05393/attachment.sig>
More information about the Kde-frameworks-devel
mailing list