forked from qt-creator/qt-creator
Make sure lldbbridge.fromNativeValue always sets value name
Change-Id: I40296843bcbc504d6271a1f30ac4f8c4a1a2fe85 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -117,6 +117,7 @@ class Dumper(DumperBase):
|
|||||||
nativeValue.SetPreferSyntheticValue(False)
|
nativeValue.SetPreferSyntheticValue(False)
|
||||||
nativeType = nativeValue.GetType()
|
nativeType = nativeValue.GetType()
|
||||||
code = nativeType.GetTypeClass()
|
code = nativeType.GetTypeClass()
|
||||||
|
|
||||||
if code == lldb.eTypeClassReference:
|
if code == lldb.eTypeClassReference:
|
||||||
nativeTargetType = nativeType.GetDereferencedType()
|
nativeTargetType = nativeType.GetDereferencedType()
|
||||||
if not nativeTargetType.IsPointerType():
|
if not nativeTargetType.IsPointerType():
|
||||||
@@ -125,8 +126,7 @@ class Dumper(DumperBase):
|
|||||||
val = self.createReferenceValue(nativeValue.GetValueAsUnsigned(), targetType)
|
val = self.createReferenceValue(nativeValue.GetValueAsUnsigned(), targetType)
|
||||||
val.laddress = nativeValue.AddressOf().GetValueAsUnsigned()
|
val.laddress = nativeValue.AddressOf().GetValueAsUnsigned()
|
||||||
#warn('CREATED REF: %s' % val)
|
#warn('CREATED REF: %s' % val)
|
||||||
return val
|
elif code == lldb.eTypeClassPointer:
|
||||||
if code == lldb.eTypeClassPointer:
|
|
||||||
nativeTargetType = nativeType.GetPointeeType()
|
nativeTargetType = nativeType.GetPointeeType()
|
||||||
if not nativeTargetType.IsPointerType():
|
if not nativeTargetType.IsPointerType():
|
||||||
nativeTargetType = nativeTargetType.GetUnqualifiedType()
|
nativeTargetType = nativeTargetType.GetUnqualifiedType()
|
||||||
@@ -135,16 +135,14 @@ class Dumper(DumperBase):
|
|||||||
#warn('CREATED PTR 1: %s' % val)
|
#warn('CREATED PTR 1: %s' % val)
|
||||||
val.laddress = nativeValue.AddressOf().GetValueAsUnsigned()
|
val.laddress = nativeValue.AddressOf().GetValueAsUnsigned()
|
||||||
#warn('CREATED PTR 2: %s' % val)
|
#warn('CREATED PTR 2: %s' % val)
|
||||||
return val
|
elif code == lldb.eTypeClassTypedef:
|
||||||
if code == lldb.eTypeClassTypedef:
|
|
||||||
nativeTargetType = nativeType.GetUnqualifiedType()
|
nativeTargetType = nativeType.GetUnqualifiedType()
|
||||||
if hasattr(nativeTargetType, 'GetCanonicalType'):
|
if hasattr(nativeTargetType, 'GetCanonicalType'):
|
||||||
nativeTargetType = nativeTargetType.GetCanonicalType()
|
nativeTargetType = nativeTargetType.GetCanonicalType()
|
||||||
val = self.fromNativeValue(nativeValue.Cast(nativeTargetType))
|
val = self.fromNativeValue(nativeValue.Cast(nativeTargetType))
|
||||||
val.type = self.fromNativeType(nativeType)
|
val.type = self.fromNativeType(nativeType)
|
||||||
#warn('CREATED TYPEDEF: %s' % val)
|
#warn('CREATED TYPEDEF: %s' % val)
|
||||||
return val
|
else:
|
||||||
|
|
||||||
val = self.Value(self)
|
val = self.Value(self)
|
||||||
address = nativeValue.GetLoadAddress()
|
address = nativeValue.GetLoadAddress()
|
||||||
if not address is None:
|
if not address is None:
|
||||||
@@ -162,7 +160,6 @@ class Dumper(DumperBase):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
val.type = self.fromNativeType(nativeType)
|
val.type = self.fromNativeType(nativeType)
|
||||||
val.lIsInScope = nativeValue.IsInScope()
|
|
||||||
|
|
||||||
if code == lldb.eTypeClassEnumeration:
|
if code == lldb.eTypeClassEnumeration:
|
||||||
intval = nativeValue.GetValueAsSigned()
|
intval = nativeValue.GetValueAsSigned()
|
||||||
@@ -178,13 +175,6 @@ class Dumper(DumperBase):
|
|||||||
val.ldisplay = '%d' % intval
|
val.ldisplay = '%d' % intval
|
||||||
elif code in (lldb.eTypeClassComplexInteger, lldb.eTypeClassComplexFloat):
|
elif code in (lldb.eTypeClassComplexInteger, lldb.eTypeClassComplexFloat):
|
||||||
val.ldisplay = str(nativeValue.GetValue())
|
val.ldisplay = str(nativeValue.GetValue())
|
||||||
elif code == lldb.eTypeClassReference:
|
|
||||||
derefNativeValue = nativeValue.Dereference()
|
|
||||||
derefNativeValue = derefNativeValue.Cast(derefNativeValue.GetType().GetUnqualifiedType())
|
|
||||||
val1 = self.Value(self)
|
|
||||||
val1.type = val.type
|
|
||||||
val1.targetValue = self.fromNativeValue(derefNativeValue)
|
|
||||||
return val1
|
|
||||||
#elif code == lldb.eTypeClassArray:
|
#elif code == lldb.eTypeClassArray:
|
||||||
# if hasattr(nativeType, 'GetArrayElementType'): # New in 3.8(?) / 350.x
|
# if hasattr(nativeType, 'GetArrayElementType'): # New in 3.8(?) / 350.x
|
||||||
# val.type.ltarget = self.fromNativeType(nativeType.GetArrayElementType())
|
# val.type.ltarget = self.fromNativeType(nativeType.GetArrayElementType())
|
||||||
@@ -195,6 +185,7 @@ class Dumper(DumperBase):
|
|||||||
#elif code == lldb.eTypeClassVector:
|
#elif code == lldb.eTypeClassVector:
|
||||||
# val.type.ltarget = self.fromNativeType(nativeType.GetVectorElementType())
|
# val.type.ltarget = self.fromNativeType(nativeType.GetVectorElementType())
|
||||||
|
|
||||||
|
val.lIsInScope = nativeValue.IsInScope()
|
||||||
val.name = nativeValue.GetName()
|
val.name = nativeValue.GetName()
|
||||||
return val
|
return val
|
||||||
|
|
||||||
@@ -1145,7 +1136,6 @@ class Dumper(DumperBase):
|
|||||||
# default values: void foo(int = 0)
|
# default values: void foo(int = 0)
|
||||||
continue
|
continue
|
||||||
value = self.fromNativeFrameValue(val)
|
value = self.fromNativeFrameValue(val)
|
||||||
value.name = name
|
|
||||||
variables.append(value)
|
variables.append(value)
|
||||||
|
|
||||||
self.handleLocals(variables)
|
self.handleLocals(variables)
|
||||||
|
Reference in New Issue
Block a user