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

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 Summary

FindSubSection(SBSection self, ...)

GetAlignment(SBSection self)

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(SBSection self)

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

FindSubSection(SBSection self, char const * sect_name) SBSection#
GetAlignment(SBSection self) uint32_t#
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(SBSection self) uint32_t#
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#

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()#