Changeset View
Changeset View
Standalone View
Standalone View
drkonqi/drkonqibackends.cpp
Show All 30 Lines | |||||
31 | #include <QDebug> | 31 | #include <QDebug> | ||
32 | 32 | | |||
33 | #include "crashedapplication.h" | 33 | #include "crashedapplication.h" | ||
34 | #include "debugger.h" | 34 | #include "debugger.h" | ||
35 | #include "debuggermanager.h" | 35 | #include "debuggermanager.h" | ||
36 | #include "backtracegenerator.h" | 36 | #include "backtracegenerator.h" | ||
37 | #include "drkonqi.h" | 37 | #include "drkonqi.h" | ||
38 | 38 | | |||
39 | #ifdef Q_OS_MACOS | ||||
40 | #include <AvailabilityMacros.h> | ||||
41 | #endif | ||||
42 | | ||||
39 | AbstractDrKonqiBackend::~AbstractDrKonqiBackend() | 43 | AbstractDrKonqiBackend::~AbstractDrKonqiBackend() | ||
40 | { | 44 | { | ||
41 | } | 45 | } | ||
42 | 46 | | |||
43 | bool AbstractDrKonqiBackend::init() | 47 | bool AbstractDrKonqiBackend::init() | ||
44 | { | 48 | { | ||
45 | m_crashedApplication = constructCrashedApplication(); | 49 | m_crashedApplication = constructCrashedApplication(); | ||
46 | m_debuggerManager = constructDebuggerManager(); | 50 | m_debuggerManager = constructDebuggerManager(); | ||
▲ Show 20 Lines • Show All 106 Lines • ▼ Show 20 Line(s) | 116 | { | |||
153 | 157 | | |||
154 | return a; | 158 | return a; | ||
155 | } | 159 | } | ||
156 | 160 | | |||
157 | DebuggerManager *KCrashBackend::constructDebuggerManager() | 161 | DebuggerManager *KCrashBackend::constructDebuggerManager() | ||
158 | { | 162 | { | ||
159 | QList<Debugger> internalDebuggers = Debugger::availableInternalDebuggers(QStringLiteral("KCrash")); | 163 | QList<Debugger> internalDebuggers = Debugger::availableInternalDebuggers(QStringLiteral("KCrash")); | ||
160 | KConfigGroup config(KSharedConfig::openConfig(), "DrKonqi"); | 164 | KConfigGroup config(KSharedConfig::openConfig(), "DrKonqi"); | ||
161 | #ifndef Q_OS_WIN | 165 | #if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED > 1070 | ||
kfunk: Why these special conditions? Needs comments.
Whether to use or not to use lldb on a… | |||||
Actually, there can be a runtime decision to use lldb on earlier (10.7-) versions but not on later versions. Gdb doesn't work properly from 10.8 onwards. And to be honest lldb was in such an early stage in 10.7 and earlier that you wouldn't want to use the system version there. I'll put a concise version of this explanation as a comment. rjvbb: Actually, there can be a runtime decision to use lldb on earlier (10.7-) versions but not on… | |||||
166 | // Gdb isn't available from OS X 10.8 onwards (and cannot work properly anyway); | ||||
167 | // the lldb version on OS X 10.7 and earlier is subpar to the system gdb still available | ||||
168 | // on those OS versions. Hence, only make lldb the default Mac debugger on 10.8+ . | ||||
169 | QString defaultDebuggerName = config.readEntry("Debugger", QString("lldb")); | ||||
170 | #elif !defined(Q_OS_WIN) | ||||
162 | QString defaultDebuggerName = config.readEntry("Debugger", QStringLiteral("gdb")); | 171 | QString defaultDebuggerName = config.readEntry("Debugger", QStringLiteral("gdb")); | ||
163 | #else | 172 | #else | ||
164 | QString defaultDebuggerName = config.readEntry("Debugger", QString("kdbgwin")); | 173 | QString defaultDebuggerName = config.readEntry("Debugger", QString("kdbgwin")); | ||
165 | #endif | 174 | #endif | ||
166 | 175 | | |||
167 | Debugger firstKnownGoodDebugger, preferredDebugger; | 176 | Debugger firstKnownGoodDebugger, preferredDebugger; | ||
168 | foreach (const Debugger & debugger, internalDebuggers) { | 177 | foreach (const Debugger & debugger, internalDebuggers) { | ||
169 | if (!firstKnownGoodDebugger.isValid() && debugger.isInstalled()) { | 178 | if (!firstKnownGoodDebugger.isValid() && debugger.isInstalled()) { | ||
▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines |
Why these special conditions? Needs comments.
Whether to use or not to use lldb on a particular OS X version should be runtime decision, too.