9#include "llvm/ADT/StringRef.h"
99 delegate_sp->PopulateSymtab(
this, symtab);
120 std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
121 s->
Printf(
"%p: ",
static_cast<void *
>(
this));
126 *s <<
", arch = " << arch.GetArchitectureName();
164 return delegate_sp->GetArchitecture();
169 bool value_is_offset) {
170 size_t num_loaded_sections = 0;
173 const size_t num_sections = section_list->
GetSize();
175 for (
size_t sect_idx = 0; sect_idx < num_sections; ++sect_idx) {
179 if (section_sp && section_sp->GetFileSize() > 0 &&
180 !section_sp->IsThreadSpecific()) {
182 section_sp, section_sp->GetFileAddress() + value))
183 ++num_loaded_sections;
187 return num_loaded_sections > 0;
194 if (section_offset < file_size) {
195 size_t src_len = file_size - section_offset;
196 if (src_len > dst_len)
199 ((uint8_t *)(uintptr_t)section->
GetFileOffset()) + section_offset;
201 memcpy(dst, src, src_len);
211 const void *src = (
void *)(uintptr_t)section->
GetFileOffset();
214 std::make_shared<DataBufferHeap>(src, section->
GetFileSize());
215 section_data.
SetData(data_sp, 0, data_sp->GetByteSize());
220 section_data.
Clear();
A section + offset based address class.
An architecture specification class.
void Clear()
Clears the file list.
lldb::ModuleSP GetModule() const
Get const accessor for the module pointer.
ObjectFileJIT(const lldb::ModuleSP &module_sp, const lldb::ObjectFileJITDelegateSP &delegate_sp)
uint32_t GetDependentModules(lldb_private::FileSpecList &files) override
Extract the dependent modules from an object file.
bool IsStripped() override
Detect if this object file has been stripped of local symbols.
bool IsExecutable() const override
Tells whether this object file is capable of being the main executable for a process.
lldb::ByteOrder GetByteOrder() const override
Gets whether endian swapping should occur when extracting data from this object file.
static lldb_private::ObjectFile * CreateInstance(const lldb::ModuleSP &module_sp, lldb::DataBufferSP data_sp, lldb::offset_t data_offset, const lldb_private::FileSpec *file, lldb::offset_t file_offset, lldb::offset_t length)
lldb_private::Address GetBaseAddress() override
Returns base address of this object file.
static llvm::StringRef GetPluginDescriptionStatic()
lldb_private::UUID GetUUID() override
Gets the UUID for this object file.
lldb_private::ArchSpec GetArchitecture() override
Get the ArchSpec for this object file.
lldb_private::Address GetEntryPointAddress() override
Returns the address of the Entry Point in this object file - if the object file doesn't have an entry...
void Dump(lldb_private::Stream *s) override
Dump a description of this object to a Stream.
bool ParseHeader() override
Attempts to parse the object header.
lldb::ObjectFileJITDelegateWP m_delegate_wp
ObjectFile::Strata CalculateStrata() override
The object file should be able to calculate the strata of the object file.
uint32_t GetAddressByteSize() const override
Gets the address size in bytes for the current object file.
static llvm::StringRef GetPluginNameStatic()
void CreateSections(lldb_private::SectionList &unified_section_list) override
ObjectFile::Type CalculateType() override
The object file should be able to calculate its type by looking at its file header and possibly the s...
size_t ReadSectionData(lldb_private::Section *section, lldb::offset_t section_offset, void *dst, size_t dst_len) override
~ObjectFileJIT() override
bool SetLoadAddress(lldb_private::Target &target, lldb::addr_t value, bool value_is_offset) override
Sets the load address for an entire module, assuming a rigid slide of sections, if possible in the im...
void ParseSymtab(lldb_private::Symtab &symtab) override
Parse the symbol table into the provides symbol table object.
static lldb_private::ObjectFile * CreateMemoryInstance(const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp, const lldb::ProcessSP &process_sp, lldb::addr_t header_addr)
static size_t GetModuleSpecifications(const lldb_private::FileSpec &file, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, lldb::offset_t file_offset, lldb::offset_t length, lldb_private::ModuleSpecList &specs)
A plug-in interface definition class for object file parsers.
DataExtractor m_data
The data for this object file so things can be parsed lazily.
std::unique_ptr< lldb_private::SectionList > m_sections_up
std::unique_ptr< lldb_private::Symtab > m_symtab_up
@ eTypeJIT
JIT code that has symbols, sections and possibly debug info.
virtual SectionList * GetSectionList(bool update_module_section_list=true)
Gets the section list for the currently selected architecture (and object for archives).
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static bool UnregisterPlugin(ABICreateInstance create_callback)
void Dump(llvm::raw_ostream &s, unsigned indent, Target *target, bool show_header, uint32_t depth) const
lldb::SectionSP GetSectionAtIndex(size_t idx) const
bool SetSectionLoadAddress(const lldb::SectionSP §ion_sp, lldb::addr_t load_addr, bool warn_multiple=false)
lldb::offset_t GetFileOffset() const
lldb::offset_t GetFileSize() const
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 Indent(llvm::StringRef s="")
Indent the current line in the stream.
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.
size_t EOL()
Output and End of Line character to the stream.
unsigned GetIndentLevel() const
Get the current indentation level.
SectionLoadList & GetSectionLoadList()
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Process > ProcessSP
ByteOrder
Byte ordering definitions.
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
std::shared_ptr< lldb_private::Section > SectionSP
std::shared_ptr< lldb_private::WritableDataBuffer > WritableDataBufferSP
std::shared_ptr< lldb_private::ObjectFileJITDelegate > ObjectFileJITDelegateSP
std::shared_ptr< lldb_private::Module > ModuleSP