diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index ba13c1dc97880c7a93fb050a7bc73a595cb84bd8..c10699f76c23cef14d14fd52a80b3ecdb22537bb 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -357,14 +357,19 @@ 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 inline bool isMSVC_Flavor(ProjectExplorer::Abi::OSFlavor osf) +{ + return osf == ProjectExplorer::Abi::WindowsMsvc2005Flavor + || osf == ProjectExplorer::Abi::WindowsMsvc2008Flavor + || osf == ProjectExplorer::Abi::WindowsMsvc2010Flavor; +} + 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::WindowsMsvc2005Flavor - || sp.toolChainAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvc2008Flavor - || sp.toolChainAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvc2010Flavor); + && isMSVC_Flavor(sp.toolChainAbi.osFlavor()); if (abiMatch) return sp.debuggerCommand; } @@ -393,9 +398,8 @@ bool checkCdbConfiguration(const DebuggerStartParameters &sp, ConfigurationCheck return false; } - if (sp.toolChainAbi.osFlavor() == Abi::WindowsMSysFlavor - && sp.startMode == AttachCore) { - check->errorDetails.push_back(CdbEngine::tr("The CDB debug engine cannot debug MSys core files.")); + if (sp.startMode == AttachCore && !isMSVC_Flavor(sp.toolChainAbi.osFlavor()) { + check->errorDetails.push_back(CdbEngine::tr("The CDB debug engine cannot debug gdb core files.")); return false; } diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 60cfc311a608a14b8394f3f799b666f62ef241a4..7602dd062d4fc261d27f821520ca0c548bb7ae52 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1213,8 +1213,11 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it, sp.toolChainAbi = anyAbiOfBinary(sp.executable); } else { // Fixme: Distinguish between core-file and executable by argument syntax? - // (default up to 2.2 was core-file). - if (Abi::hostAbi().os() == Abi::WindowsOS || QFileInfo(*it).isExecutable()) { + // (default up to 2.2 was core-file (".dmp on Windows)). + const bool isExecutable = Abi::hostAbi().os() == Abi::WindowsOS ? + !it->endsWith(QLatin1String(".dmp"), Qt::CaseInsensitive) : + QFileInfo(*it).isExecutable(); + if (isExecutable) { sp.startMode = StartExternal; sp.executable = *it; sp.displayName = tr("Executable file \"%1\"").arg(sp.executable);