1 //===-- SymbolVendor.h ------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_SymbolVendor_h_
11 #define liblldb_SymbolVendor_h_
15 #include "lldb/lldb-private.h"
16 #include "lldb/Core/ModuleChild.h"
17 #include "lldb/Core/PluginInterface.h"
18 #include "lldb/Symbol/ClangNamespaceDecl.h"
19 #include "lldb/Symbol/TypeList.h"
22 namespace lldb_private {
24 //----------------------------------------------------------------------
25 // The symbol vendor class is designed to abstract the process of
26 // searching for debug information for a given module. Platforms can
27 // subclass this class and provide extra ways to find debug information.
28 // Examples would be a subclass that would allow for locating a stand
29 // alone debug file, parsing debug maps, or runtime data in the object
30 // files. A symbol vendor can use multiple sources (SymbolFile
31 // objects) to provide the information and only parse as deep as needed
32 // in order to provide the information that is requested.
33 //----------------------------------------------------------------------
36 public PluginInterface
40 FindPlugin (const lldb::ModuleSP &module_sp,
41 Stream *feedback_strm);
43 //------------------------------------------------------------------
44 // Constructors and Destructors
45 //------------------------------------------------------------------
46 SymbolVendor(const lldb::ModuleSP &module_sp);
52 AddSymbolFileRepresentation(const lldb::ObjectFileSP &objfile_sp);
57 virtual lldb::LanguageType
58 ParseCompileUnitLanguage (const SymbolContext& sc);
61 ParseCompileUnitFunctions (const SymbolContext& sc);
64 ParseCompileUnitLineTable (const SymbolContext& sc);
67 ParseCompileUnitSupportFiles (const SymbolContext& sc,
68 FileSpecList& support_files);
71 ParseFunctionBlocks (const SymbolContext& sc);
74 ParseTypes (const SymbolContext& sc);
77 ParseVariablesForContext (const SymbolContext& sc);
80 ResolveTypeUID(lldb::user_id_t type_uid);
83 ResolveSymbolContext (const Address& so_addr,
84 uint32_t resolve_scope,
88 ResolveSymbolContext (const FileSpec& file_spec,
91 uint32_t resolve_scope,
92 SymbolContextList& sc_list);
95 FindGlobalVariables (const ConstString &name,
96 const ClangNamespaceDecl *namespace_decl,
99 VariableList& variables);
102 FindGlobalVariables (const RegularExpression& regex,
105 VariableList& variables);
108 FindFunctions (const ConstString &name,
109 const ClangNamespaceDecl *namespace_decl,
110 uint32_t name_type_mask,
111 bool include_inlines,
113 SymbolContextList& sc_list);
116 FindFunctions (const RegularExpression& regex,
117 bool include_inlines,
119 SymbolContextList& sc_list);
122 FindTypes (const SymbolContext& sc,
123 const ConstString &name,
124 const ClangNamespaceDecl *namespace_decl,
129 virtual ClangNamespaceDecl
130 FindNamespace (const SymbolContext& sc,
131 const ConstString &name,
132 const ClangNamespaceDecl *parent_namespace_decl);
135 GetNumCompileUnits();
138 SetCompileUnitAtIndex (size_t cu_idx,
139 const lldb::CompUnitSP &cu_sp);
141 virtual lldb::CompUnitSP
142 GetCompileUnitAtIndex(size_t idx);
157 GetTypes (SymbolContextScope *sc_scope,
159 TypeList &type_list);
164 return m_sym_file_ap.get();
167 // Get module unified section list symbol table.
171 // Clear module unified section list symbol table.
175 //------------------------------------------------------------------
176 // PluginInterface protocol
177 //------------------------------------------------------------------
185 //------------------------------------------------------------------
186 // Classes that inherit from SymbolVendor can see and modify these
187 //------------------------------------------------------------------
188 typedef std::vector<lldb::CompUnitSP> CompileUnits;
189 typedef CompileUnits::iterator CompileUnitIter;
190 typedef CompileUnits::const_iterator CompileUnitConstIter;
192 TypeList m_type_list; // Uniqued types for all parsers owned by this module
193 CompileUnits m_compile_units; // The current compile units
194 lldb::ObjectFileSP m_objfile_sp; // Keep a reference to the object file in case it isn't the same as the module object file (debug symbols in a separate file)
195 std::unique_ptr<SymbolFile> m_sym_file_ap; // A single symbol file. Subclasses can add more of these if needed.
198 //------------------------------------------------------------------
199 // For SymbolVendor only
200 //------------------------------------------------------------------
201 DISALLOW_COPY_AND_ASSIGN (SymbolVendor);
205 } // namespace lldb_private
207 #endif // liblldb_SymbolVendor_h_