1 STRING_EXTENSION_LEVEL_OUTSIDE
(SBTypeMember
, lldb
::eDescriptionLevelBrief
)
2 %extend lldb
::SBTypeMember
{
5 # operator
== is a free function
, which swig does not handle
, so we inject
6 # our own equality operator here
7 def __eq__
(self
, other
):
8 return not self.__ne__
(other
)
10 name
= property
(GetName
, None
, doc
='''A read only property that returns the name for this member as a string.'''
)
11 type
= property
(GetType
, None
, doc
='''A read only property that returns an lldb object that represents the type
(lldb.SBType
) for this member.'''
)
12 byte_offset
= property
(GetOffsetInBytes
, None
, doc
='''A read only property that returns offset in bytes for this member as an integer.'''
)
13 bit_offset
= property
(GetOffsetInBits
, None
, doc
='''A read only property that returns offset in bits for this member as an integer.'''
)
14 is_bitfield
= property
(IsBitfield
, None
, doc
='''A read only property that returns true if this member is a bitfield.'''
)
15 bitfield_bit_size
= property
(GetBitfieldSizeInBits
, None
, doc
='''A read only property that returns the bitfield size in bits for this member as an integer
, or zero if this member is not a bitfield.'''
)
20 STRING_EXTENSION_LEVEL_OUTSIDE
(SBTypeMemberFunction
, lldb
::eDescriptionLevelBrief
)
22 %extend lldb
::SBTypeMemberFunction
{
25 # operator
== is a free function
, which swig does not handle
, so we inject
26 # our own equality operator here
27 def __eq__
(self
, other
):
28 return not self.__ne__
(other
)
34 STRING_EXTENSION_LEVEL_OUTSIDE
(SBType
, lldb
::eDescriptionLevelBrief
)
36 %extend lldb
::SBType
{
39 def template_arg_array
(self
):
40 num_args
= self.num_template_args
43 for i in range
(num_args
):
44 template_args.append
(self.GetTemplateArgumentType
(i
))
48 # operator
== is a free function
, which swig does not handle
, so we inject
49 # our own equality operator here
50 def __eq__
(self
, other
):
51 return not self.__ne__
(other
)
54 return self.GetByteSize
()
56 module
= property
(GetModule
, None
, doc
='''A read only property that returns the module in which type is defined.'''
)
57 name
= property
(GetName
, None
, doc
='''A read only property that returns the name for this type as a string.'''
)
58 size
= property
(GetByteSize
, None
, doc
='''A read only property that returns size in bytes for this type as an integer.'''
)
59 is_pointer
= property
(IsPointerType
, None
, doc
='''A read only property that returns a boolean value that indicates if this type is a pointer type.'''
)
60 is_reference
= property
(IsReferenceType
, None
, doc
='''A read only property that returns a boolean value that indicates if this type is a reference type.'''
)
61 is_reference
= property
(IsReferenceType
, None
, doc
='''A read only property that returns a boolean value that indicates if this type is a function type.'''
)
62 num_fields
= property
(GetNumberOfFields
, None
, doc
='''A read only property that returns number of fields in this type as an integer.'''
)
63 num_bases
= property
(GetNumberOfDirectBaseClasses
, None
, doc
='''A read only property that returns number of direct base classes in this type as an integer.'''
)
64 num_vbases
= property
(GetNumberOfVirtualBaseClasses
, None
, doc
='''A read only property that returns number of virtual base classes in this type as an integer.'''
)
65 num_template_args
= property
(GetNumberOfTemplateArguments
, None
, doc
='''A read only property that returns number of template arguments in this type as an integer.'''
)
66 template_args
= property
(template_arg_array
, None
, doc
='''A read only property that returns a list
() of lldb.SBType objects that represent all template arguments in this type.'''
)
67 type
= property
(GetTypeClass
, None
, doc
='''A read only property that returns an lldb enumeration value
(see enumerations that start with
"lldb.eTypeClass") that represents a classification for this type.'''
)
68 is_complete
= property
(IsTypeComplete
, None
, doc
='''A read only property that returns a boolean value that indicates if this type is a complete type
(True
) or a forward declaration
(False
).'''
)
70 def get_bases_array
(self
):
71 '''An accessor function that returns a list
() that contains all direct base classes in a lldb.SBType object.'''
73 for idx in range
(self.GetNumberOfDirectBaseClasses
()):
74 bases.append
(self.GetDirectBaseClassAtIndex
(idx
))
77 def get_vbases_array
(self
):
78 '''An accessor function that returns a list
() that contains all fields in a lldb.SBType object.'''
80 for idx in range
(self.GetNumberOfVirtualBaseClasses
()):
81 vbases.append
(self.GetVirtualBaseClassAtIndex
(idx
))
84 def get_fields_array
(self
):
85 '''An accessor function that returns a list
() that contains all fields in a lldb.SBType object.'''
87 for idx in range
(self.GetNumberOfFields
()):
88 fields.append
(self.GetFieldAtIndex
(idx
))
91 def get_members_array
(self
):
92 '''An accessor function that returns a list
() that contains all members
(base classes and fields
) in a lldb.SBType object in ascending bit offset order.'''
94 bases
= self.get_bases_array
()
95 fields
= self.get_fields_array
()
96 vbases
= self.get_vbases_array
()
98 bit_offset
= base.bit_offset
100 for idx
, member in enumerate
(members
):
101 if member.bit_offset
> bit_offset
:
102 members.insert
(idx
, base
)
108 bit_offset
= vbase.bit_offset
110 for idx
, member in enumerate
(members
):
111 if member.bit_offset
> bit_offset
:
112 members.insert
(idx
, vbase
)
116 members.append
(vbase
)
118 bit_offset
= field.bit_offset
120 for idx
, member in enumerate
(members
):
121 if member.bit_offset
> bit_offset
:
122 members.insert
(idx
, field
)
126 members.append
(field
)
129 def get_enum_members_array
(self
):
130 '''An accessor function that returns a list
() that contains all enum members in an lldb.SBType object.'''
131 enum_members_list
= []
132 sb_enum_members
= self.GetEnumMembers
()
133 for idx in range
(sb_enum_members.GetSize
()):
134 enum_members_list.append
(sb_enum_members.GetTypeEnumMemberAtIndex
(idx
))
135 return enum_members_list
137 bases
= property
(get_bases_array
, None
, doc
='''A read only property that returns a list
() of lldb.SBTypeMember objects that represent all of the direct base classes for this type.'''
)
138 vbases
= property
(get_vbases_array
, None
, doc
='''A read only property that returns a list
() of lldb.SBTypeMember objects that represent all of the virtual base classes for this type.'''
)
139 fields
= property
(get_fields_array
, None
, doc
='''A read only property that returns a list
() of lldb.SBTypeMember objects that represent all of the fields for this type.'''
)
140 members
= property
(get_members_array
, None
, doc
='''A read only property that returns a list
() of all lldb.SBTypeMember objects that represent all of the base classes
, virtual base classes and fields for this type in ascending bit offset order.'''
)
141 enum_members
= property
(get_enum_members_array
, None
, doc
='''A read only property that returns a list
() of all lldb.SBTypeEnumMember objects that represent the enum members for this type.'''
)
146 %extend lldb
::SBTypeList
{
149 # operator
== is a free function
, which swig does not handle
, so we inject
150 # our own equality operator here
151 def __eq__
(self
, other
):
152 return not self.__ne__
(other
)
155 '''Iterate over all types in a lldb.SBTypeList object.'''
156 return lldb_iter
(self
, 'GetSize'
, 'GetTypeAtIndex'
)
159 '''Return the number of types in a lldb.SBTypeList object.'''
160 return self.GetSize
()