forked from qt-creator/qt-creator
lldb: Fix type inspection for QMetaType template types
lldb's FindFirstType() expects template types to have specific whitespaces set. QMetaType's "name" parameter does not contain the necessary whitespaces. This solves that by changing e.g.: "T<A,B<C,D>>"" to "T<A, B<C, D> >". Change-Id: I7505db96b01d433408af1942cd81e50094833c06 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -791,6 +791,7 @@ class Dumper(DumperBase):
|
||||
|
||||
def lookupNativeType(self, name):
|
||||
#DumperBase.warn('LOOKUP TYPE NAME: %s' % name)
|
||||
|
||||
typeobj = self.typeCache.get(name)
|
||||
if typeobj is not None:
|
||||
#DumperBase.warn('CACHED: %s' % name)
|
||||
@@ -846,6 +847,15 @@ class Dumper(DumperBase):
|
||||
if typeobj is not None:
|
||||
return typeobj
|
||||
|
||||
# For QMetaType based typenames we have to re-format the type name.
|
||||
# Converts "T<A,B<C,D>>"" to "T<A, B<C, D> >" since FindFirstType
|
||||
# expects it that way.
|
||||
name = name.replace(',', ', ').replace('>>', '> >')
|
||||
typeobj = self.target.FindFirstType(name)
|
||||
if typeobj.IsValid():
|
||||
self.typeCache[name] = typeobj
|
||||
return typeobj
|
||||
|
||||
return lldb.SBType()
|
||||
|
||||
def setupInferior(self, args):
|
||||
|
||||
Reference in New Issue
Block a user