1 //===-- DWARFASTParser.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_DWARF_DWARFASTPARSER_H 10 #define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFASTPARSER_H 11 12 #include "DWARFDefines.h" 13 #include "lldb/Core/PluginInterface.h" 14 #include "lldb/Symbol/SymbolFile.h" 15 #include "lldb/Symbol/CompilerDecl.h" 16 #include "lldb/Symbol/CompilerDeclContext.h" 17 #include "lldb/lldb-enumerations.h" 18 #include <optional> 19 20 class DWARFDIE; 21 namespace lldb_private { 22 class CompileUnit; 23 class ExecutionContext; 24 } 25 class SymbolFileDWARF; 26 27 class DWARFASTParser { 28 public: 29 virtual ~DWARFASTParser() = default; 30 31 virtual lldb::TypeSP ParseTypeFromDWARF(const lldb_private::SymbolContext &sc, 32 const DWARFDIE &die, 33 bool *type_is_new_ptr) = 0; 34 35 virtual lldb_private::ConstString 36 ConstructDemangledNameFromDWARF(const DWARFDIE &die) = 0; 37 38 virtual lldb_private::Function * 39 ParseFunctionFromDWARF(lldb_private::CompileUnit &comp_unit, 40 const DWARFDIE &die, 41 const lldb_private::AddressRange &range) = 0; 42 43 virtual bool 44 CompleteTypeFromDWARF(const DWARFDIE &die, lldb_private::Type *type, 45 lldb_private::CompilerType &compiler_type) = 0; 46 47 virtual lldb_private::CompilerDecl 48 GetDeclForUIDFromDWARF(const DWARFDIE &die) = 0; 49 50 virtual lldb_private::CompilerDeclContext 51 GetDeclContextForUIDFromDWARF(const DWARFDIE &die) = 0; 52 53 virtual lldb_private::CompilerDeclContext 54 GetDeclContextContainingUIDFromDWARF(const DWARFDIE &die) = 0; 55 56 virtual void EnsureAllDIEsInDeclContextHaveBeenParsed( 57 lldb_private::CompilerDeclContext decl_context) = 0; 58 59 virtual lldb_private::ConstString 60 GetDIEClassTemplateParams(const DWARFDIE &die) = 0; 61 62 static std::optional<lldb_private::SymbolFile::ArrayInfo> 63 ParseChildArrayInfo(const DWARFDIE &parent_die, 64 const lldb_private::ExecutionContext *exe_ctx = nullptr); 65 66 static lldb::AccessType GetAccessTypeFromDWARF(uint32_t dwarf_accessibility); 67 }; 68 69 #endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFASTPARSER_H 70