xref: /freebsd/contrib/llvm-project/lldb/bindings/interface/SBSectionExtensions.i (revision 02e9120893770924227138ba49df1edb3896112a)
1 STRING_EXTENSION_OUTSIDE(SBSection)
2 
3 %extend lldb::SBSection {
4 #ifdef SWIGPYTHON
5     %pythoncode %{
6         def __iter__(self):
7             '''Iterate over all subsections in a lldb.SBSection object.'''
8             return lldb_iter(self, 'GetNumSubSections', 'GetSubSectionAtIndex')
9 
10         def __len__(self):
11             '''Return the number of subsections in a lldb.SBSection object.'''
12             return self.GetNumSubSections()
13 
14         def get_addr(self):
15             return SBAddress(self, 0)
16 
17         name = property(GetName, None, doc='''A read only property that returns the name of this section as a string.''')
18         addr = property(get_addr, None, doc='''A read only property that returns an lldb object that represents the start address (lldb.SBAddress) for this section.''')
19         file_addr = property(GetFileAddress, None, doc='''A read only property that returns an integer that represents the starting "file" address for this section, or the address of the section in the object file in which it is defined.''')
20         size = property(GetByteSize, None, doc='''A read only property that returns the size in bytes of this section as an integer.''')
21         file_offset = property(GetFileOffset, None, doc='''A read only property that returns the file offset in bytes of this section as an integer.''')
22         file_size = property(GetFileByteSize, None, doc='''A read only property that returns the file size in bytes of this section as an integer.''')
23         data = property(GetSectionData, None, doc='''A read only property that returns an lldb object that represents the bytes for this section (lldb.SBData) for this section.''')
24         type = property(GetSectionType, None, doc='''A read only property that returns an lldb enumeration value (see enumerations that start with "lldb.eSectionType") that represents the type of this section (code, data, etc.).''')
25         target_byte_size = property(GetTargetByteSize, None, doc='''A read only property that returns the size of a target byte represented by this section as a number of host bytes.''')
26         alignment = property(GetAlignment, None, doc='''A read only property that returns the alignment of this section as a number of host bytes.''')
27     %}
28 #endif
29 }
30