1 //===-- SymbolFileJSON.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 LLDB_SOURCE_PLUGINS_SYMBOLFILE_JSON_SYMBOLFILEJSON_H
10 #define LLDB_SOURCE_PLUGINS_SYMBOLFILE_JSON_SYMBOLFILEJSON_H
16 #include "lldb/Symbol/CompileUnit.h"
17 #include "lldb/Symbol/SymbolFile.h"
19 namespace lldb_private
{
21 class SymbolFileJSON
: public lldb_private::SymbolFileCommon
{
22 /// LLVM RTTI support.
26 /// LLVM RTTI support.
28 bool isA(const void *ClassID
) const override
{
29 return ClassID
== &ID
|| SymbolFileCommon::isA(ClassID
);
31 static bool classof(const SymbolFile
*obj
) { return obj
->isA(&ID
); }
34 SymbolFileJSON(lldb::ObjectFileSP objfile_sp
);
36 static void Initialize();
38 static void Terminate();
40 static llvm::StringRef
GetPluginNameStatic() { return "JSON"; }
42 static llvm::StringRef
GetPluginDescriptionStatic();
44 static lldb_private::SymbolFile
*
45 CreateInstance(lldb::ObjectFileSP objfile_sp
);
47 llvm::StringRef
GetPluginName() override
{ return GetPluginNameStatic(); }
49 uint32_t CalculateAbilities() override
;
51 lldb::LanguageType
ParseLanguage(CompileUnit
&comp_unit
) override
{
52 return lldb::eLanguageTypeUnknown
;
55 size_t ParseFunctions(CompileUnit
&comp_unit
) override
{ return 0; }
57 bool ParseLineTable(CompileUnit
&comp_unit
) override
{ return false; }
59 bool ParseDebugMacros(CompileUnit
&comp_unit
) override
{ return false; }
61 bool ParseSupportFiles(CompileUnit
&comp_unit
,
62 SupportFileList
&support_files
) override
{
66 size_t ParseTypes(CompileUnit
&cu
) override
{ return 0; }
68 bool ParseImportedModules(
69 const SymbolContext
&sc
,
70 std::vector
<lldb_private::SourceModule
> &imported_modules
) override
{
74 size_t ParseBlocksRecursive(Function
&func
) override
{ return 0; }
76 size_t ParseVariablesForContext(const SymbolContext
&sc
) override
{
80 uint32_t CalculateNumCompileUnits() override
{ return 0; }
82 lldb::CompUnitSP
ParseCompileUnitAtIndex(uint32_t index
) override
;
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
{
91 bool CompleteType(CompilerType
&compiler_type
) override
{ return false; }
93 uint32_t ResolveSymbolContext(const lldb_private::Address
&so_addr
,
94 lldb::SymbolContextItem resolve_scope
,
95 lldb_private::SymbolContext
&sc
) override
;
97 void GetTypes(lldb_private::SymbolContextScope
*sc_scope
,
98 lldb::TypeClass type_mask
,
99 lldb_private::TypeList
&type_list
) override
;
101 void AddSymbols(Symtab
&symtab
) override
;
104 lldb::addr_t
GetBaseFileAddress();
106 std::vector
<std::pair
<uint64_t, std::string
>> m_symbols
;
108 } // namespace lldb_private
110 #endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_JSON_SYMBOLFILEJSON_H