diff options
author | Michael Sartain <mikesart@valvesoftware.com> | 2013-07-01 19:45:50 +0000 |
---|---|---|
committer | Michael Sartain <mikesart@valvesoftware.com> | 2013-07-01 19:45:50 +0000 |
commit | a7499c98301e847d2e525921801e1edcc44e34da (patch) | |
tree | 4b78835f6badd7ce118ed5175279f4efc26f0c80 /lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h | |
parent | 82bedb1f3ba396b32b0f2275e5e1003e4b143398 (diff) | |
download | bcm5719-llvm-a7499c98301e847d2e525921801e1edcc44e34da.tar.gz bcm5719-llvm-a7499c98301e847d2e525921801e1edcc44e34da.zip |
Split symbol support for ELF and Linux.
llvm-svn: 185366
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h | 53 |
1 files changed, 35 insertions, 18 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h index f1fea3c666d..a6e3cbb3fd9 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h @@ -100,7 +100,7 @@ public: GetAddressByteSize() const; virtual lldb_private::Symtab * - GetSymtab(); + GetSymtab(uint32_t flags = 0); virtual lldb_private::SectionList * GetSectionList(); @@ -114,6 +114,9 @@ public: virtual bool GetUUID(lldb_private::UUID* uuid); + virtual lldb_private::FileSpecList + GetDebugSymbolFilePaths(); + virtual uint32_t GetDependentModules(lldb_private::FileSpecList& files); @@ -141,7 +144,11 @@ private: typedef ProgramHeaderColl::iterator ProgramHeaderCollIter; typedef ProgramHeaderColl::const_iterator ProgramHeaderCollConstIter; - typedef std::vector<elf::ELFSectionHeader> SectionHeaderColl; + struct ELFSectionHeaderInfo : public elf::ELFSectionHeader + { + lldb_private::ConstString section_name; + }; + typedef std::vector<ELFSectionHeaderInfo> SectionHeaderColl; typedef SectionHeaderColl::iterator SectionHeaderCollIter; typedef SectionHeaderColl::const_iterator SectionHeaderCollConstIter; @@ -155,9 +162,13 @@ private: /// ELF file header. elf::ELFHeader m_header; - /// ELF build ID + /// ELF build ID. lldb_private::UUID m_uuid; + /// ELF .gnu_debuglink file and crc data if available. + std::string m_gnu_debuglink_file; + uint32_t m_gnu_debuglink_crc; + /// Collection of program headers. ProgramHeaderColl m_program_headers; @@ -171,9 +182,6 @@ private: /// libraries) on which this object file depends. mutable std::unique_ptr<lldb_private::FileSpecList> m_filespec_ap; - /// Data extractor holding the string table used to resolve section names. - lldb_private::DataExtractor m_shstr_data; - /// Cached value of the entry point for this module. lldb_private::Address m_entry_point_address; @@ -197,6 +205,15 @@ private: size_t ParseSectionHeaders(); + /// Parses the elf section headers and returns the uuid, debug link name, crc. + static size_t + GetSectionHeaderInfo(SectionHeaderColl §ion_headers, + lldb_private::DataExtractor &data, + const elf::ELFHeader &header, + lldb_private::UUID &uuid, + std::string &gnu_debuglink_file, + uint32_t &gnu_debuglink_crc); + /// Scans the dynamic section and locates all dependent modules (shared /// libraries) populating m_filespec_ap. This method will compute the /// dependent module list only once. Returns the number of dependent @@ -215,23 +232,26 @@ private: unsigned ParseSymbolTable(lldb_private::Symtab *symbol_table, lldb::user_id_t start_id, - const elf::ELFSectionHeader *symtab_section, lldb::user_id_t symtab_id); + /// Helper routine for ParseSymbolTable(). + unsigned + ParseSymbols(lldb_private::Symtab *symbol_table, + lldb::user_id_t start_id, + lldb_private::SectionList *section_list, + const ELFSectionHeaderInfo *symtab_shdr, + const lldb_private::DataExtractor &symtab_data, + const lldb_private::DataExtractor &strtab_data); + /// Scans the relocation entries and adds a set of artificial symbols to the /// given symbol table for each PLT slot. Returns the number of symbols /// added. unsigned ParseTrampolineSymbols(lldb_private::Symtab *symbol_table, lldb::user_id_t start_id, - const elf::ELFSectionHeader *rela_hdr, + const ELFSectionHeaderInfo *rela_hdr, lldb::user_id_t section_id); - /// Loads the section name string table into m_shstr_data. Returns the - /// number of bytes constituting the table. - size_t - GetSectionHeaderStringTable(); - /// Utility method for looking up a section given its name. Returns the /// index of the corresponding section or zero if no section with the given /// name can be found (note that section indices are always 1 based, and so @@ -244,7 +264,7 @@ private: GetSectionIndexByType(unsigned type); /// Returns the section header with the given id or NULL. - const elf::ELFSectionHeader * + const ELFSectionHeaderInfo * GetSectionHeaderByIndex(lldb::user_id_t id); /// @name ELF header dump routines @@ -284,7 +304,7 @@ private: static void DumpELFSectionHeader(lldb_private::Stream *s, - const elf::ELFSectionHeader& sh); + const ELFSectionHeaderInfo& sh); static void DumpELFSectionHeader_sh_type(lldb_private::Stream *s, @@ -302,9 +322,6 @@ private: const elf::ELFDynamic * FindDynamicSymbol(unsigned tag); - lldb_private::Section * - PLTSection(); - unsigned PLTRelocationType(); }; |