LLVM
20.0.0git
include
llvm
DebugInfo
DWARF
DWARFDebugAranges.h
Go to the documentation of this file.
1
//===- DWARFDebugAranges.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 LLVM_DEBUGINFO_DWARF_DWARFDEBUGARANGES_H
10
#define LLVM_DEBUGINFO_DWARF_DWARFDEBUGARANGES_H
11
12
#include "
llvm/ADT/DenseSet.h
"
13
#include "
llvm/ADT/STLFunctionalExtras.h
"
14
#include <cstdint>
15
#include <vector>
16
17
namespace
llvm
{
18
class
DWARFDataExtractor;
19
class
Error
;
20
21
class
DWARFContext;
22
23
class
DWARFDebugAranges
{
24
public
:
25
void
generate
(
DWARFContext
*CTX);
26
uint64_t
findAddress
(
uint64_t
Address
)
const
;
27
28
private
:
29
void
clear();
30
void
extract
(
DWARFDataExtractor
DebugArangesData,
31
function_ref
<
void
(
Error
)> RecoverableErrorHandler,
32
function_ref
<
void
(
Error
)> WarningHandler);
33
34
/// Call appendRange multiple times and then call construct.
35
void
appendRange(
uint64_t
CUOffset,
uint64_t
LowPC,
uint64_t
HighPC);
36
void
construct();
37
38
struct
Range
{
39
explicit
Range
(
uint64_t
LowPC,
uint64_t
HighPC,
uint64_t
CUOffset)
40
: LowPC(LowPC),
Length
(HighPC - LowPC), CUOffset(CUOffset) {}
41
42
void
setHighPC(
uint64_t
HighPC) {
43
if
(HighPC == -1ULL || HighPC <= LowPC)
44
Length
= 0;
45
else
46
Length
= HighPC - LowPC;
47
}
48
49
uint64_t
HighPC()
const
{
50
if
(
Length
)
51
return
LowPC +
Length
;
52
return
-1ULL;
53
}
54
55
bool
operator<
(
const
Range
&other)
const
{
56
return
LowPC < other.LowPC;
57
}
58
59
uint64_t
LowPC;
/// Start of address range.
60
uint64_t
Length
;
/// End of address range (not including this address).
61
uint64_t
CUOffset;
/// Offset of the compile unit or die.
62
};
63
64
struct
RangeEndpoint {
65
uint64_t
Address;
66
uint64_t
CUOffset;
67
bool
IsRangeStart;
68
69
RangeEndpoint(
uint64_t
Address,
uint64_t
CUOffset,
bool
IsRangeStart)
70
: Address(Address), CUOffset(CUOffset), IsRangeStart(IsRangeStart) {}
71
72
bool
operator<
(
const
RangeEndpoint &
Other
)
const
{
73
return
Address <
Other
.Address;
74
}
75
};
76
77
using
RangeColl = std::vector<Range>;
78
using
RangeCollIterator = RangeColl::const_iterator;
79
80
std::vector<RangeEndpoint> Endpoints;
81
RangeColl Aranges;
82
DenseSet<uint64_t>
ParsedCUOffsets;
83
};
84
85
}
// end namespace llvm
86
87
#endif
// LLVM_DEBUGINFO_DWARF_DWARFDEBUGARANGES_H
DenseSet.h
This file defines the DenseSet and SmallDenseSet classes.
extract
loop extract
Definition:
LoopExtractor.cpp:92
Range
ConstantRange Range(APInt(BitWidth, Low), APInt(BitWidth, High))
STLFunctionalExtras.h
llvm::DWARFContext
DWARFContext This data structure is the top level entity that deals with dwarf debug information pars...
Definition:
DWARFContext.h:48
llvm::DWARFDataExtractor
A DataExtractor (typically for an in-memory copy of an object-file section) plus a relocation map for...
Definition:
DWARFDataExtractor.h:21
llvm::DWARFDebugAranges
Definition:
DWARFDebugAranges.h:23
llvm::DWARFDebugAranges::generate
void generate(DWARFContext *CTX)
Definition:
DWARFDebugAranges.cpp:47
llvm::DWARFDebugAranges::findAddress
uint64_t findAddress(uint64_t Address) const
Definition:
DWARFDebugAranges.cpp:124
llvm::DenseSet
Implements a dense probed hash-table based set.
Definition:
DenseSet.h:271
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition:
Error.h:160
llvm::function_ref
An efficient, type-erasing, non-owning reference to a callable.
Definition:
STLFunctionalExtras.h:36
uint64_t
llvm::lltok::Error
@ Error
Definition:
LLToken.h:21
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:
AddressRanges.h:18
llvm::Length
@ Length
Definition:
DWP.cpp:480
llvm::operator<
bool operator<(int64_t V1, const APSInt &V2)
Definition:
APSInt.h:361
llvm::IRMemLocation::Other
@ Other
Any other memory.
llvm::HighlightColor::Address
@ Address
Generated on Tue Nov 12 2024 11:44:46 for LLVM by
1.9.6