1 //===-- SWIG Interface for SBSection ----------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 "Represents an executable image section.
14 SBSection supports iteration through its subsection, represented as SBSection
15 as well. For example, ::
17 for sec in exe_module:
18 if sec.GetName() == '__TEXT':
21 print INDENT + 'Number of subsections: %d' % sec.GetNumSubSections()
23 print INDENT + repr(subsec)
27 [0x0000000100000000-0x0000000100002000) a.out.__TEXT
28 Number of subsections: 6
29 [0x0000000100001780-0x0000000100001d5c) a.out.__TEXT.__text
30 [0x0000000100001d5c-0x0000000100001da4) a.out.__TEXT.__stubs
31 [0x0000000100001da4-0x0000000100001e2c) a.out.__TEXT.__stub_helper
32 [0x0000000100001e2c-0x0000000100001f10) a.out.__TEXT.__cstring
33 [0x0000000100001f10-0x0000000100001f68) a.out.__TEXT.__unwind_info
34 [0x0000000100001f68-0x0000000100001ff8) a.out.__TEXT.__eh_frame
36 See also :py:class:`SBModule` ."
45 SBSection (const lldb::SBSection &rhs);
52 explicit operator bool() const;
61 FindSubSection (const char *sect_name);
67 GetSubSectionAtIndex (size_t idx);
73 GetLoadAddress (lldb::SBTarget &target);
88 GetSectionData (uint64_t offset,
95 GetPermissions() const;
97 %feature("docstring", "
98 Return the size of a target's byte represented by this section
99 in numbers of host bytes. Note that certain architectures have
100 varying minimum addressable unit (i.e. byte) size for their
104 The number of host (8-bit) bytes needed to hold a target byte") GetTargetByteSize;
106 GetTargetByteSize ();
112 GetDescription (lldb::SBStream &description);
115 operator == (const lldb::SBSection &rhs);
118 operator != (const lldb::SBSection &rhs);
120 STRING_EXTENSION(SBSection)
125 '''Iterate over all subsections in a lldb.SBSection object.'''
126 return lldb_iter(self, 'GetNumSubSections', 'GetSubSectionAtIndex')
129 '''Return the number of subsections in a lldb.SBSection object.'''
130 return self.GetNumSubSections()
133 return SBAddress(self, 0)
135 name = property(GetName, None, doc='''A read only property that returns the name of this section as a string.''')
136 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.''')
137 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.''')
138 size = property(GetByteSize, None, doc='''A read only property that returns the size in bytes of this section as an integer.''')
139 file_offset = property(GetFileOffset, None, doc='''A read only property that returns the file offset in bytes of this section as an integer.''')
140 file_size = property(GetFileByteSize, None, doc='''A read only property that returns the file size in bytes of this section as an integer.''')
141 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.''')
142 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.).''')
143 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.''')
144 alignment = property(GetAlignment, None, doc='''A read only property that returns the alignment of this section as a number of host bytes.''')
150 std::unique_ptr<lldb_private::SectionImpl> m_opaque_ap;