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.section_iter():
    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

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

Deprecated.

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 Summary

FindSubSection(SBSection self, ...)

GetAlignment()

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)

GetPermissions()

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)

Deprecated.

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

Deprecated. Always returns 1.

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

FindSubSection(SBSection self, char const * sect_name) SBSection
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
GetParent(SBSection self) SBSection
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
GetSubSectionAtIndex(SBSection self, size_t idx) SBSection
GetTargetByteSize(SBSection self) uint32_t

Deprecated. Always returns 1.

IsValid(SBSection self) bool
get_addr()