Commit 8c74d90e authored by patrick pereira's avatar patrick pereira 🏃

Add application path as valid path for debuggers

Summary:
This will help applications to deploy (appimages, snaps, .zips) with debuggers
I have a windows deployment system with appveyor and drkonqi for windows and it's working without problems with a zip deployment and embedded cdb
Signed-off-by: patrick pereira's avatarPatrick José Pereira <patrickelectric@gmail.com>

Reviewers: davidedmundson, tcanabrava, ngraham

Reviewed By: tcanabrava

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D19166
parent abd97223
......@@ -24,6 +24,7 @@
#include "crashedapplication.h"
#include "drkonqi.h"
#include "drkonqi_debug.h"
//static
QList<Debugger> Debugger::availableInternalDebuggers(const QString & backend)
......@@ -45,7 +46,14 @@ bool Debugger::isValid() const
bool Debugger::isInstalled() const
{
QString tryexec = tryExec();
return !tryexec.isEmpty() && !QStandardPaths::findExecutable(tryexec).isEmpty();
if(tryexec.isEmpty()) {
qCDebug(DRKONQI_LOG) << "tryExec of" << name() << "is empty!";
return false;
}
// Find for executable in PATH and in our application path
return !QStandardPaths::findExecutable(tryexec).isEmpty()
|| !QStandardPaths::findExecutable(tryexec, {QCoreApplication::applicationDirPath()}).isEmpty();
}
QString Debugger::name() const
......
......@@ -172,6 +172,7 @@ DebuggerManager *KCrashBackend::constructDebuggerManager()
Debugger firstKnownGoodDebugger, preferredDebugger;
foreach (const Debugger & debugger, internalDebuggers) {
qCDebug(DRKONQI_LOG) << "Check debugger if" << debugger.name() << "is installed:" << debugger.isInstalled();
if (!firstKnownGoodDebugger.isValid() && debugger.isInstalled()) {
firstKnownGoodDebugger = debugger;
}
......@@ -235,5 +236,3 @@ void KCrashBackend::emergencySaveFunction(int signal)
Q_UNUSED(signal);
::kill(s_pid, SIGKILL);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment