LLDB
mainline
llvm-project
lldb
source
Plugins
SymbolFile
DWARF
DWARFDebugInfo.h
Go to the documentation of this file.
1
//===-- DWARFDebugInfo.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_DWARFDEBUGINFO_H
10
#define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGINFO_H
11
12
#include <map>
13
#include <vector>
14
15
#include "
DWARFDIE.h
"
16
#include "
DWARFTypeUnit.h
"
17
#include "
DWARFUnit.h
"
18
#include "
SymbolFileDWARF.h
"
19
#include "
lldb/lldb-private.h
"
20
#include "llvm/Support/Error.h"
21
22
namespace
lldb_private::plugin
{
23
namespace
dwarf
{
24
class
DWARFContext;
25
26
class
DWARFDebugInfo
{
27
public
:
28
typedef
dw_offset_t
(*
Callback
)(
SymbolFileDWARF
*dwarf2Data,
DWARFUnit
*cu,
29
DWARFDebugInfoEntry
*die,
30
const
dw_offset_t
next_offset,
31
const
uint32_t depth,
void
*userData);
32
33
explicit
DWARFDebugInfo
(
SymbolFileDWARF
&
dwarf
,
DWARFContext
&context);
34
35
size_t
GetNumUnits
();
36
DWARFUnit
*
GetUnitAtIndex
(
size_t
idx);
37
DWARFUnit
*
GetUnitAtOffset
(
DIERef::Section
section,
dw_offset_t
cu_offset,
38
uint32_t *idx_ptr =
nullptr
);
39
DWARFUnit
*
GetUnitContainingDIEOffset
(
DIERef::Section
section,
40
dw_offset_t
die_offset);
41
DWARFUnit
*
GetUnit
(
const
DIERef
&die_ref);
42
DWARFTypeUnit
*
GetTypeUnitForHash
(uint64_t hash);
43
bool
ContainsTypeUnits
();
44
DWARFDIE
GetDIE
(
const
DIERef
&die_ref);
45
46
enum
{
47
eDumpFlag_Verbose
= (1 << 0),
// Verbose dumping
48
eDumpFlag_ShowForm
= (1 << 1),
// Show the DW_form type
49
eDumpFlag_ShowAncestors
=
50
(1 << 2)
// Show all parent DIEs when dumping single DIEs
51
};
52
53
const
DWARFDebugAranges
&
GetCompileUnitAranges
();
54
55
protected
:
56
typedef
std::vector<DWARFUnitSP>
UnitColl
;
57
58
SymbolFileDWARF
&
m_dwarf
;
59
DWARFContext
&
m_context
;
60
61
llvm::once_flag
m_units_once_flag
;
62
UnitColl
m_units
;
63
64
std::unique_ptr<DWARFDebugAranges>
65
m_cu_aranges_up
;
// A quick address to compile unit table
66
67
std::vector<std::pair<uint64_t, uint32_t>>
m_type_hash_to_unit_index
;
68
69
private
:
70
// All parsing needs to be done partially any managed by this class as
71
// accessors are called.
72
void
ParseUnitHeadersIfNeeded
();
73
74
void
ParseUnitsFor
(
DIERef::Section
section);
75
76
uint32_t
FindUnitIndex
(
DIERef::Section
section,
dw_offset_t
offset);
77
78
DWARFDebugInfo
(
const
DWARFDebugInfo
&) =
delete
;
79
const
DWARFDebugInfo
&
operator=
(
const
DWARFDebugInfo
&) =
delete
;
80
};
81
}
// namespace dwarf
82
}
// namespace lldb_private::plugin
83
84
#endif
// LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGINFO_H
DWARFDIE.h
DWARFTypeUnit.h
DWARFUnit.h
SymbolFileDWARF.h
lldb_private::plugin::dwarf::DIERef
Identifies a DWARF debug info entry within a given Module.
Definition:
DIERef.h:30
lldb_private::plugin::dwarf::DIERef::Section
Section
Definition:
DIERef.h:32
lldb_private::plugin::dwarf::DWARFContext
Definition:
DWARFContext.h:21
lldb_private::plugin::dwarf::DWARFDIE
Definition:
DWARFDIE.h:18
lldb_private::plugin::dwarf::DWARFDebugAranges
Definition:
DWARFDebugAranges.h:18
lldb_private::plugin::dwarf::DWARFDebugInfoEntry
DWARFDebugInfoEntry objects assume that they are living in one big vector and do pointer arithmetic o...
Definition:
DWARFDebugInfoEntry.h:35
lldb_private::plugin::dwarf::DWARFDebugInfo
Definition:
DWARFDebugInfo.h:26
lldb_private::plugin::dwarf::DWARFDebugInfo::ContainsTypeUnits
bool ContainsTypeUnits()
Definition:
DWARFDebugInfo.cpp:179
lldb_private::plugin::dwarf::DWARFDebugInfo::m_dwarf
SymbolFileDWARF & m_dwarf
Definition:
DWARFDebugInfo.h:58
lldb_private::plugin::dwarf::DWARFDebugInfo::GetTypeUnitForHash
DWARFTypeUnit * GetTypeUnitForHash(uint64_t hash)
Definition:
DWARFDebugInfo.cpp:171
lldb_private::plugin::dwarf::DWARFDebugInfo::GetUnitAtOffset
DWARFUnit * GetUnitAtOffset(DIERef::Section section, dw_offset_t cu_offset, uint32_t *idx_ptr=nullptr)
Definition:
DWARFDebugInfo.cpp:143
lldb_private::plugin::dwarf::DWARFDebugInfo::FindUnitIndex
uint32_t FindUnitIndex(DIERef::Section section, dw_offset_t offset)
Definition:
DWARFDebugInfo.cpp:125
lldb_private::plugin::dwarf::DWARFDebugInfo::eDumpFlag_ShowForm
@ eDumpFlag_ShowForm
Definition:
DWARFDebugInfo.h:48
lldb_private::plugin::dwarf::DWARFDebugInfo::eDumpFlag_Verbose
@ eDumpFlag_Verbose
Definition:
DWARFDebugInfo.h:47
lldb_private::plugin::dwarf::DWARFDebugInfo::eDumpFlag_ShowAncestors
@ eDumpFlag_ShowAncestors
Definition:
DWARFDebugInfo.h:49
lldb_private::plugin::dwarf::DWARFDebugInfo::GetCompileUnitAranges
const DWARFDebugAranges & GetCompileUnitAranges()
Definition:
DWARFDebugInfo.cpp:36
lldb_private::plugin::dwarf::DWARFDebugInfo::ParseUnitsFor
void ParseUnitsFor(DIERef::Section section)
Definition:
DWARFDebugInfo.cpp:78
lldb_private::plugin::dwarf::DWARFDebugInfo::m_units
UnitColl m_units
Definition:
DWARFDebugInfo.h:62
lldb_private::plugin::dwarf::DWARFDebugInfo::m_units_once_flag
llvm::once_flag m_units_once_flag
Definition:
DWARFDebugInfo.h:61
lldb_private::plugin::dwarf::DWARFDebugInfo::m_type_hash_to_unit_index
std::vector< std::pair< uint64_t, uint32_t > > m_type_hash_to_unit_index
Definition:
DWARFDebugInfo.h:67
lldb_private::plugin::dwarf::DWARFDebugInfo::ParseUnitHeadersIfNeeded
void ParseUnitHeadersIfNeeded()
Definition:
DWARFDebugInfo.cpp:105
lldb_private::plugin::dwarf::DWARFDebugInfo::UnitColl
std::vector< DWARFUnitSP > UnitColl
Definition:
DWARFDebugInfo.h:56
lldb_private::plugin::dwarf::DWARFDebugInfo::operator=
const DWARFDebugInfo & operator=(const DWARFDebugInfo &)=delete
lldb_private::plugin::dwarf::DWARFDebugInfo::GetDIE
DWARFDIE GetDIE(const DIERef &die_ref)
Definition:
DWARFDebugInfo.cpp:188
lldb_private::plugin::dwarf::DWARFDebugInfo::m_cu_aranges_up
std::unique_ptr< DWARFDebugAranges > m_cu_aranges_up
Definition:
DWARFDebugInfo.h:65
lldb_private::plugin::dwarf::DWARFDebugInfo::m_context
DWARFContext & m_context
Definition:
DWARFDebugInfo.h:59
lldb_private::plugin::dwarf::DWARFDebugInfo::GetUnitContainingDIEOffset
DWARFUnit * GetUnitContainingDIEOffset(DIERef::Section section, dw_offset_t die_offset)
Definition:
DWARFDebugInfo.cpp:162
lldb_private::plugin::dwarf::DWARFDebugInfo::GetUnitAtIndex
DWARFUnit * GetUnitAtIndex(size_t idx)
Definition:
DWARFDebugInfo.cpp:118
lldb_private::plugin::dwarf::DWARFDebugInfo::Callback
dw_offset_t(* Callback)(SymbolFileDWARF *dwarf2Data, DWARFUnit *cu, DWARFDebugInfoEntry *die, const dw_offset_t next_offset, const uint32_t depth, void *userData)
Definition:
DWARFDebugInfo.h:28
lldb_private::plugin::dwarf::DWARFDebugInfo::DWARFDebugInfo
DWARFDebugInfo(const DWARFDebugInfo &)=delete
lldb_private::plugin::dwarf::DWARFDebugInfo::GetUnit
DWARFUnit * GetUnit(const DIERef &die_ref)
Definition:
DWARFDebugInfo.cpp:157
lldb_private::plugin::dwarf::DWARFDebugInfo::GetNumUnits
size_t GetNumUnits()
Definition:
DWARFDebugInfo.cpp:113
lldb_private::plugin::dwarf::DWARFTypeUnit
Definition:
DWARFTypeUnit.h:21
lldb_private::plugin::dwarf::DWARFUnit
Definition:
DWARFUnit.h:89
lldb_private::plugin::dwarf::SymbolFileDWARF
Definition:
SymbolFileDWARF.h:67
dw_offset_t
uint64_t dw_offset_t
Definition:
dwarf.h:31
lldb-private.h
dwarf
Definition:
ABISysV_arc.cpp:61
lldb_private::plugin
Definition:
DWARFExpression.h:23
Generated on Thu Dec 7 2023 15:34:41 for LLDB by
1.9.6