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
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
46
47 uint32_t CalculateAbilities() override;
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::SupportFileList &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
80 uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr,
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:
92 uint32_t CalculateNumCompileUnits() override;
93
94 lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
95
101};
102
103#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
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
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)
bool ParseSupportFiles(lldb_private::CompileUnit &comp_unit, lldb_private::SupportFileList &support_files) override
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:62
A class that describes a compilation unit.
Definition: CompileUnit.h:43
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:399
A list of support files for a CompileUnit.
Definition: FileSpecList.h:23
"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:34
Containing protected virtual methods for child classes to override.
Definition: SymbolFile.h:504
Provides public interface for all SymbolFiles.
Definition: SymbolFile.h:50
std::vector< uint32_t > IndexCollection
Definition: Symtab.h:24
std::shared_ptr< lldb_private::ObjectFile > ObjectFileSP
Definition: lldb-forward.h:373
LanguageType
Programming language type.
uint64_t user_id_t
Definition: lldb-types.h:82
std::shared_ptr< lldb_private::CompileUnit > CompUnitSP
Definition: lldb-forward.h:333