Debugger: Display error when debugger ABI doesn't match toolchain ABI.

Currently restricting the ABI check to desktop devices, may be extended
to all device types.

Change-Id: I90df4b35bda5b6c59dc8b057994b23b0ae8a49d0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
David Schulz
2016-06-08 11:04:07 +02:00
committed by David Schulz
parent 15ea5aa7fe
commit a9066f30f0

View File

@@ -215,7 +215,8 @@ enum DebuggerConfigurationErrors {
NoDebugger = 0x1, NoDebugger = 0x1,
DebuggerNotFound = 0x2, DebuggerNotFound = 0x2,
DebuggerNotExecutable = 0x4, DebuggerNotExecutable = 0x4,
DebuggerNeedsAbsolutePath = 0x8 DebuggerNeedsAbsolutePath = 0x8,
DebuggerDoesNotMatch = 0x10
}; };
static unsigned debuggerConfigurationErrors(const Kit *k) static unsigned debuggerConfigurationErrors(const Kit *k)
@@ -236,15 +237,23 @@ static unsigned debuggerConfigurationErrors(const Kit *k)
else if (!fi.isExecutable()) else if (!fi.isExecutable())
result |= DebuggerNotExecutable; result |= DebuggerNotExecutable;
const ToolChain *tc = ToolChainKitInformation::toolChain(k);
if (tc && item->matchTarget(tc->targetAbi()) == DebuggerItem::DoesNotMatch) {
// currently restricting the check to desktop devices, may be extended to all device types
const IDevice::ConstPtr device = DeviceKitInformation::device(k);
if (device && device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE)
result |= DebuggerDoesNotMatch;
}
if (!fi.exists() || fi.isDir()) { if (!fi.exists() || fi.isDir()) {
if (item->engineType() == NoEngineType) if (item->engineType() == NoEngineType)
return NoDebugger; return NoDebugger;
// We need an absolute path to be able to locate Python on Windows. // We need an absolute path to be able to locate Python on Windows.
if (item->engineType() == GdbEngineType) if (item->engineType() == GdbEngineType) {
if (const ToolChain *tc = ToolChainKitInformation::toolChain(k)) if (tc && tc->targetAbi().os() == Abi::WindowsOS && !fi.isAbsolute())
if (tc->targetAbi().os() == Abi::WindowsOS && !fi.isAbsolute()) result |= DebuggerNeedsAbsolutePath;
result |= DebuggerNeedsAbsolutePath; }
} }
return result; return result;
} }
@@ -289,6 +298,12 @@ QList<Task> DebuggerKitInformation::validateDebugger(const Kit *k)
"absolute path (%1).").arg(path); "absolute path (%1).").arg(path);
result << Task(Task::Error, message, FileName(), -1, id); result << Task(Task::Error, message, FileName(), -1, id);
} }
if (errors & DebuggerDoesNotMatch) {
const QString message = tr("The ABI of the selected debugger does not "
"match the toolchain ABI.");
result << Task(Task::Error, message, FileName(), -1, id);
}
return result; return result;
} }