LLDB  mainline
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
lldb_private::Section Class Reference

#include <Section.h>

Inheritance diagram for lldb_private::Section:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::Section:
Collaboration graph
[legend]

Public Member Functions

 Section (const lldb::ModuleSP &module_sp, ObjectFile *obj_file, lldb::user_id_t sect_id, ConstString name, lldb::SectionType sect_type, lldb::addr_t file_vm_addr, lldb::addr_t vm_size, lldb::offset_t file_offset, lldb::offset_t file_size, uint32_t log2align, uint32_t flags, uint32_t target_byte_size=1)
 
 Section (const lldb::SectionSP &parent_section_sp, const lldb::ModuleSP &module_sp, ObjectFile *obj_file, lldb::user_id_t sect_id, ConstString name, lldb::SectionType sect_type, lldb::addr_t file_vm_addr, lldb::addr_t vm_size, lldb::offset_t file_offset, lldb::offset_t file_size, uint32_t log2align, uint32_t flags, uint32_t target_byte_size=1)
 
 ~Section ()
 
bool ContainsFileAddress (lldb::addr_t vm_addr) const
 
SectionListGetChildren ()
 
const SectionListGetChildren () const
 
void Dump (Stream *s, Target *target, uint32_t depth) const
 
void DumpName (Stream *s) const
 
lldb::addr_t GetLoadBaseAddress (Target *target) const
 
bool ResolveContainedAddress (lldb::addr_t offset, Address &so_addr, bool allow_section_end=false) const
 
lldb::offset_t GetFileOffset () const
 
void SetFileOffset (lldb::offset_t file_offset)
 
lldb::offset_t GetFileSize () const
 
void SetFileSize (lldb::offset_t file_size)
 
lldb::addr_t GetFileAddress () const
 
bool SetFileAddress (lldb::addr_t file_addr)
 
lldb::addr_t GetOffset () const
 
lldb::addr_t GetByteSize () const
 
void SetByteSize (lldb::addr_t byte_size)
 
bool IsFake () const
 
void SetIsFake (bool fake)
 
bool IsEncrypted () const
 
void SetIsEncrypted (bool b)
 
bool IsDescendant (const Section *section)
 
ConstString GetName () const
 
bool Slide (lldb::addr_t slide_amount, bool slide_children)
 
lldb::SectionType GetType () const
 
const char * GetTypeAsCString () const
 
lldb::SectionSP GetParent () const
 
bool IsThreadSpecific () const
 
void SetIsThreadSpecific (bool b)
 
uint32_t GetPermissions () const
 Get the permissions as OR'ed bits from lldb::Permissions. More...
 
void SetPermissions (uint32_t permissions)
 Set the permissions using bits OR'ed from lldb::Permissions. More...
 
ObjectFileGetObjectFile ()
 
const ObjectFileGetObjectFile () const
 
lldb::offset_t GetSectionData (void *dst, lldb::offset_t dst_len, lldb::offset_t offset=0)
 Read the section data from the object file that the section resides in. More...
 
lldb::offset_t GetSectionData (DataExtractor &data)
 Get the shared reference to the section data from the object file that the section resides in. More...
 
uint32_t GetLog2Align ()
 
void SetLog2Align (uint32_t align)
 
uint32_t GetTargetByteSize () const
 
bool IsRelocated () const
 
void SetIsRelocated (bool b)
 
- Public Member Functions inherited from lldb_private::ModuleChild
 ModuleChild (const lldb::ModuleSP &module_sp)
 Construct with owning module. More...
 
 ModuleChild (const ModuleChild &rhs)
 Copy constructor. More...
 
 ~ModuleChild ()
 Destructor. More...
 
const ModuleChildoperator= (const ModuleChild &rhs)
 Assignment operator. More...
 
lldb::ModuleSP GetModule () const
 Get const accessor for the module pointer. More...
 
void SetModule (const lldb::ModuleSP &module_sp)
 Set accessor for the module pointer. More...
 
- Public Member Functions inherited from lldb_private::UserID
 UserID (lldb::user_id_t uid=LLDB_INVALID_UID)
 Construct with optional user ID. More...
 
 ~UserID ()
 Destructor. More...
 
void Clear ()
 Clears the object state. More...
 
lldb::user_id_t GetID () const
 Get accessor for the user ID. More...
 
void SetID (lldb::user_id_t uid)
 Set accessor for the user ID. More...
 
- Public Member Functions inherited from lldb_private::Flags
 Flags (ValueType flags=0)
 Construct with initial flag bit values. More...
 
 Flags (const Flags &rhs)
 Copy constructor. More...
 
 ~Flags ()
 Destructor. More...
 
ValueType Get () const
 Get accessor for all flags. More...
 
size_t GetBitSize () const
 Return the number of flags that can be represented in this object. More...
 
void Reset (ValueType flags)
 Set accessor for all flags. More...
 
ValueType Clear (ValueType mask=~(ValueType) 0)
 Clear one or more flags. More...
 
ValueType Set (ValueType mask)
 Set one or more flags by logical OR'ing mask with the current flags. More...
 
bool AllSet (ValueType mask) const
 Test if all bits in mask are 1 in the current flags. More...
 
bool AnySet (ValueType mask) const
 Test one or more flags. More...
 
bool Test (ValueType bit) const
 Test a single flag bit. More...
 
bool AllClear (ValueType mask) const
 Test if all bits in mask are clear. More...
 
bool AnyClear (ValueType mask) const
 
bool IsClear (ValueType bit) const
 Test a single flag bit to see if it is clear (zero). More...
 
size_t ClearCount () const
 Get the number of zero bits in m_flags. More...
 
size_t SetCount () const
 Get the number of one bits in m_flags. More...
 

Static Public Member Functions

static int Compare (const Section &a, const Section &b)
 

Protected Attributes

ObjectFilem_obj_file
 
lldb::SectionType m_type
 
lldb::SectionWP m_parent_wp
 
ConstString m_name
 
lldb::addr_t m_file_addr
 
lldb::addr_t m_byte_size
 
lldb::offset_t m_file_offset
 
lldb::offset_t m_file_size
 
uint32_t m_log2align
 
SectionList m_children
 
bool m_fake: 1
 
bool m_encrypted: 1
 
bool m_thread_specific: 1
 
bool m_readable: 1
 
bool m_writable: 1
 
bool m_executable: 1
 
bool m_relocated: 1
 
uint32_t m_target_byte_size
 
- Protected Attributes inherited from lldb_private::ModuleChild
lldb::ModuleWP m_module_wp
 The Module that owns the object that inherits from this class. More...
 
- Protected Attributes inherited from lldb_private::UserID
lldb::user_id_t m_uid
 The user ID that uniquely identifies an object. More...
 
- Protected Attributes inherited from lldb_private::Flags
ValueType m_flags
 The flags. More...
 

Additional Inherited Members

- Public Types inherited from lldb_private::Flags
typedef uint32_t ValueType
 The value type for flags is a 32 bit unsigned integer type. More...
 

Detailed Description

Definition at line 105 of file Section.h.

Constructor & Destructor Documentation

◆ Section() [1/2]

lldb_private::Section::Section ( const lldb::ModuleSP &  module_sp,
ObjectFile obj_file,
lldb::user_id_t  sect_id,
ConstString  name,
lldb::SectionType  sect_type,
lldb::addr_t  file_vm_addr,
lldb::addr_t  vm_size,
lldb::offset_t  file_offset,
lldb::offset_t  file_size,
uint32_t  log2align,
uint32_t  flags,
uint32_t  target_byte_size = 1 
)

Referenced by GetTypeAsCString().

◆ Section() [2/2]

lldb_private::Section::Section ( const lldb::SectionSP &  parent_section_sp,
const lldb::ModuleSP &  module_sp,
ObjectFile obj_file,
lldb::user_id_t  sect_id,
ConstString  name,
lldb::SectionType  sect_type,
lldb::addr_t  file_vm_addr,
lldb::addr_t  vm_size,
lldb::offset_t  file_offset,
lldb::offset_t  file_size,
uint32_t  log2align,
uint32_t  flags,
uint32_t  target_byte_size = 1 
)

◆ ~Section()

Section::~Section ( )

Definition at line 190 of file Section.cpp.

Member Function Documentation

◆ Compare()

int Section::Compare ( const Section a,
const Section b 
)
static

◆ ContainsFileAddress()

bool Section::ContainsFileAddress ( lldb::addr_t  vm_addr) const

◆ Dump()

void Section::Dump ( Stream s,
Target target,
uint32_t  depth 
) const

◆ DumpName()

void Section::DumpName ( Stream s) const

◆ GetByteSize()

lldb::addr_t lldb_private::Section::GetByteSize ( ) const
inline

◆ GetChildren() [1/2]

SectionList& lldb_private::Section::GetChildren ( )
inline

◆ GetChildren() [2/2]

const SectionList& lldb_private::Section::GetChildren ( ) const
inline

Definition at line 137 of file Section.h.

References lldb_private::SectionList::Dump().

◆ GetFileAddress()

addr_t Section::GetFileAddress ( ) const

◆ GetFileOffset()

lldb::offset_t lldb_private::Section::GetFileOffset ( ) const
inline

◆ GetFileSize()

lldb::offset_t lldb_private::Section::GetFileSize ( ) const
inline

◆ GetLoadBaseAddress()

addr_t Section::GetLoadBaseAddress ( Target target) const

◆ GetLog2Align()

uint32_t lldb_private::Section::GetLog2Align ( )
inline

Definition at line 236 of file Section.h.

◆ GetName()

ConstString lldb_private::Section::GetName ( ) const
inline

◆ GetObjectFile() [1/2]

ObjectFile* lldb_private::Section::GetObjectFile ( )
inline

◆ GetObjectFile() [2/2]

const ObjectFile* lldb_private::Section::GetObjectFile ( ) const
inline

Definition at line 199 of file Section.h.

◆ GetOffset()

lldb::addr_t Section::GetOffset ( ) const

Definition at line 219 of file Section.cpp.

Referenced by ResolveContainedAddress().

◆ GetParent()

lldb::SectionSP lldb_private::Section::GetParent ( ) const
inline

Definition at line 186 of file Section.h.

◆ GetPermissions()

uint32_t Section::GetPermissions ( ) const

Get the permissions as OR'ed bits from lldb::Permissions.

Definition at line 385 of file Section.cpp.

Referenced by ProcessMachCore::DoLoadCore().

◆ GetSectionData() [1/2]

lldb::offset_t Section::GetSectionData ( void *  dst,
lldb::offset_t  dst_len,
lldb::offset_t  offset = 0 
)

Read the section data from the object file that the section resides in.

Parameters
[in]dstWhere to place the data
[in]dst_lenHow many bytes of section data to read
[in]offsetThe offset in bytes within this section's data at which to start copying data from.
Returns
The number of bytes read from the section, or zero if the section has no data or offset is not a valid offset in this section.

Definition at line 403 of file Section.cpp.

◆ GetSectionData() [2/2]

lldb::offset_t Section::GetSectionData ( DataExtractor data)

Get the shared reference to the section data from the object file that the section resides in.

No copies of the data will be make unless the object file has been read from memory. If the object file is on disk, it will shared the mmap data for the entire object file.

Parameters
[in]dataWhere to place the data, address byte size, and byte order
Returns
The number of bytes read from the section, or zero if the section has no data or offset is not a valid offset in this section.

Definition at line 410 of file Section.cpp.

◆ GetTargetByteSize()

uint32_t lldb_private::Section::GetTargetByteSize ( ) const
inline

Definition at line 241 of file Section.h.

Referenced by lldb_private::ObjectFile::ReadSectionData().

◆ GetType()

lldb::SectionType lldb_private::Section::GetType ( ) const
inline

Definition at line 182 of file Section.h.

Referenced by lldb_private::ObjectFile::ReadSectionData().

◆ GetTypeAsCString()

const char * Section::GetTypeAsCString ( ) const

Definition at line 29 of file Section.cpp.

References lldb::eSectionTypeAbsoluteAddress, lldb::eSectionTypeARMexidx, lldb::eSectionTypeARMextab, lldb::eSectionTypeCode, lldb::eSectionTypeCompactUnwind, lldb::eSectionTypeContainer, lldb::eSectionTypeData, lldb::eSectionTypeData16, lldb::eSectionTypeData4, lldb::eSectionTypeData8, lldb::eSectionTypeDataCString, lldb::eSectionTypeDataCStringPointers, lldb::eSectionTypeDataObjCCFStrings, lldb::eSectionTypeDataObjCMessageRefs, lldb::eSectionTypeDataPointers, lldb::eSectionTypeDataSymbolAddress, lldb::eSectionTypeDebug, lldb::eSectionTypeDWARFAppleNames, lldb::eSectionTypeDWARFAppleNamespaces, lldb::eSectionTypeDWARFAppleObjC, lldb::eSectionTypeDWARFAppleTypes, lldb::eSectionTypeDWARFDebugAbbrev, lldb::eSectionTypeDWARFDebugAbbrevDwo, lldb::eSectionTypeDWARFDebugAddr, lldb::eSectionTypeDWARFDebugAranges, lldb::eSectionTypeDWARFDebugCuIndex, lldb::eSectionTypeDWARFDebugFrame, lldb::eSectionTypeDWARFDebugInfo, lldb::eSectionTypeDWARFDebugInfoDwo, lldb::eSectionTypeDWARFDebugLine, lldb::eSectionTypeDWARFDebugLineStr, lldb::eSectionTypeDWARFDebugLoc, lldb::eSectionTypeDWARFDebugLocLists, lldb::eSectionTypeDWARFDebugMacInfo, lldb::eSectionTypeDWARFDebugMacro, lldb::eSectionTypeDWARFDebugNames, lldb::eSectionTypeDWARFDebugPubNames, lldb::eSectionTypeDWARFDebugPubTypes, lldb::eSectionTypeDWARFDebugRanges, lldb::eSectionTypeDWARFDebugRngLists, lldb::eSectionTypeDWARFDebugStr, lldb::eSectionTypeDWARFDebugStrDwo, lldb::eSectionTypeDWARFDebugStrOffsets, lldb::eSectionTypeDWARFDebugStrOffsetsDwo, lldb::eSectionTypeDWARFDebugTypes, lldb::eSectionTypeDWARFGNUDebugAltLink, lldb::eSectionTypeEHFrame, lldb::eSectionTypeELFDynamicLinkInfo, lldb::eSectionTypeELFDynamicSymbols, lldb::eSectionTypeELFRelocationEntries, lldb::eSectionTypeELFSymbolTable, lldb::eSectionTypeGoSymtab, lldb::eSectionTypeInvalid, lldb::eSectionTypeOther, lldb::eSectionTypeZeroFill, and Section().

◆ IsDescendant()

bool Section::IsDescendant ( const Section section)

Definition at line 360 of file Section.cpp.

◆ IsEncrypted()

bool lldb_private::Section::IsEncrypted ( ) const
inline

Definition at line 172 of file Section.h.

◆ IsFake()

bool lldb_private::Section::IsFake ( ) const
inline

◆ IsRelocated()

bool lldb_private::Section::IsRelocated ( ) const
inline

Definition at line 243 of file Section.h.

Referenced by lldb_private::ObjectFile::ReadSectionData().

◆ IsThreadSpecific()

bool lldb_private::Section::IsThreadSpecific ( ) const
inline

Definition at line 188 of file Section.h.

Referenced by ObjectFileMachO::SectionIsLoadable().

◆ ResolveContainedAddress()

bool Section::ResolveContainedAddress ( lldb::addr_t  offset,
Address so_addr,
bool  allow_section_end = false 
) const

◆ SetByteSize()

void lldb_private::Section::SetByteSize ( lldb::addr_t  byte_size)
inline

Definition at line 166 of file Section.h.

Referenced by ObjectFileMachO::ProcessSegmentCommand().

◆ SetFileAddress()

bool Section::SetFileAddress ( lldb::addr_t  file_addr)

Definition at line 206 of file Section.cpp.

◆ SetFileOffset()

void lldb_private::Section::SetFileOffset ( lldb::offset_t  file_offset)
inline

Definition at line 150 of file Section.h.

Referenced by ObjectFileMachO::ProcessSegmentCommand().

◆ SetFileSize()

void lldb_private::Section::SetFileSize ( lldb::offset_t  file_size)
inline

Definition at line 156 of file Section.h.

Referenced by ObjectFileMachO::ProcessSegmentCommand().

◆ SetIsEncrypted()

void lldb_private::Section::SetIsEncrypted ( bool  b)
inline

Definition at line 174 of file Section.h.

◆ SetIsFake()

void lldb_private::Section::SetIsFake ( bool  fake)
inline

Definition at line 170 of file Section.h.

◆ SetIsRelocated()

void lldb_private::Section::SetIsRelocated ( bool  b)
inline

Definition at line 245 of file Section.h.

Referenced by ObjectFileELF::RelocateSection().

◆ SetIsThreadSpecific()

void lldb_private::Section::SetIsThreadSpecific ( bool  b)
inline

Definition at line 190 of file Section.h.

References GetPermissions().

◆ SetLog2Align()

void lldb_private::Section::SetLog2Align ( uint32_t  align)
inline

Definition at line 238 of file Section.h.

◆ SetPermissions()

void Section::SetPermissions ( uint32_t  permissions)

Set the permissions using bits OR'ed from lldb::Permissions.

Definition at line 397 of file Section.cpp.

◆ Slide()

bool Section::Slide ( lldb::addr_t  slide_amount,
bool  slide_children 
)

Definition at line 369 of file Section.cpp.

References LLDB_INVALID_ADDRESS.

Referenced by ObjectFileMachO::ProcessSegmentCommand().

Member Data Documentation

◆ m_byte_size

lldb::addr_t lldb_private::Section::m_byte_size
protected

Definition at line 256 of file Section.h.

◆ m_children

SectionList lldb_private::Section::m_children
protected

Definition at line 263 of file Section.h.

◆ m_encrypted

bool lldb_private::Section::m_encrypted
protected

Definition at line 264 of file Section.h.

◆ m_executable

bool lldb_private::Section::m_executable
protected

Definition at line 264 of file Section.h.

◆ m_fake

bool lldb_private::Section::m_fake
protected

Definition at line 264 of file Section.h.

◆ m_file_addr

lldb::addr_t lldb_private::Section::m_file_addr
protected

Definition at line 253 of file Section.h.

◆ m_file_offset

lldb::offset_t lldb_private::Section::m_file_offset
protected

Definition at line 258 of file Section.h.

◆ m_file_size

lldb::offset_t lldb_private::Section::m_file_size
protected

Definition at line 259 of file Section.h.

◆ m_log2align

uint32_t lldb_private::Section::m_log2align
protected

Definition at line 261 of file Section.h.

◆ m_name

ConstString lldb_private::Section::m_name
protected

Definition at line 252 of file Section.h.

◆ m_obj_file

ObjectFile* lldb_private::Section::m_obj_file
protected

Definition at line 248 of file Section.h.

◆ m_parent_wp

lldb::SectionWP lldb_private::Section::m_parent_wp
protected

Definition at line 251 of file Section.h.

◆ m_readable

bool lldb_private::Section::m_readable
protected

Definition at line 264 of file Section.h.

◆ m_relocated

bool lldb_private::Section::m_relocated
protected

Definition at line 264 of file Section.h.

◆ m_target_byte_size

uint32_t lldb_private::Section::m_target_byte_size
protected

Definition at line 275 of file Section.h.

◆ m_thread_specific

bool lldb_private::Section::m_thread_specific
protected

Definition at line 264 of file Section.h.

◆ m_type

lldb::SectionType lldb_private::Section::m_type
protected

Definition at line 250 of file Section.h.

◆ m_writable

bool lldb_private::Section::m_writable
protected

Definition at line 264 of file Section.h.


The documentation for this class was generated from the following files: