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

source code of lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h