diff --git a/lldb/include/lldb/Symbol/ObjectFile.h b/lldb/include/lldb/Symbol/ObjectFile.h --- a/lldb/include/lldb/Symbol/ObjectFile.h +++ b/lldb/include/lldb/Symbol/ObjectFile.h @@ -673,6 +673,9 @@ virtual size_t ReadSectionData(Section *section, DataExtractor §ion_data); + const char *GetCStrFromSection(Section *section, + lldb::offset_t section_offset) const; + bool IsInMemory() const { return m_memory_addr != LLDB_INVALID_ADDRESS; } // Strip linker annotations (such as @@VERSION) from symbol names. diff --git a/lldb/source/Symbol/ObjectFile.cpp b/lldb/source/Symbol/ObjectFile.cpp --- a/lldb/source/Symbol/ObjectFile.cpp +++ b/lldb/source/Symbol/ObjectFile.cpp @@ -553,6 +553,13 @@ section_data); } +const char * +ObjectFile::GetCStrFromSection(Section *section, + lldb::offset_t section_offset) const { + offset_t offset = section->GetOffset() + section_offset; + return m_data.GetCStr(&offset); +} + bool ObjectFile::SplitArchivePathWithObject(llvm::StringRef path_with_object, FileSpec &archive_file, ConstString &archive_object,