LLDB mainline
SymbolFileDWARFDwo.h
Go to the documentation of this file.
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"
14#include <optional>
15
16namespace lldb_private::plugin {
17namespace dwarf {
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
32 lldb::ObjectFileSP objfile, uint32_t id);
33
34 ~SymbolFileDWARFDwo() override = default;
35
37
38 void GetObjCMethods(
39 ConstString class_name,
40 llvm::function_ref<IterationAction(DWARFDIE die)> callback) override;
41
42 llvm::Expected<lldb::TypeSystemSP>
44
46 GetDIE(const DIERef &die_ref) override;
47
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 llvm::DataExtractor &opcodes,
55 lldb::offset_t &offset, RegisterContext *reg_ctx,
56 lldb::RegisterKind reg_kind,
57 std::vector<Value> &stack) const override;
58
60 const CompilerDeclContext &parent_decl_ctx,
61 uint32_t max_matches,
62 VariableList &variables) override;
63
65
67
68 bool GetDebugInfoIndexWasLoadedFromCache() const override;
70 bool GetDebugInfoIndexWasSavedToCache() const override;
72 bool GetDebugInfoHadFrameVariableErrors() const override;
74
75 SymbolFileDWARF *GetDIERefSymbolFile(const DIERef &die_ref) override;
76
77protected:
78 llvm::DenseMap<const DWARFDebugInfoEntry *, Type *> &GetDIEToType() override;
79
81
82 llvm::DenseMap<lldb::opaque_compiler_type_t, DIERef> &
84
86
87 DWARFDIE FindDefinitionDIE(const DWARFDIE &die) override;
88
91 ConstString type_name,
92 bool must_be_implementation) override;
93
94 /// If this file contains exactly one compile unit, this function will return
95 /// it. Otherwise it returns nullptr.
97
99};
100} // namespace dwarf
101} // namespace lldb_private::plugin
102
103#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARFDWO_H
Represents a generic declaration context in a program.
A uniqued constant string class.
Definition ConstString.h:40
An data extractor class.
virtual bool isA(const void *ClassID) const
LLVM RTTI support.
Definition SymbolFile.h:58
Identifies a DWARF debug info entry within a given Module.
Definition DIERef.h:31
SymbolFileDWARFDwo(SymbolFileDWARF &m_base_symbol_file, lldb::ObjectFileSP objfile, uint32_t id)
void GetObjCMethods(ConstString class_name, llvm::function_ref< IterationAction(DWARFDIE die)> callback) override
llvm::DenseMap< lldb::opaque_compiler_type_t, DIERef > & GetForwardDeclCompilerTypeToDIE() override
StatsDuration & GetDebugInfoParseTimeRef() override
The timer that parsing this file's debug info adds to.
bool GetDebugInfoIndexWasLoadedFromCache() const override
Accessors for the bool that indicates if the debug info index was loaded from, or saved to the module...
UniqueDWARFASTTypeMap & GetUniqueDWARFASTTypeMap() override
uint64_t GetDebugInfoSize(bool load_all_debug_info=false) override
Metrics gathering functions.
DWARFCompileUnit * FindSingleCompileUnit()
If this file contains exactly one compile unit, this function will return it.
DWARFDIE FindDefinitionDIE(const DWARFDIE &die) override
bool isA(const void *ClassID) const override
LLVM RTTI support.
lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE &die, ConstString type_name, bool must_be_implementation) override
static bool classof(const SymbolFile *obj)
bool ParseVendorDWARFOpcode(uint8_t op, const llvm::DataExtractor &opcodes, lldb::offset_t &offset, RegisterContext *reg_ctx, lldb::RegisterKind reg_kind, std::vector< Value > &stack) const override
llvm::Expected< lldb::TypeSystemSP > GetTypeSystemForLanguage(lldb::LanguageType language) override
void FindGlobalVariables(ConstString name, const CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, VariableList &variables) override
SymbolFileDWARF * GetDIERefSymbolFile(const DIERef &die_ref) override
Given a DIERef, find the correct SymbolFileDWARF.
bool GetDebugInfoHadFrameVariableErrors() const override
Accessors for the bool that indicates if there was debug info, but errors stopped variables from bein...
DWARFDIE GetDIE(const DIERef &die_ref) override
llvm::DenseMap< const DWARFDebugInfoEntry *, Type * > & GetDIEToType() override
DWARFCompileUnit * GetDWOCompileUnitForHash(uint64_t hash)
lldb::offset_t GetVendorDWARFOpcodeSize(const DataExtractor &data, const lldb::offset_t data_offset, const uint8_t op) const override
llvm::DenseMap< const DWARFDebugInfoEntry *, lldb::VariableSP > DIEToVariableSP
SymbolFileDWARF(lldb::ObjectFileSP objfile_sp, SectionList *dwo_section_list)
bool isA(const void *ClassID) const override
LLVM RTTI support.
IterationAction
Useful for callbacks whose return type indicates whether to continue iteration or short-circuit.
uint64_t offset_t
Definition lldb-types.h:86
std::shared_ptr< lldb_private::ObjectFile > ObjectFileSP
LanguageType
Programming language type.
std::shared_ptr< lldb_private::Type > TypeSP
RegisterKind
Register numbering types.