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 <optional>
14#include <vector>
15
16#include "lldb/Symbol/SymbolFile.h"
17#include "lldb/Symbol/Symtab.h"
18
19class SymbolFileSymtab : public lldb_private::SymbolFileCommon {
20 /// LLVM RTTI support.
21 static char ID;
22
23public:
24 /// LLVM RTTI support.
25 /// \{
26 bool isA(const void *ClassID) const override {
27 return ClassID == &ID || SymbolFileCommon::isA(ClassID);
28 }
29 static bool classof(const SymbolFile *obj) { return obj->isA(ClassID: &ID); }
30 /// \}
31
32 // Constructors and Destructors
33 SymbolFileSymtab(lldb::ObjectFileSP objfile_sp);
34
35 // Static Functions
36 static void Initialize();
37
38 static void Terminate();
39
40 static llvm::StringRef GetPluginNameStatic() { return "symtab"; }
41
42 static llvm::StringRef GetPluginDescriptionStatic();
43
44 static lldb_private::SymbolFile *
45 CreateInstance(lldb::ObjectFileSP objfile_sp);
46
47 uint32_t CalculateAbilities() override;
48
49 // Compile Unit function calls
50 lldb::LanguageType
51 ParseLanguage(lldb_private::CompileUnit &comp_unit) override;
52
53 size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override;
54
55 bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override;
56
57 bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override;
58
59 bool ParseSupportFiles(lldb_private::CompileUnit &comp_unit,
60 lldb_private::SupportFileList &support_files) override;
61
62 size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override;
63
64 bool ParseImportedModules(
65 const lldb_private::SymbolContext &sc,
66 std::vector<lldb_private::SourceModule> &imported_modules) override;
67
68 size_t ParseBlocksRecursive(lldb_private::Function &func) override;
69
70 size_t
71 ParseVariablesForContext(const lldb_private::SymbolContext &sc) override;
72
73 lldb_private::Type *ResolveTypeUID(lldb::user_id_t type_uid) override;
74 std::optional<ArrayInfo> GetDynamicArrayInfoForUID(
75 lldb::user_id_t type_uid,
76 const lldb_private::ExecutionContext *exe_ctx) override;
77
78 bool CompleteType(lldb_private::CompilerType &compiler_type) override;
79
80 uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr,
81 lldb::SymbolContextItem resolve_scope,
82 lldb_private::SymbolContext &sc) override;
83
84 void GetTypes(lldb_private::SymbolContextScope *sc_scope,
85 lldb::TypeClass type_mask,
86 lldb_private::TypeList &type_list) override;
87
88 // PluginInterface protocol
89 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
90
91protected:
92 uint32_t CalculateNumCompileUnits() override;
93
94 lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
95
96 lldb_private::Symtab::IndexCollection m_source_indexes;
97 lldb_private::Symtab::IndexCollection m_func_indexes;
98 lldb_private::Symtab::IndexCollection m_code_indexes;
99 lldb_private::Symtab::IndexCollection m_data_indexes;
100 lldb_private::Symtab::NameToIndexMap m_objc_class_name_to_index;
101};
102
103#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_SYMTAB_SYMBOLFILESYMTAB_H
104

source code of lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h