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

Debugger: Work on older LLDB.



Breakpoint setting and some data examination give now
results with 167.2. Communication is not working, only
one event is handled.

Change-Id: Ice40e568ee0e9bbe0d45cde20563929b7370695d
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 848a725e
...@@ -274,6 +274,7 @@ class Dumper(DumperBase): ...@@ -274,6 +274,7 @@ class Dumper(DumperBase):
# self.debugger.GetCategoryAtIndex(i).SetEnabled(False) # self.debugger.GetCategoryAtIndex(i).SetEnabled(False)
self.isLldb = True self.isLldb = True
self.isGoodLldb = hasattr(lldb.SBValue, "SetPreferDynamicValue")
self.process = None self.process = None
self.target = None self.target = None
self.eventState = lldb.eStateInvalid self.eventState = lldb.eStateInvalid
...@@ -319,7 +320,8 @@ class Dumper(DumperBase): ...@@ -319,7 +320,8 @@ class Dumper(DumperBase):
if isinstance(item.name, lldb.SBValue): if isinstance(item.name, lldb.SBValue):
# Avoid $$__synth__ suffix on Mac. # Avoid $$__synth__ suffix on Mac.
value = item.name value = item.name
value.SetPreferSyntheticValue(False) if self.isGoodLldb:
value.SetPreferSyntheticValue(False)
item.name = value.GetName() item.name = value.GetName()
if item.name is None: if item.name is None:
self.anonNumber += 1 self.anonNumber += 1
...@@ -866,6 +868,8 @@ class Dumper(DumperBase): ...@@ -866,6 +868,8 @@ class Dumper(DumperBase):
return result return result
def extractStaticMetaObject(self, typeobj): def extractStaticMetaObject(self, typeobj):
if not self.isGoodLldb:
return 0
result = self.extractStaticMetaObjectHelper(typeobj) result = self.extractStaticMetaObjectHelper(typeobj)
if result: if result:
return result return result
...@@ -903,13 +907,17 @@ class Dumper(DumperBase): ...@@ -903,13 +907,17 @@ class Dumper(DumperBase):
if self.currentPrintsAddress and not addr is None: if self.currentPrintsAddress and not addr is None:
self.put('addr="0x%x",' % int(addr)) self.put('addr="0x%x",' % int(addr))
def isFunctionType(self, type): def isFunctionType(self, typeobj):
return type.IsFunctionType() if self.isGoodLldb:
return typeobj.IsFunctionType()
#warn("TYPE: %s" % typeobj)
return False
def putItem(self, value, tryDynamic=True): def putItem(self, value, tryDynamic=True):
#value = value.GetDynamicValue(lldb.eDynamicCanRunTarget) #value = value.GetDynamicValue(lldb.eDynamicCanRunTarget)
typeName = value.GetType().GetUnqualifiedType().GetName() typeName = value.GetType().GetUnqualifiedType().GetName()
value.SetPreferDynamicValue(tryDynamic) if self.isGoodLldb:
value.SetPreferDynamicValue(tryDynamic)
typeClass = value.GetType().GetTypeClass() typeClass = value.GetType().GetTypeClass()
if tryDynamic: if tryDynamic:
...@@ -921,7 +929,8 @@ class Dumper(DumperBase): ...@@ -921,7 +929,8 @@ class Dumper(DumperBase):
summary = value.GetTypeSummary() summary = value.GetTypeSummary()
if summary.IsValid(): if summary.IsValid():
warn("DATA: %s" % summary.GetData()) warn("DATA: %s" % summary.GetData())
value.SetPreferSyntheticValue(False) if self.isGoodLldb:
value.SetPreferSyntheticValue(False)
provider = value.GetTypeSynthetic() provider = value.GetTypeSynthetic()
data = provider.GetData() data = provider.GetData()
formatter = eval(data)(value, {}) formatter = eval(data)(value, {})
...@@ -956,7 +965,8 @@ class Dumper(DumperBase): ...@@ -956,7 +965,8 @@ class Dumper(DumperBase):
return return
# Our turf now. # Our turf now.
value.SetPreferSyntheticValue(False) if self.isGoodLldb:
value.SetPreferSyntheticValue(False)
# Arrays # Arrays
if typeClass == lldb.eTypeClassArray: if typeClass == lldb.eTypeClassArray:
......
Markdown is supported
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