LLDB  mainline
SymbolFileSymtab.h
Go to the documentation of this file.
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 LLDB_SOURCE_PLUGINS_SYMBOLFILE_SYMTAB_SYMBOLFILESYMTAB_H
10 #define LLDB_SOURCE_PLUGINS_SYMBOLFILE_SYMTAB_SYMBOLFILESYMTAB_H
11 
12 #include <map>
13 #include <vector>
14 
15 #include "lldb/Symbol/SymbolFile.h"
16 #include "lldb/Symbol/Symtab.h"
17 
19  /// LLVM RTTI support.
20  static char ID;
21 
22 public:
23  /// LLVM RTTI support.
24  /// \{
25  bool isA(const void *ClassID) const override {
26  return ClassID == &ID || SymbolFile::isA(ClassID);
27  }
28  static bool classof(const SymbolFile *obj) { return obj->isA(&ID); }
29  /// \}
30 
31  // Constructors and Destructors
32  SymbolFileSymtab(lldb::ObjectFileSP objfile_sp);
33 
34  // Static Functions
35  static void Initialize();
36 
37  static void Terminate();
38 
40 
41  static const char *GetPluginDescriptionStatic();
42 
44  CreateInstance(lldb::ObjectFileSP objfile_sp);
45 
46  uint32_t CalculateAbilities() override;
47 
48  // Compile Unit function calls
50  ParseLanguage(lldb_private::CompileUnit &comp_unit) override;
51 
52  size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override;
53 
54  bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override;
55 
56  bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override;
57 
59  lldb_private::FileSpecList &support_files) override;
60 
61  size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override;
62 
65  std::vector<lldb_private::SourceModule> &imported_modules) override;
66 
67  size_t ParseBlocksRecursive(lldb_private::Function &func) override;
68 
69  size_t
71 
73  llvm::Optional<ArrayInfo> GetDynamicArrayInfoForUID(
74  lldb::user_id_t type_uid,
75  const lldb_private::ExecutionContext *exe_ctx) override;
76 
77  bool CompleteType(lldb_private::CompilerType &compiler_type) override;
78 
80  lldb::SymbolContextItem resolve_scope,
81  lldb_private::SymbolContext &sc) override;
82 
84  lldb::TypeClass type_mask,
85  lldb_private::TypeList &type_list) override;
86 
87  // PluginInterface protocol
89 
90  uint32_t GetPluginVersion() override;
91 
92 protected:
94 
95  lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
96 
97  typedef std::map<lldb_private::ConstString, lldb::TypeSP> TypeMap;
98 
105 };
106 
107 #endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_SYMTAB_SYMBOLFILESYMTAB_H
lldb_private::SymbolFile::SymbolFile
SymbolFile(lldb::ObjectFileSP objfile_sp)
Definition: SymbolFile.h:68
SymbolFileSymtab::ParseDebugMacros
bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileSymtab.cpp:213
lldb_private::SymbolFile
Definition: SymbolFile.h:37
lldb_private::ExecutionContext
Definition: ExecutionContext.h:291
SymbolFileSymtab::Terminate
static void Terminate()
Definition: SymbolFileSymtab.cpp:37
SymbolFileSymtab::ParseLineTable
bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileSymtab.cpp:211
SymbolFileSymtab::CompleteType
bool CompleteType(lldb_private::CompilerType &compiler_type) override
Definition: SymbolFileSymtab.cpp:243
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
SymbolFileSymtab::GetTypes
void GetTypes(lldb_private::SymbolContextScope *sc_scope, lldb::TypeClass type_mask, lldb_private::TypeList &type_list) override
Definition: SymbolFileSymtab.cpp:54
SymbolFileSymtab::ResolveSymbolContext
uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr, lldb::SymbolContextItem resolve_scope, lldb_private::SymbolContext &sc) override
Definition: SymbolFileSymtab.cpp:247
SymbolFileSymtab::CalculateAbilities
uint32_t CalculateAbilities() override
Definition: SymbolFileSymtab.cpp:62
SymbolFileSymtab::ParseLanguage
lldb::LanguageType ParseLanguage(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileSymtab.cpp:134
lldb_private::SymbolContext
Definition: SymbolContext.h:33
SymbolFileSymtab::ParseFunctions
size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileSymtab.cpp:138
SymbolFileSymtab::Initialize
static void Initialize()
Definition: SymbolFileSymtab.cpp:32
lldb_private::CompileUnit
Definition: CompileUnit.h:38
SymbolFileSymtab::ID
static char ID
LLVM RTTI support.
Definition: SymbolFileSymtab.h:20
SymbolFileSymtab::ResolveTypeUID
lldb_private::Type * ResolveTypeUID(lldb::user_id_t type_uid) override
Definition: SymbolFileSymtab.cpp:233
lldb_private::Function
Definition: Function.h:413
SymbolFileSymtab::ParseBlocksRecursive
size_t ParseBlocksRecursive(lldb_private::Function &func) override
Definition: SymbolFileSymtab.cpp:227
SymbolFileSymtab::ParseCompileUnitAtIndex
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override
Definition: SymbolFileSymtab.cpp:118
SymbolFileSymtab::CreateInstance
static lldb_private::SymbolFile * CreateInstance(lldb::ObjectFileSP objfile_sp)
Definition: SymbolFileSymtab.cpp:50
SymbolFileSymtab::m_func_indexes
lldb_private::Symtab::IndexCollection m_func_indexes
Definition: SymbolFileSymtab.h:100
SymbolFileSymtab::classof
static bool classof(const SymbolFile *obj)
Definition: SymbolFileSymtab.h:28
SymbolFileSymtab::CalculateNumCompileUnits
uint32_t CalculateNumCompileUnits() override
Definition: SymbolFileSymtab.cpp:107
SymbolFileSymtab::ParseVariablesForContext
size_t ParseVariablesForContext(const lldb_private::SymbolContext &sc) override
Definition: SymbolFileSymtab.cpp:229
lldb_private::ConstString
Definition: ConstString.h:40
SymbolFileSymtab::SymbolFileSymtab
SymbolFileSymtab(lldb::ObjectFileSP objfile_sp)
Definition: SymbolFileSymtab.cpp:58
lldb_private::UniqueCStringMap< uint32_t >
lldb_private::SymbolContextScope
Definition: SymbolContextScope.h:64
SymbolFileSymtab::GetPluginNameStatic
static lldb_private::ConstString GetPluginNameStatic()
Definition: SymbolFileSymtab.cpp:41
SymbolFileSymtab::GetPluginName
lldb_private::ConstString GetPluginName() override
Definition: SymbolFileSymtab.cpp:265
SymbolFileSymtab::GetPluginVersion
uint32_t GetPluginVersion() override
Definition: SymbolFileSymtab.cpp:269
uint32_t
SymbolFileSymtab::ParseImportedModules
bool ParseImportedModules(const lldb_private::SymbolContext &sc, std::vector< lldb_private::SourceModule > &imported_modules) override
Definition: SymbolFileSymtab.cpp:222
lldb_private::Address
Definition: Address.h:59
SymbolFileSymtab
Definition: SymbolFileSymtab.h:18
lldb_private::Type
Definition: Type.h:66
SymbolFileSymtab::ParseTypes
size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileSymtab.cpp:209
Symtab.h
SymbolFileSymtab::m_code_indexes
lldb_private::Symtab::IndexCollection m_code_indexes
Definition: SymbolFileSymtab.h:101
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
SymbolFileSymtab::ParseSupportFiles
bool ParseSupportFiles(lldb_private::CompileUnit &comp_unit, lldb_private::FileSpecList &support_files) override
Definition: SymbolFileSymtab.cpp:217
SymbolFileSymtab::m_objc_class_types
TypeMap m_objc_class_types
Definition: SymbolFileSymtab.h:104
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
SymbolFileSymtab::GetDynamicArrayInfoForUID
llvm::Optional< ArrayInfo > GetDynamicArrayInfoForUID(lldb::user_id_t type_uid, const lldb_private::ExecutionContext *exe_ctx) override
If type_uid points to an array type, return its characteristics.
Definition: SymbolFileSymtab.cpp:238
lldb_private::TypeList
Definition: TypeList.h:20
SymbolFileSymtab::GetPluginDescriptionStatic
static const char * GetPluginDescriptionStatic()
Definition: SymbolFileSymtab.cpp:46
lldb_private::Symtab::IndexCollection
std::vector< uint32_t > IndexCollection
Definition: Symtab.h:23
SymbolFileSymtab::isA
bool isA(const void *ClassID) const override
LLVM RTTI support.
Definition: SymbolFileSymtab.h:25
SymbolFileSymtab::m_objc_class_name_to_index
lldb_private::Symtab::NameToIndexMap m_objc_class_name_to_index
Definition: SymbolFileSymtab.h:103
SymbolFileSymtab::m_data_indexes
lldb_private::Symtab::IndexCollection m_data_indexes
Definition: SymbolFileSymtab.h:102
SymbolFile.h
SymbolFileSymtab::m_source_indexes
lldb_private::Symtab::IndexCollection m_source_indexes
Definition: SymbolFileSymtab.h:99
SymbolFileSymtab::TypeMap
std::map< lldb_private::ConstString, lldb::TypeSP > TypeMap
Definition: SymbolFileSymtab.h:97