Debugger: Do configuration error checking early on.

Add a configuration checking method to the Debugger manager,
depending on toolchain, wire it to the engines.
Check that in the debugger run controls.

Add a convenience method to ICore that shows a warning
message with a "Settings" button, pointing the user
to a configuration error on a settings page.

Remove leftovers of the dumper parser.
Acked-by: con <qtc-committer@nokia.com>
This commit is contained in:
Friedemann Kleint
2009-10-08 17:23:27 +02:00
parent c6de8d457b
commit 22ab8d5662
19 changed files with 225 additions and 222 deletions

View File

@@ -925,11 +925,8 @@ static IDebuggerEngine *determineDebuggerEngine(const QString &executable,
// We need the CDB debugger in order to be able to debug VS
// executables
if (!winEngine) {
*errorMessage = DebuggerManager::tr("Debugging VS executables is currently not enabled.");
*settingsIdHint = QLatin1String("Cdb");
if (!DebuggerManager::instance()->checkDebugConfiguration(ProjectExplorer::ToolChain::MSVC, errorMessage, 0 , settingsIdHint))
return 0;
}
return winEngine;
#endif
}
@@ -991,7 +988,9 @@ void DebuggerManager::startNewDebugger(const DebuggerStartParametersPtr &sp)
// Create Message box with possibility to go to settings
const QString msg = tr("Cannot debug '%1' (tool chain: '%2'): %3").
arg(d->m_startParameters->executable, toolChainName, errorMessage);
warningWithSettings(tr("Warning"), msg, QString(), settingsIdHint);
Core::ICore::instance()->showWarningWithOptions(tr("Warning"), msg, QString(),
QLatin1String(DEBUGGER_SETTINGS_CATEGORY),
settingsIdHint);
return;
}
@@ -1713,6 +1712,49 @@ bool DebuggerManager::debuggerActionsEnabled() const
return false;
}
bool DebuggerManager::checkDebugConfiguration(int toolChain,
QString *errorMessage,
QString *settingsCategory /* = 0 */,
QString *settingsPage /* = 0 */) const
{
errorMessage->clear();
if (settingsCategory)
settingsCategory->clear();
if (settingsPage)
settingsPage->clear();
bool success = true;
switch(toolChain) {
case ProjectExplorer::ToolChain::GCC:
case ProjectExplorer::ToolChain::LinuxICC:
case ProjectExplorer::ToolChain::MinGW:
case ProjectExplorer::ToolChain::WINCE: // S60
case ProjectExplorer::ToolChain::WINSCW:
case ProjectExplorer::ToolChain::GCCE:
case ProjectExplorer::ToolChain::RVCT_ARMV5:
case ProjectExplorer::ToolChain::RVCT_ARMV6:
if (gdbEngine) {
success = gdbEngine->checkConfiguration(toolChain, errorMessage, settingsPage);
} else {
success = false;
*errorMessage = msgEngineNotAvailable("Gdb");
}
break;
case ProjectExplorer::ToolChain::MSVC:
if (winEngine) {
success = winEngine->checkConfiguration(toolChain, errorMessage, settingsPage);
} else {
success = false;
*errorMessage = msgEngineNotAvailable("Cdb");
if (settingsPage)
*settingsPage = QLatin1String("Cdb");
}
break;
}
if (!success && settingsCategory && settingsPage && !settingsPage->isEmpty())
*settingsCategory = QLatin1String(DEBUGGER_SETTINGS_CATEGORY);
return success;
}
QDebug operator<<(QDebug d, DebuggerState state)
{
return d << stateName(state) << '(' << int(state) << ')';