diff options
Diffstat (limited to 'include/lldb/Symbol/SymbolFile.h')
-rw-r--r-- | include/lldb/Symbol/SymbolFile.h | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/include/lldb/Symbol/SymbolFile.h b/include/lldb/Symbol/SymbolFile.h index 433c20da99e2..dbb723e9d369 100644 --- a/include/lldb/Symbol/SymbolFile.h +++ b/include/lldb/Symbol/SymbolFile.h @@ -1,9 +1,8 @@ //===-- SymbolFile.h --------------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -15,6 +14,7 @@ #include "lldb/Symbol/CompilerDeclContext.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/Function.h" +#include "lldb/Symbol/SourceModule.h" #include "lldb/Symbol/Type.h" #include "lldb/lldb-private.h" @@ -32,14 +32,12 @@ namespace lldb_private { class SymbolFile : public PluginInterface { public: - //------------------------------------------------------------------ // Symbol file ability bits. // // Each symbol file can claim to support one or more symbol file abilities. // These get returned from SymbolFile::GetAbilities(). These help us to // determine which plug-in will be best to load the debug information found // in files. - //------------------------------------------------------------------ enum Abilities { CompileUnits = (1u << 0), LineTables = (1u << 1), @@ -53,15 +51,12 @@ public: static SymbolFile *FindPlugin(ObjectFile *obj_file); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolFile(ObjectFile *obj_file) : m_obj_file(obj_file), m_abilities(0), m_calculated_abilities(false) {} ~SymbolFile() override {} - //------------------------------------------------------------------ /// Get a mask of what this symbol file supports for the object file /// that it was constructed with. /// @@ -85,11 +80,10 @@ public: /// for "void SymbolFile::InitializeObject()" which will get called /// on the SymbolFile object with the best set of abilities. /// - /// @return + /// \return /// A uint32_t mask containing bits from the SymbolFile::Abilities /// enumeration. Any bits that are set represent an ability that /// this symbol plug-in can parse from the object file. - ///------------------------------------------------------------------ uint32_t GetAbilities() { if (!m_calculated_abilities) { m_abilities = CalculateAbilities(); @@ -101,13 +95,10 @@ public: virtual uint32_t CalculateAbilities() = 0; - //------------------------------------------------------------------ /// Symbols file subclasses should override this to return the Module that /// owns the TypeSystem that this symbol file modifies type information in. - //------------------------------------------------------------------ virtual std::recursive_mutex &GetModuleMutex() const; - //------------------------------------------------------------------ /// Initialize the SymbolFile object. /// /// The SymbolFile object with the best set of abilities (detected @@ -115,12 +106,9 @@ public: /// called if it is chosen to parse an object file. More complete /// initialization can happen in this function which will get called /// prior to any other functions in the SymbolFile protocol. - //------------------------------------------------------------------ virtual void InitializeObject() {} - //------------------------------------------------------------------ // Compile Unit function calls - //------------------------------------------------------------------ // Approach 1 - iterator virtual uint32_t GetNumCompileUnits() = 0; virtual lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) = 0; @@ -136,7 +124,7 @@ public: virtual bool ParseImportedModules(const SymbolContext &sc, - std::vector<ConstString> &imported_modules) = 0; + std::vector<SourceModule> &imported_modules) = 0; virtual size_t ParseBlocksRecursive(Function &func) = 0; virtual size_t ParseVariablesForContext(const SymbolContext &sc) = 0; virtual Type *ResolveTypeUID(lldb::user_id_t type_uid) = 0; @@ -144,10 +132,10 @@ public: /// The characteristics of an array type. struct ArrayInfo { - int64_t first_index; + int64_t first_index = 0; llvm::SmallVector<uint64_t, 1> element_orders; - uint32_t byte_stride; - uint32_t bit_stride; + uint32_t byte_stride = 0; + uint32_t bit_stride = 0; }; /// If \c type_uid points to an array type, return its characteristics. /// To support variable-length array types, this function takes an @@ -178,13 +166,13 @@ public: virtual void DumpClangAST(Stream &s) {} virtual uint32_t - FindGlobalVariables(const ConstString &name, + FindGlobalVariables(ConstString name, const CompilerDeclContext *parent_decl_ctx, uint32_t max_matches, VariableList &variables); virtual uint32_t FindGlobalVariables(const RegularExpression ®ex, uint32_t max_matches, VariableList &variables); - virtual uint32_t FindFunctions(const ConstString &name, + virtual uint32_t FindFunctions(ConstString name, const CompilerDeclContext *parent_decl_ctx, lldb::FunctionNameType name_type_mask, bool include_inlines, bool append, @@ -193,7 +181,7 @@ public: bool include_inlines, bool append, SymbolContextList &sc_list); virtual uint32_t - FindTypes(const ConstString &name, const CompilerDeclContext *parent_decl_ctx, + FindTypes(ConstString name, const CompilerDeclContext *parent_decl_ctx, bool append, uint32_t max_matches, llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, TypeMap &types); @@ -217,7 +205,7 @@ public: GetTypeSystemForLanguage(lldb::LanguageType language); virtual CompilerDeclContext - FindNamespace(const ConstString &name, + FindNamespace(ConstString name, const CompilerDeclContext *parent_decl_ctx) { return CompilerDeclContext(); } @@ -231,12 +219,22 @@ public: virtual void AddSymbols(Symtab &symtab) {} - //------------------------------------------------------------------ /// Notify the SymbolFile that the file addresses in the Sections /// for this module have been changed. - //------------------------------------------------------------------ virtual void SectionFileAddressesChanged() {} + struct RegisterInfoResolver { + virtual ~RegisterInfoResolver(); // anchor + + virtual const RegisterInfo *ResolveName(llvm::StringRef name) const = 0; + virtual const RegisterInfo *ResolveNumber(lldb::RegisterKind kind, + uint32_t number) const = 0; + }; + virtual lldb::UnwindPlanSP + GetUnwindPlan(const Address &address, const RegisterInfoResolver &resolver) { + return nullptr; + } + virtual void Dump(Stream &s) {} protected: |