LLVM 22.0.0git
DWARFDebugRangeList.h
Go to the documentation of this file.
1//===- DWARFDebugRangeList.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_DWARFDEBUGRANGELIST_H
10#define LLVM_DEBUGINFO_DWARF_DWARFDEBUGRANGELIST_H
11
14#include <cstdint>
15#include <vector>
16
17namespace llvm {
18
19class raw_ostream;
20class DWARFDataExtractor;
21namespace object {
22struct SectionedAddress;
23}
24
26public:
28 /// A beginning address offset. This address offset has the size of an
29 /// address and is relative to the applicable base address of the
30 /// compilation unit referencing this range list. It marks the beginning
31 /// of an address range.
33 /// An ending address offset. This address offset again has the size of
34 /// an address and is relative to the applicable base address of the
35 /// compilation unit referencing this range list. It marks the first
36 /// address past the end of the address range. The ending address must
37 /// be greater than or equal to the beginning address.
39 /// A section index this range belongs to.
41
42 /// The end of any given range list is marked by an end of list entry,
43 /// which consists of a 0 for the beginning address offset
44 /// and a 0 for the ending address offset.
45 bool isEndOfListEntry() const {
46 return (StartAddress == 0) && (EndAddress == 0);
47 }
48
49 /// A base address selection entry consists of:
50 /// 1. The value of the largest representable address offset
51 /// (for example, 0xffffffff when the size of an address is 32 bits).
52 /// 2. An address, which defines the appropriate base address for
53 /// use in interpreting the beginning and ending address offsets of
54 /// subsequent entries of the location list.
55 LLVM_ABI bool isBaseAddressSelectionEntry(uint8_t AddressSize) const;
56 };
57
58private:
59 /// Offset in .debug_ranges section.
60 uint64_t Offset;
61 uint8_t AddressSize;
62 std::vector<RangeListEntry> Entries;
63
64public:
66
67 LLVM_ABI void clear();
68 LLVM_ABI void dump(raw_ostream &OS) const;
70 const std::vector<RangeListEntry> &getEntries() { return Entries; }
71
72 /// getAbsoluteRanges - Returns absolute address ranges defined by this range
73 /// list. Has to be passed base address of the compile unit referencing this
74 /// range list.
76 getAbsoluteRanges(std::optional<object::SectionedAddress> BaseAddr) const;
77};
78
79} // end namespace llvm
80
81#endif // LLVM_DEBUGINFO_DWARF_DWARFDEBUGRANGELIST_H
#define LLVM_ABI
Definition: Compiler.h:213
loop extract
raw_pwrite_stream & OS
static Split data
A DWARFDataExtractor (typically for an in-memory copy of an object-file section) plus a relocation ma...
LLVM_ABI DWARFAddressRangesVector getAbsoluteRanges(std::optional< object::SectionedAddress > BaseAddr) const
getAbsoluteRanges - Returns absolute address ranges defined by this range list.
LLVM_ABI void dump(raw_ostream &OS) const
const std::vector< RangeListEntry > & getEntries()
Lightweight error class with error context and mandatory checking.
Definition: Error.h:159
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
std::vector< DWARFAddressRange > DWARFAddressRangesVector
DWARFAddressRangesVector - represents a set of absolute address ranges.
uint64_t SectionIndex
A section index this range belongs to.
bool isEndOfListEntry() const
The end of any given range list is marked by an end of list entry, which consists of a 0 for the begi...
LLVM_ABI bool isBaseAddressSelectionEntry(uint8_t AddressSize) const
A base address selection entry consists of:
uint64_t EndAddress
An ending address offset.
uint64_t StartAddress
A beginning address offset.