47 return this->
operator bool();
49SBSection::operator bool()
const {
53 return section_sp && section_sp->GetModule().get() !=
nullptr;
61 return section_sp->GetName().GetCString();
71 SectionSP parent_section_sp(section_sp->GetParent());
72 if (parent_section_sp)
73 sb_section.
SetSP(parent_section_sp);
87 section_sp->GetChildren().FindSectionByName(const_sect_name));
98 return section_sp->GetChildren().GetSize();
108 sb_section.
SetSP(section_sp->GetChildren().GetSectionAtIndex(idx));
124 return section_sp->GetFileAddress();
135 return section_sp->GetLoadBaseAddress(target_sp.get());
145 return section_sp->GetByteSize();
154 ModuleSP module_sp(section_sp->GetModule());
156 ObjectFile *objfile = module_sp->GetObjectFile();
158 return objfile->
GetFileOffset() + section_sp->GetFileOffset();
169 return section_sp->GetFileSize();
186 section_sp->GetSectionData(section_data);
188 std::make_shared<DataExtractor>(section_data, offset, size));
197 if (section_sp.get())
198 return section_sp->GetType();
207 return section_sp->GetPermissions();
215 if (section_sp.get())
216 return section_sp->GetTargetByteSize();
224 if (section_sp.get())
225 return (1 << section_sp->GetLog2Align());
234 if (lhs_section_sp && rhs_section_sp)
235 return lhs_section_sp == rhs_section_sp;
244 return lhs_section_sp != rhs_section_sp;
254 const addr_t file_addr = section_sp->GetFileAddress();
255 strm.
Printf(
"[0x%16.16" PRIx64
"-0x%16.16" PRIx64
") ", file_addr,
256 file_addr + section_sp->GetByteSize());
#define LLDB_INSTRUMENT_VA(...)
void SetOpaque(const lldb::DataExtractorSP &data_sp)
uint32_t GetAlignment()
Return the alignment of the section in bytes.
uint32_t GetPermissions() const
Gets the permissions (RWX) of the section of the object file.
lldb::SectionSP GetSP() const
lldb::addr_t GetByteSize()
const lldb::SBSection & operator=(const lldb::SBSection &rhs)
lldb::SBSection FindSubSection(const char *sect_name)
lldb::SBSection GetParent()
bool operator==(const lldb::SBSection &rhs)
SectionType GetSectionType()
lldb::SectionWP m_opaque_wp
size_t GetNumSubSections()
lldb::addr_t GetFileAddress()
lldb::addr_t GetLoadAddress(lldb::SBTarget &target)
bool GetDescription(lldb::SBStream &description)
bool operator!=(const lldb::SBSection &rhs)
lldb::SBData GetSectionData()
uint64_t GetFileByteSize()
uint32_t GetTargetByteSize()
Return the size of a target's byte represented by this section in numbers of host bytes.
void SetSP(const lldb::SectionSP §ion_sp)
lldb::SBSection GetSubSectionAtIndex(size_t idx)
lldb_private::Stream & ref()
lldb::TargetSP GetSP() const
A uniqued constant string class.
A plug-in interface definition class for object file parsers.
virtual lldb::addr_t GetFileOffset() const
Returns the offset into a file at which this object resides.
A stream class that can stream formatted output to a file.
llvm::raw_ostream & AsRawOstream()
Returns a raw_ostream that forwards the data to this Stream object.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Section > SectionSP
std::shared_ptr< lldb_private::Target > TargetSP
std::shared_ptr< lldb_private::Module > ModuleSP