diff options
author | Greg Clayton <gclayton@apple.com> | 2012-02-05 02:38:54 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2012-02-05 02:38:54 +0000 |
commit | c96605461cddc640730fcbe93f35059a444a335c (patch) | |
tree | d82f72f7ea9da116705150fcfa3993442c0c135b /lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | |
parent | 6987fdb6208b491fb31d5599eeed6ea2f2c9f30d (diff) | |
download | bcm5719-llvm-c96605461cddc640730fcbe93f35059a444a335c.tar.gz bcm5719-llvm-c96605461cddc640730fcbe93f35059a444a335c.zip |
<rdar://problem/10560053>
Fixed "target modules list" (aliased to "image list") to output more information
by default. Modified the "target modules list" to have a few new options:
"--header" or "-h" => show the image header address
"--offset" or "-o" => show the image header address offset from the address in the file (the slide applied to the shared library)
Removed the "--symfile-basename" or "-S" option, and repurposed it to
"--symfile-unique" "-S" which will show the symbol file if it differs from
the executable file.
ObjectFile's can now be loaded from memory for cases where we don't have the
files cached locally in an SDK or net mounted root. ObjectFileMachO can now
read mach files from memory.
Moved the section data reading code into the ObjectFile so that the object
file can get the section data from Process memory if the file is only in
memory.
lldb_private::Module can now load its object file in a target with a rigid
slide (very common operation for most dynamic linkers) by using:
bool
Module::SetLoadAddress (Target &target, lldb::addr_t offset, bool &changed)
lldb::SBModule() now has a new constructor in the public interface:
SBModule::SBModule (lldb::SBProcess &process, lldb::addr_t header_addr);
This will find an appropriate ObjectFile plug-in to load an image from memory
where the object file header is at "header_addr".
llvm-svn: 149804
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index 81126f637f9..09bdff889c8 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -148,7 +148,8 @@ ObjectFileELF::Initialize() { PluginManager::RegisterPlugin(GetPluginNameStatic(), GetPluginDescriptionStatic(), - CreateInstance); + CreateInstance, + CreateMemoryInstance); } void @@ -196,6 +197,13 @@ ObjectFileELF::CreateInstance(Module *module, } +ObjectFile* +ObjectFileELF::CreateMemoryInstance(Module* module, DataBufferSP& data_sp, const lldb::ProcessSP &process_sp, lldb::addr_t header_addr) +{ + return NULL; +} + + //------------------------------------------------------------------ // PluginInterface protocol //------------------------------------------------------------------ @@ -428,8 +436,8 @@ ObjectFileELF::ParseDependentModules() DataExtractor dynsym_data; DataExtractor dynstr_data; - if (dynsym->ReadSectionDataFromObjectFile(this, dynsym_data) && - dynstr->ReadSectionDataFromObjectFile(this, dynstr_data)) + if (ReadSectionData(dynsym, dynsym_data) && + ReadSectionData(dynstr, dynstr_data)) { ELFDynamic symbol; const unsigned section_size = dynsym_data.GetByteSize(); @@ -812,8 +820,8 @@ ObjectFileELF::ParseSymbolTable(Symtab *symbol_table, user_id_t start_id, { DataExtractor symtab_data; DataExtractor strtab_data; - if (symtab->ReadSectionDataFromObjectFile(this, symtab_data) && - strtab->ReadSectionDataFromObjectFile(this, strtab_data)) + if (ReadSectionData(symtab, symtab_data) && + ReadSectionData(strtab, strtab_data)) { num_symbols = ParseSymbols(symbol_table, start_id, section_list, symtab_hdr, @@ -844,7 +852,7 @@ ObjectFileELF::ParseDynamicSymbols() ELFDynamic symbol; DataExtractor dynsym_data; - if (dynsym->ReadSectionDataFromObjectFile(this, dynsym_data)) + if (ReadSectionData(dynsym, dynsym_data)) { const unsigned section_size = dynsym_data.GetByteSize(); @@ -1034,15 +1042,15 @@ ObjectFileELF::ParseTrampolineSymbols(Symtab *symbol_table, return 0; DataExtractor rel_data; - if (!rel_section->ReadSectionDataFromObjectFile(this, rel_data)) + if (!ReadSectionData(rel_section, rel_data)) return 0; DataExtractor symtab_data; - if (!symtab->ReadSectionDataFromObjectFile(this, symtab_data)) + if (!ReadSectionData(symtab, symtab_data)) return 0; DataExtractor strtab_data; - if (!strtab->ReadSectionDataFromObjectFile(this, strtab_data)) + if (!ReadSectionData(strtab, strtab_data)) return 0; unsigned rel_type = PLTRelocationType(); |