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 <optional>
14#include <vector>
15
17#include "lldb/Symbol/Symtab.h"
18
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(&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
45 CreateInstance(lldb::ObjectFileSP objfile_sp);
46
48
49 // Compile Unit function calls
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
60 lldb_private::FileSpecList &support_files) override;
61
62 size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override;
63
66 std::vector<lldb_private::SourceModule> &imported_modules) override;
67
68 size_t ParseBlocksRecursive(lldb_private::Function &func) override;
69
70 size_t
72
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
81 lldb::SymbolContextItem resolve_scope,
82 lldb_private::SymbolContext &sc) override;
83
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:
93
94 lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
95
96 typedef std::map<lldb_private::ConstString, lldb::TypeSP> TypeMap;
97
104};
105
106#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_SYMTAB_SYMBOLFILESYMTAB_H
lldb_private::Symtab::IndexCollection m_data_indexes
bool CompleteType(lldb_private::CompilerType &compiler_type) override
bool isA(const void *ClassID) const override
LLVM RTTI support.
lldb_private::Symtab::IndexCollection m_source_indexes
uint32_t CalculateAbilities() override
uint32_t CalculateNumCompileUnits() override
std::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.
void GetTypes(lldb_private::SymbolContextScope *sc_scope, lldb::TypeClass type_mask, lldb_private::TypeList &type_list) override
bool ParseSupportFiles(lldb_private::CompileUnit &comp_unit, lldb_private::FileSpecList &support_files) override
llvm::StringRef GetPluginName() override
static void Initialize()
lldb_private::Symtab::IndexCollection m_func_indexes
static char ID
LLVM RTTI support.
bool ParseImportedModules(const lldb_private::SymbolContext &sc, std::vector< lldb_private::SourceModule > &imported_modules) override
static bool classof(const SymbolFile *obj)
lldb_private::Symtab::IndexCollection m_code_indexes
size_t ParseBlocksRecursive(lldb_private::Function &func) override
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override
size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override
bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override
static void Terminate()
bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override
size_t ParseVariablesForContext(const lldb_private::SymbolContext &sc) override
static llvm::StringRef GetPluginDescriptionStatic()
lldb_private::Symtab::NameToIndexMap m_objc_class_name_to_index
lldb_private::Type * ResolveTypeUID(lldb::user_id_t type_uid) override
std::map< lldb_private::ConstString, lldb::TypeSP > TypeMap
uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr, lldb::SymbolContextItem resolve_scope, lldb_private::SymbolContext &sc) override
static lldb_private::SymbolFile * CreateInstance(lldb::ObjectFileSP objfile_sp)
static llvm::StringRef GetPluginNameStatic()
lldb::LanguageType ParseLanguage(lldb_private::CompileUnit &comp_unit) override
size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override
A section + offset based address class.
Definition: Address.h:59
A class that describes a compilation unit.
Definition: CompileUnit.h:41
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A class that describes a function.
Definition: Function.h:409
"lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is part of a symbol context and c...
Defines a symbol context baton that can be handed other debug core functions.
Definition: SymbolContext.h:33
Containing protected virtual methods for child classes to override.
Definition: SymbolFile.h:436
Provides public interface for all SymbolFiles.
Definition: SymbolFile.h:47
std::vector< uint32_t > IndexCollection
Definition: Symtab.h:24
LanguageType
Programming language type.
uint64_t user_id_t
Definition: lldb-types.h:84