1 //===-- SymbolFileSymtab.h --------------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef liblldb_SymbolFileSymtab_h_ 10 #define liblldb_SymbolFileSymtab_h_ 11 12 #include <map> 13 #include <vector> 14 15 #include "lldb/Symbol/SymbolFile.h" 16 #include "lldb/Symbol/Symtab.h" 17 18 class SymbolFileSymtab : public lldb_private::SymbolFile { 19 public: 20 // Constructors and Destructors 21 SymbolFileSymtab(lldb_private::ObjectFile *obj_file); 22 23 ~SymbolFileSymtab() override; 24 25 // Static Functions 26 static void Initialize(); 27 28 static void Terminate(); 29 30 static lldb_private::ConstString GetPluginNameStatic(); 31 32 static const char *GetPluginDescriptionStatic(); 33 34 static lldb_private::SymbolFile * 35 CreateInstance(lldb_private::ObjectFile *obj_file); 36 37 uint32_t CalculateAbilities() override; 38 39 // Compile Unit function calls 40 uint32_t GetNumCompileUnits() override; 41 42 lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override; 43 44 lldb::LanguageType 45 ParseLanguage(lldb_private::CompileUnit &comp_unit) override; 46 47 size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override; 48 49 bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override; 50 51 bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override; 52 53 bool ParseSupportFiles(lldb_private::CompileUnit &comp_unit, 54 lldb_private::FileSpecList &support_files) override; 55 56 size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override; 57 58 bool ParseImportedModules( 59 const lldb_private::SymbolContext &sc, 60 std::vector<lldb_private::SourceModule> &imported_modules) override; 61 62 size_t ParseBlocksRecursive(lldb_private::Function &func) override; 63 64 size_t 65 ParseVariablesForContext(const lldb_private::SymbolContext &sc) override; 66 67 lldb_private::Type *ResolveTypeUID(lldb::user_id_t type_uid) override; 68 llvm::Optional<ArrayInfo> GetDynamicArrayInfoForUID( 69 lldb::user_id_t type_uid, 70 const lldb_private::ExecutionContext *exe_ctx) override; 71 72 bool CompleteType(lldb_private::CompilerType &compiler_type) override; 73 74 uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr, 75 lldb::SymbolContextItem resolve_scope, 76 lldb_private::SymbolContext &sc) override; 77 78 size_t GetTypes(lldb_private::SymbolContextScope *sc_scope, 79 lldb::TypeClass type_mask, 80 lldb_private::TypeList &type_list) override; 81 82 // PluginInterface protocol 83 lldb_private::ConstString GetPluginName() override; 84 85 uint32_t GetPluginVersion() override; 86 87 protected: 88 typedef std::map<lldb_private::ConstString, lldb::TypeSP> TypeMap; 89 90 lldb_private::Symtab::IndexCollection m_source_indexes; 91 lldb_private::Symtab::IndexCollection m_func_indexes; 92 lldb_private::Symtab::IndexCollection m_code_indexes; 93 lldb_private::Symtab::IndexCollection m_data_indexes; 94 lldb_private::Symtab::NameToIndexMap m_objc_class_name_to_index; 95 TypeMap m_objc_class_types; 96 97 private: 98 DISALLOW_COPY_AND_ASSIGN(SymbolFileSymtab); 99 }; 100 101 #endif // liblldb_SymbolFileSymtab_h_ 102