1 //===-- SymbolFileSymtab.h --------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_SymbolFileSymtab_h_
10 #define liblldb_SymbolFileSymtab_h_
15 #include "lldb/Symbol/SymbolFile.h"
16 #include "lldb/Symbol/Symtab.h"
18 class SymbolFileSymtab : public lldb_private::SymbolFile {
20 // Constructors and Destructors
21 SymbolFileSymtab(lldb_private::ObjectFile *obj_file);
23 ~SymbolFileSymtab() override;
26 static void Initialize();
28 static void Terminate();
30 static lldb_private::ConstString GetPluginNameStatic();
32 static const char *GetPluginDescriptionStatic();
34 static lldb_private::SymbolFile *
35 CreateInstance(lldb_private::ObjectFile *obj_file);
37 uint32_t CalculateAbilities() override;
39 // Compile Unit function calls
40 uint32_t GetNumCompileUnits() override;
42 lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
45 ParseLanguage(lldb_private::CompileUnit &comp_unit) override;
47 size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override;
49 bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override;
51 bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override;
53 bool ParseSupportFiles(lldb_private::CompileUnit &comp_unit,
54 lldb_private::FileSpecList &support_files) override;
56 size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override;
58 bool ParseImportedModules(
59 const lldb_private::SymbolContext &sc,
60 std::vector<lldb_private::SourceModule> &imported_modules) override;
62 size_t ParseBlocksRecursive(lldb_private::Function &func) override;
65 ParseVariablesForContext(const lldb_private::SymbolContext &sc) override;
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;
72 bool CompleteType(lldb_private::CompilerType &compiler_type) override;
74 uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr,
75 lldb::SymbolContextItem resolve_scope,
76 lldb_private::SymbolContext &sc) override;
78 size_t GetTypes(lldb_private::SymbolContextScope *sc_scope,
79 lldb::TypeClass type_mask,
80 lldb_private::TypeList &type_list) override;
82 // PluginInterface protocol
83 lldb_private::ConstString GetPluginName() override;
85 uint32_t GetPluginVersion() override;
88 typedef std::map<lldb_private::ConstString, lldb::TypeSP> TypeMap;
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;
98 DISALLOW_COPY_AND_ASSIGN(SymbolFileSymtab);
101 #endif // liblldb_SymbolFileSymtab_h_