1 //===-- SBSection.h ---------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLDB_SBSection_h_
11 #define LLDB_SBSection_h_
13 #include "lldb/API/SBData.h"
14 #include "lldb/API/SBDefines.h"
18 class LLDB_API SBSection {
22 SBSection(const lldb::SBSection &rhs);
26 const lldb::SBSection &operator=(const lldb::SBSection &rhs);
30 const char *GetName();
32 lldb::SBSection GetParent();
34 lldb::SBSection FindSubSection(const char *sect_name);
36 size_t GetNumSubSections();
38 lldb::SBSection GetSubSectionAtIndex(size_t idx);
40 lldb::addr_t GetFileAddress();
42 lldb::addr_t GetLoadAddress(lldb::SBTarget &target);
44 lldb::addr_t GetByteSize();
46 uint64_t GetFileOffset();
48 uint64_t GetFileByteSize();
50 lldb::SBData GetSectionData();
52 lldb::SBData GetSectionData(uint64_t offset, uint64_t size);
54 SectionType GetSectionType();
56 //------------------------------------------------------------------
57 /// Gets the permissions (RWX) of the section of the object file
59 /// Returns a mask of bits of enum lldb::Permissions for this section.
60 /// Sections for which permissions are not defined, 0 is returned for
61 /// them. The binary representation of this value corresponds to [XRW]
62 /// i.e. for a section having read and execute permissions, the value
66 /// Returns an unsigned value for Permissions for the section.
67 //------------------------------------------------------------------
69 GetPermissions() const;
71 //------------------------------------------------------------------
72 /// Return the size of a target's byte represented by this section
73 /// in numbers of host bytes. Note that certain architectures have
74 /// varying minimum addressable unit (i.e. byte) size for their
75 /// CODE or DATA buses.
78 /// The number of host (8-bit) bytes needed to hold a target byte
79 //------------------------------------------------------------------
80 uint32_t GetTargetByteSize();
82 bool operator==(const lldb::SBSection &rhs);
84 bool operator!=(const lldb::SBSection &rhs);
86 bool GetDescription(lldb::SBStream &description);
89 friend class SBAddress;
90 friend class SBModule;
91 friend class SBTarget;
93 SBSection(const lldb::SectionSP §ion_sp);
95 lldb::SectionSP GetSP() const;
97 void SetSP(const lldb::SectionSP §ion_sp);
99 lldb::SectionWP m_opaque_wp;
104 #endif // LLDB_SBSection_h_