LLDB mainline
SymbolFileJSON.h
Go to the documentation of this file.
1//===-- SymbolFileJSON.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_JSON_SYMBOLFILEJSON_H
10#define LLDB_SOURCE_PLUGINS_SYMBOLFILE_JSON_SYMBOLFILEJSON_H
11
12#include <map>
13#include <optional>
14#include <vector>
15
18
19namespace lldb_private {
20
22 /// LLVM RTTI support.
23 static char ID;
24
25public:
26 /// LLVM RTTI support.
27 /// \{
28 bool isA(const void *ClassID) const override {
29 return ClassID == &ID || SymbolFileCommon::isA(ClassID);
30 }
31 static bool classof(const SymbolFile *obj) { return obj->isA(&ID); }
32 /// \}
33
35
36 static void Initialize();
37
38 static void Terminate();
39
40 static llvm::StringRef GetPluginNameStatic() { return "JSON"; }
41
42 static llvm::StringRef GetPluginDescriptionStatic();
43
46
47 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
48
49 uint32_t CalculateAbilities() override;
50
53 }
54
55 size_t ParseFunctions(CompileUnit &comp_unit) override { return 0; }
56
57 bool ParseLineTable(CompileUnit &comp_unit) override { return false; }
58
59 bool ParseDebugMacros(CompileUnit &comp_unit) override { return false; }
60
62 SupportFileList &support_files) override {
63 return false;
64 }
65
66 size_t ParseTypes(CompileUnit &cu) override { return 0; }
67
69 const SymbolContext &sc,
70 std::vector<lldb_private::SourceModule> &imported_modules) override {
71 return false;
72 }
73
74 size_t ParseBlocksRecursive(Function &func) override { return 0; }
75
76 size_t ParseVariablesForContext(const SymbolContext &sc) override {
77 return 0;
78 }
79
80 uint32_t CalculateNumCompileUnits() override { return 0; }
81
82 lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;
83
84 Type *ResolveTypeUID(lldb::user_id_t type_uid) override { return nullptr; }
85 std::optional<ArrayInfo> GetDynamicArrayInfoForUID(
86 lldb::user_id_t type_uid,
87 const lldb_private::ExecutionContext *exe_ctx) override {
88 return std::nullopt;
89 }
90
91 bool CompleteType(CompilerType &compiler_type) override { return false; }
92
93 uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr,
94 lldb::SymbolContextItem resolve_scope,
95 lldb_private::SymbolContext &sc) override;
96
98 lldb::TypeClass type_mask,
99 lldb_private::TypeList &type_list) override;
100
101 void AddSymbols(Symtab &symtab) override;
102
103private:
105
106 std::vector<std::pair<uint64_t, std::string>> m_symbols;
107};
108} // namespace lldb_private
109
110#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_JSON_SYMBOLFILEJSON_H
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:507
bool isA(const void *ClassID) const override
LLVM RTTI support.
Definition: SymbolFile.h:514
llvm::StringRef GetPluginName() override
static char ID
LLVM RTTI support.
bool CompleteType(CompilerType &compiler_type) override
size_t ParseVariablesForContext(const SymbolContext &sc) override
size_t ParseTypes(CompileUnit &cu) override
uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr, lldb::SymbolContextItem resolve_scope, lldb_private::SymbolContext &sc) override
bool ParseDebugMacros(CompileUnit &comp_unit) override
void AddSymbols(Symtab &symtab) override
bool isA(const void *ClassID) const override
LLVM RTTI support.
uint32_t CalculateNumCompileUnits() override
static llvm::StringRef GetPluginNameStatic()
Type * ResolveTypeUID(lldb::user_id_t type_uid) 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.
static bool classof(const SymbolFile *obj)
void GetTypes(lldb_private::SymbolContextScope *sc_scope, lldb::TypeClass type_mask, lldb_private::TypeList &type_list) override
uint32_t CalculateAbilities() override
bool ParseSupportFiles(CompileUnit &comp_unit, SupportFileList &support_files) override
bool ParseImportedModules(const SymbolContext &sc, std::vector< lldb_private::SourceModule > &imported_modules) override
size_t ParseFunctions(CompileUnit &comp_unit) override
size_t ParseBlocksRecursive(Function &func) override
bool ParseLineTable(CompileUnit &comp_unit) override
lldb::LanguageType ParseLanguage(CompileUnit &comp_unit) override
lldb::addr_t GetBaseFileAddress()
static llvm::StringRef GetPluginDescriptionStatic()
static lldb_private::SymbolFile * CreateInstance(lldb::ObjectFileSP objfile_sp)
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override
std::vector< std::pair< uint64_t, std::string > > m_symbols
Provides public interface for all SymbolFiles.
Definition: SymbolFile.h:50
virtual bool isA(const void *ClassID) const
LLVM RTTI support.
Definition: SymbolFile.h:57
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ObjectFile > ObjectFileSP
Definition: lldb-forward.h:375
LanguageType
Programming language type.
@ eLanguageTypeUnknown
Unknown or invalid language value.
uint64_t user_id_t
Definition: lldb-types.h:82
uint64_t addr_t
Definition: lldb-types.h:80
std::shared_ptr< lldb_private::CompileUnit > CompUnitSP
Definition: lldb-forward.h:335