diff options
author | hjk <hjk@qt.io> | 2020-12-11 10:46:38 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2020-12-11 12:20:23 +0000 |
commit | b288cb6706811b1008bc01b3405a76916294141f (patch) | |
tree | 07ed673483250b997df64cd163b83aee7b6f931c | |
parent | d4ed07eb872fd29bd7b3fcf1955b9825a5702d3b (diff) |
Debugger: Fix template type alias handling for LLDB
Case like 'template<typename T> using TVector = std::vector<T>'
end up only as 'TVector' in the debug info. This is unsuitable
as an id in our type info caching as this would only allow one
type layout for all specializations, which is not the case for
e.g. std::vector<bool>.
The solution is to mangle the target type into the id, as already
done for GDB.
This makes the Typedef2 dumper test pass.
Change-Id: I11538bbf6431f61a11c18366a2a2b4911cdc2e0e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r-- | share/qtcreator/debugger/lldbbridge.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index b1eee5d8c0..1a61068aaa 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -419,7 +419,8 @@ class Dumper(DumperBase): if hasattr(nativeTargetType, 'GetCanonicalType'): nativeTargetType = nativeTargetType.GetCanonicalType() targetType = self.fromNativeType(nativeTargetType) - return self.createTypedefedType(targetType, nativeType.GetName()) + return self.createTypedefedType(targetType, nativeType.GetName(), + self.nativeTypeId(nativeType)) nativeType = nativeType.GetUnqualifiedType() typeName = self.typeName(nativeType) @@ -551,6 +552,11 @@ class Dumper(DumperBase): return nativeType.GetName() def nativeTypeId(self, nativeType): + if nativeType and (nativeType.GetTypeClass() == lldb.eTypeClassTypedef): + nativeTargetType = nativeType.GetUnqualifiedType() + if hasattr(nativeTargetType, 'GetCanonicalType'): + nativeTargetType = nativeTargetType.GetCanonicalType() + return '%s{%s}' % (nativeType.name, nativeTargetType.name) name = self.typeName(nativeType) if name is None or len(name) == 0: c = '0' |