Commit 5c74244e authored by hjk's avatar hjk
Browse files

Debugger: Try to find more types with LLDB

The actual problem is that LLDB considers types that differ
only in spacing of the "name" (i.e. "foo *" and "foo*") as
different and can not look them up with the "wrong" name.

Change-Id: Iff79436b6a13a40de9b7b669bece2204ac858edb
Reviewed-by: default avatarhjk <>
parent 9b42244d
......@@ -312,6 +312,7 @@ class Dumper(DumperBase):
self.isShuttingDown_ = False
self.isInterrupting_ = False
self.dummyValue = None
self.types_ = {}
def enterSubItem(self, item):
if isinstance(, lldb.SBValue):
......@@ -614,15 +615,32 @@ class Dumper(DumperBase):
return xrange(0, self.currentNumChild)
return xrange(min(self.currentMaxNumChild, self.currentNumChild))
def canonicalTypeName(self, name):
return re.sub('\\bconst\\b', '', name).replace(' ', '')
def lookupType(self, name):
#warn("LOOKUP TYPE NAME: %s" % name)
if name.endswith('*'):
type = self.lookupType(name[:-1].strip())
return type.GetPointerType() if type.IsValid() else None
type =
#warn("LOOKUP RESULT: %s" %
#warn("LOOKUP VALID: %s" % type.IsValid())
return type if type.IsValid() else None
typeobj = self.lookupType(name[:-1].strip())
return typeobj.GetPointerType() if type.IsValid() else None
typeobj =
#warn("LOOKUP RESULT: %s" %
#warn("LOOKUP VALID: %s" % typeobj.IsValid())
if typeobj.IsValid():
return typeobj
if len(self.types_) == 0:
for i in xrange(
module =
# SBModule.GetType is new somewhere after early 300.x
# So this may fail.
for t in module.GetTypes():
n = self.canonicalTypeName(t.GetName())
self.types_[n] = t
return self.types_.get(self.canonicalTypeName(name))
return None
def setupInferior(self, args):
error = lldb.SBError()
Supports Markdown
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