SBSection#
- class lldb.SBSection(*args)#
Represents an executable image section.
SBSection supports iteration through its subsection, represented as SBSection as well. For example,
for sec in exe_module: if sec.GetName() == '__TEXT': print sec break print INDENT + 'Number of subsections: %d' % sec.GetNumSubSections() for subsec in sec: print INDENT + repr(subsec)
produces:
[0x0000000100000000-0x0000000100002000) a.out.__TEXT Number of subsections: 6 [0x0000000100001780-0x0000000100001d5c) a.out.__TEXT.__text [0x0000000100001d5c-0x0000000100001da4) a.out.__TEXT.__stubs [0x0000000100001da4-0x0000000100001e2c) a.out.__TEXT.__stub_helper [0x0000000100001e2c-0x0000000100001f10) a.out.__TEXT.__cstring [0x0000000100001f10-0x0000000100001f68) a.out.__TEXT.__unwind_info [0x0000000100001f68-0x0000000100001ff8) a.out.__TEXT.__eh_frame
See also
SBModule
.Attributes Summary
A read only property that returns an lldb object that represents the start address (lldb.SBAddress) for this section.
A read only property that returns the alignment of this section as a number of host bytes.
A read only property that returns an lldb object that represents the bytes for this section (lldb.SBData) for this section.
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.
A read only property that returns the file offset in bytes of this section as an integer.
A read only property that returns the file size in bytes of this section as an integer.
A read only property that returns the name of this section as a string.
A read only property that returns the size in bytes of this section as an integer.
A read only property that returns the size of a target byte represented by this section as a number of host bytes.
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.).
Methods Summary
FindSubSection
(SBSection self, ...)Return the alignment of the section in bytes
GetByteSize
(SBSection self)GetDescription
(SBSection self, ...)GetFileAddress
(SBSection self)GetFileByteSize
(SBSection self)GetFileOffset
(SBSection self)GetLoadAddress
(SBSection self, SBTarget target)GetName
(SBSection self)GetNumSubSections
(SBSection self)GetParent
(SBSection self)Gets the permissions (RWX) of the section of the object file
GetSectionData
(-> SBData)GetSectionType
(SBSection self)GetSubSectionAtIndex
(SBSection self, size_t idx)GetTargetByteSize
(SBSection self)Return the size of a target's byte represented by this section in numbers of host bytes.
IsValid
(SBSection self)get_addr
()Attributes Documentation
- addr#
A read only property that returns an lldb object that represents the start address (lldb.SBAddress) for this section.
- alignment#
A read only property that returns the alignment of this section as a number of host bytes.
- data#
A read only property that returns an lldb object that represents the bytes for this section (lldb.SBData) for this section.
- file_addr#
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.
- file_offset#
A read only property that returns the file offset in bytes of this section as an integer.
- file_size#
A read only property that returns the file size in bytes of this section as an integer.
- name#
A read only property that returns the name of this section as a string.
- size#
A read only property that returns the size in bytes of this section as an integer.
- target_byte_size#
A read only property that returns the size of a target byte represented by this section as a number of host bytes.
- type#
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.).
Methods Documentation
- GetAlignment()#
Return the alignment of the section in bytes
- Return type:
int
- Returns:
The alignment of the section in bytes
- GetByteSize(SBSection self) lldb::addr_t #
- GetDescription(SBSection self, SBStream description) bool #
- GetFileAddress(SBSection self) lldb::addr_t #
- GetFileByteSize(SBSection self) uint64_t #
- GetFileOffset(SBSection self) uint64_t #
- GetLoadAddress(SBSection self, SBTarget target) lldb::addr_t #
- GetName(SBSection self) char const * #
- GetNumSubSections(SBSection self) size_t #
- GetPermissions()#
Gets the permissions (RWX) of the section of the object file
Returns a mask of bits of enum lldb::Permissions for this section. Sections for which permissions are not defined, 0 is returned for them. The binary representation of this value corresponds to [XRW] i.e. for a section having read and execute permissions, the value returned is 6
- Return type:
int
- Returns:
Returns an unsigned value for Permissions for the section.
- GetSectionData(SBSection self) SBData #
- GetSectionData(SBSection self, uint64_t offset, uint64_t size) SBData
- GetSectionType(SBSection self) lldb::SectionType #
- GetTargetByteSize(SBSection self) uint32_t #
Return the size of a target’s byte represented by this section in numbers of host bytes. Note that certain architectures have varying minimum addressable unit (i.e. byte) size for their CODE or DATA buses.
- @return
The number of host (8-bit) bytes needed to hold a target byte
- IsValid(SBSection self) bool #
- get_addr()#