Path: blob/main/contrib/llvm-project/lldb/source/Plugins/SymbolFile/JSON/SymbolFileJSON.h
39644 views
//===-- SymbolFileJSON.h ----------------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLDB_SOURCE_PLUGINS_SYMBOLFILE_JSON_SYMBOLFILEJSON_H9#define LLDB_SOURCE_PLUGINS_SYMBOLFILE_JSON_SYMBOLFILEJSON_H1011#include <map>12#include <optional>13#include <vector>1415#include "lldb/Symbol/CompileUnit.h"16#include "lldb/Symbol/SymbolFile.h"1718namespace lldb_private {1920class SymbolFileJSON : public lldb_private::SymbolFileCommon {21/// LLVM RTTI support.22static char ID;2324public:25/// LLVM RTTI support.26/// \{27bool isA(const void *ClassID) const override {28return ClassID == &ID || SymbolFileCommon::isA(ClassID);29}30static bool classof(const SymbolFile *obj) { return obj->isA(&ID); }31/// \}3233SymbolFileJSON(lldb::ObjectFileSP objfile_sp);3435static void Initialize();3637static void Terminate();3839static llvm::StringRef GetPluginNameStatic() { return "JSON"; }4041static llvm::StringRef GetPluginDescriptionStatic();4243static lldb_private::SymbolFile *44CreateInstance(lldb::ObjectFileSP objfile_sp);4546llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }4748uint32_t CalculateAbilities() override;4950lldb::LanguageType ParseLanguage(CompileUnit &comp_unit) override {51return lldb::eLanguageTypeUnknown;52}5354size_t ParseFunctions(CompileUnit &comp_unit) override { return 0; }5556bool ParseLineTable(CompileUnit &comp_unit) override { return false; }5758bool ParseDebugMacros(CompileUnit &comp_unit) override { return false; }5960bool ParseSupportFiles(CompileUnit &comp_unit,61SupportFileList &support_files) override {62return false;63}6465size_t ParseTypes(CompileUnit &cu) override { return 0; }6667bool ParseImportedModules(68const SymbolContext &sc,69std::vector<lldb_private::SourceModule> &imported_modules) override {70return false;71}7273size_t ParseBlocksRecursive(Function &func) override { return 0; }7475size_t ParseVariablesForContext(const SymbolContext &sc) override {76return 0;77}7879uint32_t CalculateNumCompileUnits() override { return 0; }8081lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override;8283Type *ResolveTypeUID(lldb::user_id_t type_uid) override { return nullptr; }84std::optional<ArrayInfo> GetDynamicArrayInfoForUID(85lldb::user_id_t type_uid,86const lldb_private::ExecutionContext *exe_ctx) override {87return std::nullopt;88}8990bool CompleteType(CompilerType &compiler_type) override { return false; }9192uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr,93lldb::SymbolContextItem resolve_scope,94lldb_private::SymbolContext &sc) override;9596void GetTypes(lldb_private::SymbolContextScope *sc_scope,97lldb::TypeClass type_mask,98lldb_private::TypeList &type_list) override;99100void AddSymbols(Symtab &symtab) override;101102private:103lldb::addr_t GetBaseFileAddress();104105std::vector<std::pair<uint64_t, std::string>> m_symbols;106};107} // namespace lldb_private108109#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_JSON_SYMBOLFILEJSON_H110111112