Debugger: Improve configuration error reporting.

- Make showWarningWithOptions actually show the details.
- Show errors from multiple engines as separate messages.
- Remove 'enabled' option from CDB (handled by toolchain config now).
- Show ABI as tooltip in debbugger toolchain chooser.
This commit is contained in:
Friedemann Kleint
2011-02-25 09:34:31 +01:00
parent 5d615f7fbf
commit 047ee5522c
12 changed files with 82 additions and 32 deletions

View File

@@ -337,34 +337,34 @@ bool checkCdbConfiguration(const DebuggerStartParameters &sp, ConfigurationCheck
{
#ifdef Q_OS_WIN
if (!isCdbEngineEnabled()) {
check->errorMessage = CdbEngine::tr("The CDB debug engine required for %1 is currently disabled.").
arg(sp.toolChainAbi.toString());
check->errorDetails.push_back(CdbEngine::tr("The CDB debug engine required for %1 is currently disabled.").
arg(sp.toolChainAbi.toString()));
check->settingsCategory = QLatin1String(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY);
check->settingsPage = CdbOptionsPage::settingsId();
return false;
}
if (debuggerCore()->debuggerForAbi(sp.toolChainAbi, CdbEngineType).isEmpty()) {
check->errorMessage = msgNoCdbBinaryForToolChain(sp.toolChainAbi);
check->errorDetails.push_back(msgNoCdbBinaryForToolChain(sp.toolChainAbi));
check->settingsCategory = QLatin1String(ProjectExplorer::Constants::TOOLCHAIN_SETTINGS_CATEGORY);
check->settingsPage = QLatin1String(ProjectExplorer::Constants::TOOLCHAIN_SETTINGS_CATEGORY);
return false;
}
if (!validMode(sp.startMode)) {
check->errorMessage = CdbEngine::tr("The CDB engine does not support start mode %1.").arg(sp.startMode);
check->errorDetails.push_back(CdbEngine::tr("The CDB engine does not support start mode %1.").arg(sp.startMode));
return false;
}
if (sp.toolChainAbi.binaryFormat() != Abi::PEFormat || sp.toolChainAbi.os() != Abi::WindowsOS) {
check->errorMessage = CdbEngine::tr("The CDB debug engine does not support the %1 ABI.").
arg(sp.toolChainAbi.toString());
check->errorDetails.push_back(CdbEngine::tr("The CDB debug engine does not support the %1 ABI.").
arg(sp.toolChainAbi.toString()));
return false;
}
return true;
#else
Q_UNUSED(sp);
check->errorMessage = QString::fromLatin1("Unsupported debug mode");
check->errorDetails.push_back(QString::fromLatin1("Unsupported debug mode"));
return false;
#endif
}

View File

@@ -36,7 +36,6 @@
#include <QtCore/QSettings>
static const char settingsGroupC[] = "CDB2";
static const char enabledKeyC[] = "Enabled";
static const char symbolPathsKeyC[] = "SymbolPaths";
static const char sourcePathsKeyC[] = "SourcePaths";
static const char breakEventKeyC[] = "BreakEvent";
@@ -45,7 +44,7 @@ static const char additionalArgumentsKeyC[] = "AdditionalArguments";
namespace Debugger {
namespace Internal {
CdbOptions::CdbOptions() : enabled(false)
CdbOptions::CdbOptions()
{
}
@@ -56,7 +55,6 @@ QString CdbOptions::settingsGroup()
void CdbOptions::clear()
{
enabled = false;
symbolPaths.clear();
sourcePaths.clear();
}
@@ -70,7 +68,6 @@ void CdbOptions::fromSettings(QSettings *s)
{
clear();
const QString keyRoot = QLatin1String(settingsGroupC) + QLatin1Char('/');
enabled = s->value(keyRoot + QLatin1String(enabledKeyC), QVariant(false)).toBool();
additionalArguments = s->value(keyRoot + QLatin1String(additionalArgumentsKeyC), QString()).toString();
symbolPaths = s->value(keyRoot + QLatin1String(symbolPathsKeyC), QStringList()).toStringList();
sourcePaths = s->value(keyRoot + QLatin1String(sourcePathsKeyC), QStringList()).toStringList();
@@ -80,7 +77,6 @@ void CdbOptions::fromSettings(QSettings *s)
void CdbOptions::toSettings(QSettings *s) const
{
s->beginGroup(QLatin1String(settingsGroupC));
s->setValue(QLatin1String(enabledKeyC), enabled);
s->setValue(QLatin1String(symbolPathsKeyC), symbolPaths);
s->setValue(QLatin1String(sourcePathsKeyC), sourcePaths);
s->setValue(QLatin1String(breakEventKeyC), breakEvents);
@@ -90,13 +86,11 @@ void CdbOptions::toSettings(QSettings *s) const
bool CdbOptions::equals(const CdbOptions &rhs) const
{
return enabled == rhs.enabled
&& additionalArguments == rhs.additionalArguments
return additionalArguments == rhs.additionalArguments
&& symbolPaths == rhs.symbolPaths
&& sourcePaths == rhs.sourcePaths
&& breakEvents == rhs.breakEvents;
}
} // namespace Internal
} // namespace Debugger

View File

@@ -48,10 +48,10 @@ struct CdbOptions
public:
CdbOptions();
bool isValid() const { return enabled; }
void clear();
bool isValid() { return true; }
void fromSettings(QSettings *s); // Writes parameters on first-time autodetect
void toSettings(QSettings *s) const;
@@ -60,7 +60,6 @@ public:
static QString settingsGroup();
static QStringList oldEngineSymbolPaths(const QSettings *s);
bool enabled;
QString additionalArguments;
QStringList symbolPaths;
QStringList sourcePaths;

View File

@@ -172,7 +172,6 @@ CdbOptionsPageWidget::CdbOptionsPageWidget(QWidget *parent) :
void CdbOptionsPageWidget::setOptions(CdbOptions &o)
{
m_ui.additionalArgumentsLineEdit->setText(o.additionalArguments);
m_ui.cdbPathGroupBox->setChecked(o.enabled);
setSymbolPaths(o.symbolPaths);
m_ui.sourcePathListEditor->setPathList(o.sourcePaths);
m_breakEventWidget->setBreakEvents(o.breakEvents);
@@ -182,7 +181,6 @@ CdbOptions CdbOptionsPageWidget::options() const
{
CdbOptions rc;
rc.additionalArguments = m_ui.additionalArgumentsLineEdit->text().trimmed();
rc.enabled = m_ui.cdbPathGroupBox->isChecked();
rc.symbolPaths = symbolPaths();
rc.sourcePaths = m_ui.sourcePathListEditor->pathList();
rc.breakEvents = m_breakEventWidget->breakEvents();

View File

@@ -16,10 +16,13 @@
<item>
<widget class="QGroupBox" name="cdbPathGroupBox">
<property name="title">
<string extracomment="Placeholder">CDB</string>
<string extracomment="Placeholder">Startup</string>
</property>
<property name="checkable">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
@@ -44,7 +47,7 @@
</layout>
</item>
<item>
<widget class="QGroupBox" name="pathGroupBox">
<widget class="QGroupBox" name="startupGroupBox">
<property name="title">
<string>Debugger Paths</string>
</property>