Debugger: Use Startparameters.debuggerCommand for command.

Use in both engines preferred over ABI if it is compatible.
Report start parameters. Introduce gdb configuration check.
This commit is contained in:
Friedemann Kleint
2011-02-25 13:43:06 +01:00
parent a49972e783
commit 14d590590f
13 changed files with 163 additions and 68 deletions

View File

@@ -333,6 +333,18 @@ static inline QString msgNoCdbBinaryForToolChain(const ProjectExplorer::Abi &tc)
return CdbEngine::tr("There is no CDB binary available for binaries in format '%1'").arg(tc.toString());
}
static QString cdbBinary(const DebuggerStartParameters &sp)
{
if (!sp.debuggerCommand.isEmpty()) {
// Do not use a GDB binary if we got started for a project with MinGW runtime.
const bool abiMatch = sp.toolChainAbi.os() == ProjectExplorer::Abi::WindowsOS
&& sp.toolChainAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvcFlavor;
if (abiMatch)
return sp.debuggerCommand;
}
return debuggerCore()->debuggerForAbi(sp.toolChainAbi, CdbEngineType);
}
bool checkCdbConfiguration(const DebuggerStartParameters &sp, ConfigurationCheck *check)
{
#ifdef Q_OS_WIN
@@ -344,13 +356,6 @@ bool checkCdbConfiguration(const DebuggerStartParameters &sp, ConfigurationCheck
return false;
}
if (debuggerCore()->debuggerForAbi(sp.toolChainAbi, CdbEngineType).isEmpty()) {
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->errorDetails.push_back(CdbEngine::tr("The CDB engine does not support start mode %1.").arg(sp.startMode));
return false;
@@ -361,6 +366,14 @@ bool checkCdbConfiguration(const DebuggerStartParameters &sp, ConfigurationCheck
arg(sp.toolChainAbi.toString()));
return false;
}
if (cdbBinary(sp).isEmpty()) {
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;
}
return true;
#else
Q_UNUSED(sp);
@@ -652,7 +665,7 @@ bool CdbEngine::launchCDB(const DebuggerStartParameters &sp, QString *errorMessa
// Determine binary (force MSVC), extension lib name and path to use
// The extension is passed as relative name with the path variable set
//(does not work with absolute path names)
const QString executable = debuggerCore()->debuggerForAbi(sp.toolChainAbi, CdbEngineType);
const QString executable = cdbBinary(sp);
if (executable.isEmpty()) {
*errorMessage = tr("There is no CDB executable specified.");
return false;