Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:42

0001 //===-- SBSection.h ---------------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_API_SBSECTION_H
0010 #define LLDB_API_SBSECTION_H
0011 
0012 #include "lldb/API/SBData.h"
0013 #include "lldb/API/SBDefines.h"
0014 
0015 namespace lldb {
0016 
0017 class LLDB_API SBSection {
0018 public:
0019   SBSection();
0020 
0021   SBSection(const lldb::SBSection &rhs);
0022 
0023   ~SBSection();
0024 
0025   const lldb::SBSection &operator=(const lldb::SBSection &rhs);
0026 
0027   explicit operator bool() const;
0028 
0029   bool IsValid() const;
0030 
0031   const char *GetName();
0032 
0033   lldb::SBSection GetParent();
0034 
0035   lldb::SBSection FindSubSection(const char *sect_name);
0036 
0037   size_t GetNumSubSections();
0038 
0039   lldb::SBSection GetSubSectionAtIndex(size_t idx);
0040 
0041   lldb::addr_t GetFileAddress();
0042 
0043   lldb::addr_t GetLoadAddress(lldb::SBTarget &target);
0044 
0045   lldb::addr_t GetByteSize();
0046 
0047   uint64_t GetFileOffset();
0048 
0049   uint64_t GetFileByteSize();
0050 
0051   lldb::SBData GetSectionData();
0052 
0053   lldb::SBData GetSectionData(uint64_t offset, uint64_t size);
0054 
0055   SectionType GetSectionType();
0056 
0057   /// Gets the permissions (RWX) of the section of the object file
0058   ///
0059   /// Returns a mask of bits of enum lldb::Permissions for this section.
0060   /// Sections for which permissions are not defined, 0 is returned for
0061   /// them. The binary representation of this value corresponds to [XRW]
0062   /// i.e. for a section having read and execute permissions, the value
0063   /// returned is 6
0064   ///
0065   /// \return
0066   ///     Returns an unsigned value for Permissions for the section.
0067   uint32_t
0068   GetPermissions() const;
0069 
0070   /// Return the size of a target's byte represented by this section
0071   /// in numbers of host bytes. Note that certain architectures have
0072   /// varying minimum addressable unit (i.e. byte) size for their
0073   /// CODE or DATA buses.
0074   ///
0075   /// \return
0076   ///     The number of host (8-bit) bytes needed to hold a target byte
0077   uint32_t GetTargetByteSize();
0078 
0079   /// Return the alignment of the section in bytes
0080   ///
0081   /// \return
0082   ///     The alignment of the section in bytes
0083   uint32_t GetAlignment();
0084 
0085   bool operator==(const lldb::SBSection &rhs);
0086 
0087   bool operator!=(const lldb::SBSection &rhs);
0088 
0089   bool GetDescription(lldb::SBStream &description);
0090 
0091 private:
0092   friend class SBAddress;
0093   friend class SBModule;
0094   friend class SBTarget;
0095 
0096   SBSection(const lldb::SectionSP &section_sp);
0097 
0098   lldb::SectionSP GetSP() const;
0099 
0100   void SetSP(const lldb::SectionSP &section_sp);
0101 
0102   lldb::SectionWP m_opaque_wp;
0103 };
0104 
0105 } // namespace lldb
0106 
0107 #endif // LLDB_API_SBSECTION_H