LLDB mainline
SBSection.h
Go to the documentation of this file.
1//===-- SBSection.h ---------------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_API_SBSECTION_H
10#define LLDB_API_SBSECTION_H
11
12#include "lldb/API/SBData.h"
13#include "lldb/API/SBDefines.h"
14
15namespace lldb {
16
18public:
19 SBSection();
20
21 SBSection(const lldb::SBSection &rhs);
22
24
25 const lldb::SBSection &operator=(const lldb::SBSection &rhs);
26
27 explicit operator bool() const;
28
29 bool IsValid() const;
30
31 const char *GetName();
32
34
35 lldb::SBSection FindSubSection(const char *sect_name);
36
37 size_t GetNumSubSections();
38
40
42
44
46
47 uint64_t GetFileOffset();
48
49 uint64_t GetFileByteSize();
50
52
53 lldb::SBData GetSectionData(uint64_t offset, uint64_t size);
54
56
57 /// Gets the permissions (RWX) of the section of the object file
58 ///
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
63 /// returned is 6
64 ///
65 /// \return
66 /// Returns an unsigned value for Permissions for the section.
67 uint32_t
68 GetPermissions() const;
69
70 LLDB_DEPRECATED("Always returns 1.")
71 uint32_t GetTargetByteSize();
72
73 /// Return the alignment of the section in bytes
74 ///
75 /// \return
76 /// The alignment of the section in bytes
77 uint32_t GetAlignment();
78
79 bool operator==(const lldb::SBSection &rhs);
80
81 bool operator!=(const lldb::SBSection &rhs);
82
83 bool GetDescription(lldb::SBStream &description);
84
85private:
86 friend class SBAddress;
87 friend class SBModule;
88 friend class SBTarget;
89
90 SBSection(const lldb::SectionSP &section_sp);
91
92 lldb::SectionSP GetSP() const;
93
94 void SetSP(const lldb::SectionSP &section_sp);
95
97};
98
99} // namespace lldb
100
101#endif // LLDB_API_SBSECTION_H
static Permissions GetPermissions(const ELFSectionHeader &H)
static lldb::SectionType GetSectionType(uint32_t flags, ConstString section_name)
#define LLDB_API
Definition SBDefines.h:28
#define LLDB_DEPRECATED(MSG)
Definition SBDefines.h:38
static llvm::StringRef GetName(XcodeSDK::Type type)
Definition XcodeSDK.cpp:21
uint32_t GetAlignment()
Return the alignment of the section in bytes.
uint64_t GetFileOffset()
lldb::SectionSP GetSP() const
bool IsValid() const
Definition SBSection.cpp:45
lldb::addr_t GetByteSize()
const lldb::SBSection & operator=(const lldb::SBSection &rhs)
Definition SBSection.cpp:36
lldb::SBSection FindSubSection(const char *sect_name)
Definition SBSection.cpp:78
lldb::SBSection GetParent()
Definition SBSection.cpp:65
friend class SBTarget
Definition SBSection.h:88
friend class SBModule
Definition SBSection.h:87
lldb::SectionWP m_opaque_wp
Definition SBSection.h:96
size_t GetNumSubSections()
Definition SBSection.cpp:93
lldb::addr_t GetFileAddress()
friend class SBAddress
Definition SBSection.h:86
lldb::addr_t GetLoadAddress(lldb::SBTarget &target)
bool GetDescription(lldb::SBStream &description)
lldb::SBData GetSectionData()
uint64_t GetFileByteSize()
uint32_t GetTargetByteSize()
void SetSP(const lldb::SectionSP &section_sp)
lldb::SBSection GetSubSectionAtIndex(size_t idx)
std::shared_ptr< lldb_private::Section > SectionSP
uint64_t addr_t
Definition lldb-types.h:80
std::weak_ptr< lldb_private::Section > SectionWP