aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger
diff options
context:
space:
mode:
authorhjk <[email protected]>2012-08-09 01:50:26 +0200
committerhjk <[email protected]>2012-08-14 14:01:56 +0200
commitd42b9b026a8c982b7c1e56e0b5a9c9c50c664bd3 (patch)
tree485f56dbddee2a6ed1c109a4287cd30645a88b0f /src/plugins/debugger
parentf2bf6c9a3634196c006ec1c4825db94abd0f5116 (diff)
debugger: remove commandline options to disable debugger engines
This was mostly useful in cases where the guessing magic failed. With the new Profiles, the debugger engines can be adjusted there. Change-Id: I96622775588bb46c3e4e35af27e352593eb405d1 Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/plugins/debugger')
-rw-r--r--src/plugins/debugger/Debugger.pluginspec.in4
-rw-r--r--src/plugins/debugger/debuggercore.h1
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp62
-rw-r--r--src/plugins/debugger/debuggerrunner.cpp20
-rw-r--r--src/plugins/debugger/debuggerstartparameters.h4
5 files changed, 17 insertions, 74 deletions
diff --git a/src/plugins/debugger/Debugger.pluginspec.in b/src/plugins/debugger/Debugger.pluginspec.in
index d3edc499af7..d867e5cce06 100644
--- a/src/plugins/debugger/Debugger.pluginspec.in
+++ b/src/plugins/debugger/Debugger.pluginspec.in
@@ -22,9 +22,6 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General
<dependency name=\"CppEditor\" version=\"$$QTCREATOR_VERSION\" type=\"optional\"/>
</dependencyList>
<argumentList>
- <argument name=\"-disable-cdb\">Disable Cdb debugger engine</argument>
- <argument name=\"-disable-gdb\">Disable Gdb debugger engine</argument>
- <argument name=\"-disable-sdb\">Disable Qt Script debugger engine</argument>
<argument name=\"-debug\" parameter=\"pid\">Attach to local process</argument>
<argument name=\"-debug\" parameter=\"executable\">Start and debug executable</argument>
<argument name=\"-debug [executable,]core=&lt;corefile&gt;[,sysroot=&lt;sysroot&gt;]\">
@@ -34,6 +31,5 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General
<argument name=\"-wincrashevent\"
parameter=\"eventhandle:pid\">
Event handle used for attaching to crashed processes</argument>
- <argument name=\"-disable-tcf\">Disable Tcf debugger engine</argument>
</argumentList>
</plugin>
diff --git a/src/plugins/debugger/debuggercore.h b/src/plugins/debugger/debuggercore.h
index cccca02b1f3..7ca14e05a8d 100644
--- a/src/plugins/debugger/debuggercore.h
+++ b/src/plugins/debugger/debuggercore.h
@@ -101,7 +101,6 @@ public:
virtual void runControlFinished(DebuggerEngine *engine) = 0;
virtual void displayDebugger(DebuggerEngine *engine, bool updateEngine) = 0;
virtual DebuggerLanguages activeLanguages() const = 0;
- virtual unsigned enabledEngines() const = 0;
virtual void synchronizeBreakpoints() = 0;
virtual bool initialize(const QStringList &arguments, QString *errorMessage) = 0;
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 980d2abbf56..e0e1c20861c 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -804,7 +804,6 @@ public slots:
void runControlStarted(DebuggerEngine *engine);
void runControlFinished(DebuggerEngine *engine);
DebuggerLanguages activeLanguages() const;
- unsigned enabledEngines() const { return m_cmdLineEnabledEngines; }
// QString debuggerForAbi(const Abi &abi, DebuggerEngineType et = NoEngineType) const;
void remoteCommand(const QStringList &options, const QStringList &);
@@ -1088,10 +1087,8 @@ public slots:
void showModuleSymbols(const QString &moduleName, const Symbols &symbols);
bool parseArgument(QStringList::const_iterator &it,
- const QStringList::const_iterator &cend,
- unsigned *enabledEngines, QString *errorMessage);
- bool parseArguments(const QStringList &args,
- unsigned *enabledEngines, QString *errorMessage);
+ const QStringList::const_iterator &cend, QString *errorMessage);
+ bool parseArguments(const QStringList &args, QString *errorMessage);
DebuggerToolTipManager *toolTipManager() const { return m_toolTipManager; }
QSharedPointer<GlobalDebuggerOptions> globalDebuggerOptions() const { return m_globalDebuggerOptions; }
@@ -1179,8 +1176,6 @@ public:
DebuggerEngine *m_currentEngine;
DebuggerSettings *m_debuggerSettings;
QSettings *m_coreSettings;
- bool m_gdbBinariesChanged;
- uint m_cmdLineEnabledEngines;
QStringList m_arguments;
DebuggerToolTipManager *m_toolTipManager;
CommonOptionsPage *m_commonOptionsPage;
@@ -1229,9 +1224,6 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin) :
m_currentEngine = 0;
m_debuggerSettings = 0;
- m_gdbBinariesChanged = true;
- m_cmdLineEnabledEngines = AllEngineTypes;
-
m_reverseToolButton = 0;
m_startAction = 0;
m_debugWithoutDeployAction = 0;
@@ -1299,8 +1291,7 @@ void DebuggerPluginPrivate::maybeEnrichParameters(DebuggerStartParameters *sp)
}
bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
- const QStringList::const_iterator &cend,
- unsigned *enabledEngines, QString *errorMessage)
+ const QStringList::const_iterator &cend, QString *errorMessage)
{
const QString &option = *it;
// '-debug <pid>'
@@ -1387,42 +1378,18 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
m_scheduledStarts.append(sp);
return true;
}
- // Engine disabling.
- if (option == _("-disable-cdb")) {
- *enabledEngines &= ~CdbEngineType;
- return true;
- }
- if (option == _("-disable-gdb")) {
- *enabledEngines &= ~GdbEngineType;
- return true;
- }
- if (option == _("-disable-qmldb")) {
- *enabledEngines &= ~QmlEngineType;
- return true;
- }
- if (option == _("-disable-sdb")) {
- *enabledEngines &= ~ScriptEngineType;
- return true;
- }
- if (option == _("-disable-lldb")) {
- *enabledEngines &= ~LldbEngineType;
- return true;
- }
*errorMessage = DebuggerPlugin::tr("Invalid debugger option: %1").arg(option);
return false;
}
bool DebuggerPluginPrivate::parseArguments(const QStringList &args,
- unsigned *enabledEngines, QString *errorMessage)
+ QString *errorMessage)
{
const QStringList::const_iterator cend = args.constEnd();
for (QStringList::const_iterator it = args.constBegin(); it != cend; ++it)
- if (!parseArgument(it, cend, enabledEngines, errorMessage))
+ if (!parseArgument(it, cend, errorMessage))
return false;
- if (Constants::Internal::debug)
- qDebug().nospace() << args << "engines=0x"
- << QString::number(*enabledEngines, 16) << '\n';
return true;
}
@@ -2653,10 +2620,9 @@ void DebuggerPluginPrivate::remoteCommand(const QStringList &options,
if (options.isEmpty())
return;
- unsigned enabledEngines = 0;
QString errorMessage;
- if (!parseArguments(options, &enabledEngines, &errorMessage)) {
+ if (!parseArguments(options, &errorMessage)) {
qWarning("%s", qPrintable(errorMessage));
return;
}
@@ -2885,7 +2851,7 @@ void DebuggerPluginPrivate::extensionsInitialized()
// Do not fail to load the whole plugin if something goes wrong here.
QString errorMessage;
- if (!parseArguments(m_arguments, &m_cmdLineEnabledEngines, &errorMessage)) {
+ if (!parseArguments(m_arguments, &errorMessage)) {
errorMessage = tr("Error evaluating command line arguments: %1")
.arg(errorMessage);
qWarning("%s\n", qPrintable(errorMessage));
@@ -3148,18 +3114,14 @@ void DebuggerPluginPrivate::extensionsInitialized()
}
QList<IOptionsPage *> engineOptionPages;
- if (m_cmdLineEnabledEngines & GdbEngineType)
- addGdbOptionPages(&engineOptionPages);
- addCdbOptionPages(&engineOptionPages);
+ addGdbOptionPages(&engineOptionPages);
+ addCdbOptionPages(&engineOptionPages);
#ifdef WITH_LLDB
- if (m_cmdLineEnabledEngines & LldbEngineType)
- addLldbOptionPages(&engineOptionPages);
+ addLldbOptionPages(&engineOptionPages);
#endif
- //if (m_cmdLineEnabledEngines & ScriptEngineType)
- // addScriptOptionPages(&engineOptionPages);
- //if (m_cmdLineEnabledEngines & TcfEngineType)
- // addTcfOptionPages(&engineOptionPages);
+ // addScriptOptionPages(&engineOptionPages);
+ // addTcfOptionPages(&engineOptionPages);
foreach (IOptionsPage *op, engineOptionPages)
m_plugin->addAutoReleasedObject(op);
diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp
index 65d0a1f1847..59d745fe8ff 100644
--- a/src/plugins/debugger/debuggerrunner.cpp
+++ b/src/plugins/debugger/debuggerrunner.cpp
@@ -701,18 +701,10 @@ QString ConfigurationCheck::errorDetailsString() const
// Convenience helper to check whether an engine is enabled and configured
// correctly.
-static inline bool canUseEngine(DebuggerEngineType et,
+static bool canUseEngine(DebuggerEngineType et,
const DebuggerStartParameters &sp,
- unsigned cmdLineEnabledEngines,
ConfigurationCheck *result)
{
- // Enabled?
- if ((et & cmdLineEnabledEngines) == 0) {
- result->errorDetails.push_back(DebuggerPlugin::tr("The debugger engine '%1' is disabled.").
- arg(QLatin1String(engineTypeName(et))));
- return false;
- }
- // Configured.
switch (et) {
case CdbEngineType:
return checkCdbConfiguration(sp, result);
@@ -749,19 +741,11 @@ DEBUGGER_EXPORT ConfigurationCheck checkDebugConfiguration(const DebuggerStartPa
}
if (debug)
qDebug() << " Required: " << engineTypeNames(requiredTypes);
- // Filter out disabled types, command line + current settings.
- unsigned cmdLineEnabledEngines = debuggerCore()->enabledEngines();
-#ifdef WITH_LLDB
- if (!Core::ICore::settings()->value(QLatin1String("LLDB/enabled")).toBool())
- cmdLineEnabledEngines &= ~LldbEngineType;
-#else
- cmdLineEnabledEngines &= ~LldbEngineType;
-#endif
DebuggerEngineType usableType = NoEngineType;
QList<DebuggerEngineType> unavailableTypes;
foreach (DebuggerEngineType et, requiredTypes) {
- if (canUseEngine(et, sp, cmdLineEnabledEngines, &result)) {
+ if (canUseEngine(et, sp, &result)) {
result.errorDetails.clear();
usableType = et;
break;
diff --git a/src/plugins/debugger/debuggerstartparameters.h b/src/plugins/debugger/debuggerstartparameters.h
index 14aeb0a4b0b..21452f8ad51 100644
--- a/src/plugins/debugger/debuggerstartparameters.h
+++ b/src/plugins/debugger/debuggerstartparameters.h
@@ -56,7 +56,8 @@ public:
};
DebuggerStartParameters()
- : isSnapshot(false),
+ : engineType(NoEngineType),
+ isSnapshot(false),
attachPID(-1),
useTerminal(false),
breakOnMain(false),
@@ -78,6 +79,7 @@ public:
//Core::Id profileId;
+ DebuggerEngineType engineType;
QString sysRoot;
QString debuggerCommand;
ProjectExplorer::Abi toolChainAbi;