forked from qt-creator/qt-creator
Debugger: Improve ABI compatibility matching
Debugger ABI compatibility is not the same as the implementation in ABI.
For instance, GDB can support multiarch targets, so matching the arch is
not good enough.
Use DebuggerItem::matchTarget and adapt it to consider ABI mismatches as
MatchesSomewhat for GDB/LLDB, which are potentially build with multiarch
(unfortunately there is no easy way to tell, at least for GDB).
Amends commit c04f3a94ea
.
Fixes: QTCREATORBUG-28020
Change-Id: I555c4e886c641bfdf50ca660eda499c18260f6f4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
497b20ade7
commit
40a1a719fe
@@ -406,29 +406,34 @@ void DebuggerItem::setAbi(const Abi &abi)
|
||||
|
||||
static DebuggerItem::MatchLevel matchSingle(const Abi &debuggerAbi, const Abi &targetAbi, DebuggerEngineType engineType)
|
||||
{
|
||||
DebuggerItem::MatchLevel matchOnMultiarch = DebuggerItem::DoesNotMatch;
|
||||
const bool isMsvcTarget = targetAbi.osFlavor() >= Abi::WindowsMsvc2005Flavor &&
|
||||
targetAbi.osFlavor() <= Abi::WindowsLastMsvcFlavor;
|
||||
if (!isMsvcTarget && (engineType == GdbEngineType || engineType == LldbEngineType))
|
||||
matchOnMultiarch = DebuggerItem::MatchesSomewhat;
|
||||
if (debuggerAbi.architecture() != Abi::UnknownArchitecture
|
||||
&& debuggerAbi.architecture() != targetAbi.architecture())
|
||||
return DebuggerItem::DoesNotMatch;
|
||||
return matchOnMultiarch;
|
||||
|
||||
if (debuggerAbi.os() != Abi::UnknownOS
|
||||
&& debuggerAbi.os() != targetAbi.os())
|
||||
return DebuggerItem::DoesNotMatch;
|
||||
return matchOnMultiarch;
|
||||
|
||||
if (debuggerAbi.binaryFormat() != Abi::UnknownFormat
|
||||
&& debuggerAbi.binaryFormat() != targetAbi.binaryFormat())
|
||||
return DebuggerItem::DoesNotMatch;
|
||||
return matchOnMultiarch;
|
||||
|
||||
if (debuggerAbi.os() == Abi::WindowsOS) {
|
||||
if (debuggerAbi.osFlavor() == Abi::WindowsMSysFlavor && targetAbi.osFlavor() != Abi::WindowsMSysFlavor)
|
||||
return DebuggerItem::DoesNotMatch;
|
||||
return matchOnMultiarch;
|
||||
if (debuggerAbi.osFlavor() != Abi::WindowsMSysFlavor && targetAbi.osFlavor() == Abi::WindowsMSysFlavor)
|
||||
return DebuggerItem::DoesNotMatch;
|
||||
return matchOnMultiarch;
|
||||
}
|
||||
|
||||
if (debuggerAbi.wordWidth() == 64 && targetAbi.wordWidth() == 32)
|
||||
return DebuggerItem::MatchesSomewhat;
|
||||
if (debuggerAbi.wordWidth() != 0 && debuggerAbi.wordWidth() != targetAbi.wordWidth())
|
||||
return DebuggerItem::DoesNotMatch;
|
||||
return matchOnMultiarch;
|
||||
|
||||
// We have at least 'Matches well' now. Mark the combinations we really like.
|
||||
if (HostOsInfo::isWindowsHost() && engineType == CdbEngineType
|
||||
|
@@ -250,10 +250,8 @@ void DebuggerKitAspect::fix(Kit *k)
|
||||
return;
|
||||
}
|
||||
const Abi tcAbi = ToolChainKitAspect::targetAbi(k);
|
||||
for (const Abi &abi : item->abis()) {
|
||||
if (abi.isCompatibleWith(tcAbi))
|
||||
if (item->matchTarget(tcAbi) != DebuggerItem::DoesNotMatch)
|
||||
return;
|
||||
}
|
||||
k->setValue(DebuggerKitAspect::id(), QVariant());
|
||||
setup(k);
|
||||
return; // All fine (now).
|
||||
|
Reference in New Issue
Block a user