brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.6 KiB · d906e09 Raw
102 lines · c
1//===-- SymbolFileDWARFDwo.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-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARFDWO_H10#define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARFDWO_H11 12#include "SymbolFileDWARF.h"13#include "lldb/lldb-private-enumerations.h"14#include <optional>15 16namespace lldb_private::plugin {17namespace dwarf {18class SymbolFileDWARFDwo : public SymbolFileDWARF {19  /// LLVM RTTI support.20  static char ID;21 22public:23  /// LLVM RTTI support.24  /// \{25  bool isA(const void *ClassID) const override {26    return ClassID == &ID || SymbolFileDWARF::isA(ClassID);27  }28  static bool classof(const SymbolFile *obj) { return obj->isA(&ID); }29  /// \}30 31  SymbolFileDWARFDwo(SymbolFileDWARF &m_base_symbol_file,32                     lldb::ObjectFileSP objfile, uint32_t id);33 34  ~SymbolFileDWARFDwo() override = default;35 36  DWARFCompileUnit *GetDWOCompileUnitForHash(uint64_t hash);37 38  void GetObjCMethods(39      ConstString class_name,40      llvm::function_ref<IterationAction(DWARFDIE die)> callback) override;41 42  llvm::Expected<lldb::TypeSystemSP>43  GetTypeSystemForLanguage(lldb::LanguageType language) override;44 45  DWARFDIE46  GetDIE(const DIERef &die_ref) override;47 48  lldb::offset_t GetVendorDWARFOpcodeSize(const DataExtractor &data,49                                          const lldb::offset_t data_offset,50                                          const uint8_t op) const override;51 52  uint64_t GetDebugInfoSize(bool load_all_debug_info = false) override;53 54  bool ParseVendorDWARFOpcode(uint8_t op, const DataExtractor &opcodes,55                              lldb::offset_t &offset, RegisterContext *reg_ctx,56                              lldb::RegisterKind reg_kind,57                              std::vector<Value> &stack) const override;58 59  void FindGlobalVariables(ConstString name,60                           const CompilerDeclContext &parent_decl_ctx,61                           uint32_t max_matches,62                           VariableList &variables) override;63 64  SymbolFileDWARF &GetBaseSymbolFile() const { return m_base_symbol_file; }65 66  bool GetDebugInfoIndexWasLoadedFromCache() const override;67  void SetDebugInfoIndexWasLoadedFromCache() override;68  bool GetDebugInfoIndexWasSavedToCache() const override;69  void SetDebugInfoIndexWasSavedToCache() override;70  bool GetDebugInfoHadFrameVariableErrors() const override;71  void SetDebugInfoHadFrameVariableErrors() override;72 73  SymbolFileDWARF *GetDIERefSymbolFile(const DIERef &die_ref) override;74 75protected:76  llvm::DenseMap<const DWARFDebugInfoEntry *, Type *> &GetDIEToType() override;77 78  DIEToVariableSP &GetDIEToVariable() override;79 80  llvm::DenseMap<lldb::opaque_compiler_type_t, DIERef> &81  GetForwardDeclCompilerTypeToDIE() override;82 83  UniqueDWARFASTTypeMap &GetUniqueDWARFASTTypeMap() override;84 85  DWARFDIE FindDefinitionDIE(const DWARFDIE &die) override;86 87  lldb::TypeSP88  FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE &die,89                                       ConstString type_name,90                                       bool must_be_implementation) override;91 92  /// If this file contains exactly one compile unit, this function will return93  /// it. Otherwise it returns nullptr.94  DWARFCompileUnit *FindSingleCompileUnit();95 96  SymbolFileDWARF &m_base_symbol_file;97};98} // namespace dwarf99} // namespace lldb_private::plugin100 101#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARFDWO_H102