Commit 795d4506 authored by Friedemann Kleint's avatar Friedemann Kleint

Debugger: Fix MSVC detection.

Trigger AttachCore for MSVC flavours only.
Handle .dmp files on the command line.

Change-Id: I65be1ad7aef36db157a84499ff5e10d9f1e8fb97
Reviewed-on: http://codereview.qt.nokia.com/2766Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@nokia.com>
parent 197c60e9
......@@ -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;
}
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment