1 //===-- SymbolFileSymtab.h --------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef liblldb_SymbolFileSymtab_h_ 11 #define liblldb_SymbolFileSymtab_h_ 12 13 #include "lldb/Symbol/SymbolFile.h" 14 #include "lldb/Symbol/Symtab.h" 15 #include <vector> 16 17 class SymbolFileSymtab : public lldb_private::SymbolFile 18 { 19 public: 20 //------------------------------------------------------------------ 21 // Static Functions 22 //------------------------------------------------------------------ 23 static void 24 Initialize(); 25 26 static void 27 Terminate(); 28 29 static lldb_private::ConstString 30 GetPluginNameStatic(); 31 32 static const char * 33 GetPluginDescriptionStatic(); 34 35 static lldb_private::SymbolFile* 36 CreateInstance (lldb_private::ObjectFile* obj_file); 37 38 //------------------------------------------------------------------ 39 // Constructors and Destructors 40 //------------------------------------------------------------------ 41 SymbolFileSymtab(lldb_private::ObjectFile* obj_file); 42 43 virtual 44 ~SymbolFileSymtab(); 45 46 virtual uint32_t CalculateAbilities (); 47 48 //------------------------------------------------------------------ 49 // Compile Unit function calls 50 //------------------------------------------------------------------ 51 virtual uint32_t 52 GetNumCompileUnits(); 53 54 virtual lldb::CompUnitSP 55 ParseCompileUnitAtIndex(uint32_t index); 56 57 virtual lldb::LanguageType 58 ParseCompileUnitLanguage (const lldb_private::SymbolContext& sc); 59 60 virtual size_t 61 ParseCompileUnitFunctions (const lldb_private::SymbolContext& sc); 62 63 virtual bool 64 ParseCompileUnitLineTable (const lldb_private::SymbolContext& sc); 65 66 virtual bool 67 ParseCompileUnitSupportFiles (const lldb_private::SymbolContext& sc, lldb_private::FileSpecList &support_files); 68 69 virtual size_t 70 ParseFunctionBlocks (const lldb_private::SymbolContext& sc); 71 72 virtual size_t 73 ParseTypes (const lldb_private::SymbolContext& sc); 74 75 virtual size_t 76 ParseVariablesForContext (const lldb_private::SymbolContext& sc); 77 78 virtual lldb_private::Type* 79 ResolveTypeUID(lldb::user_id_t type_uid); 80 81 virtual bool 82 ResolveClangOpaqueTypeDefinition (lldb_private::ClangASTType& clang_type); 83 84 virtual uint32_t 85 ResolveSymbolContext (const lldb_private::Address& so_addr, uint32_t resolve_scope, lldb_private::SymbolContext& sc); 86 87 virtual uint32_t 88 ResolveSymbolContext (const lldb_private::FileSpec& file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, lldb_private::SymbolContextList& sc_list); 89 90 virtual uint32_t 91 FindGlobalVariables(const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, lldb_private::VariableList& variables); 92 93 virtual uint32_t 94 FindGlobalVariables(const lldb_private::RegularExpression& regex, bool append, uint32_t max_matches, lldb_private::VariableList& variables); 95 96 virtual uint32_t 97 FindFunctions(const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, uint32_t name_type_mask, bool include_inlines, bool append, lldb_private::SymbolContextList& sc_list); 98 99 virtual uint32_t 100 FindFunctions(const lldb_private::RegularExpression& regex, bool include_inlines, bool append, lldb_private::SymbolContextList& sc_list); 101 102 virtual uint32_t 103 FindTypes (const lldb_private::SymbolContext& sc,const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, lldb_private::TypeList& types); 104 105 virtual size_t 106 GetTypes (lldb_private::SymbolContextScope *sc_scope, 107 uint32_t type_mask, 108 lldb_private::TypeList &type_list); 109 110 virtual lldb_private::ClangNamespaceDecl 111 FindNamespace (const lldb_private::SymbolContext& sc, 112 const lldb_private::ConstString &name, 113 const lldb_private::ClangNamespaceDecl *parent_namespace_decl); 114 115 //------------------------------------------------------------------ 116 // PluginInterface protocol 117 //------------------------------------------------------------------ 118 virtual lldb_private::ConstString 119 GetPluginName(); 120 121 virtual uint32_t 122 GetPluginVersion(); 123 124 protected: 125 typedef std::map<lldb_private::ConstString, lldb::TypeSP> TypeMap; 126 127 lldb_private::Symtab::IndexCollection m_source_indexes; 128 lldb_private::Symtab::IndexCollection m_func_indexes; 129 lldb_private::Symtab::IndexCollection m_code_indexes; 130 lldb_private::Symtab::IndexCollection m_data_indexes; 131 lldb_private::Symtab::NameToIndexMap m_objc_class_name_to_index; 132 TypeMap m_objc_class_types; 133 134 lldb_private::ClangASTContext & 135 GetClangASTContext (); 136 137 private: 138 DISALLOW_COPY_AND_ASSIGN (SymbolFileSymtab); 139 }; 140 141 142 #endif // liblldb_SymbolFileSymtab_h_ 143