LLVM 19.0.0git
DWARFDebugRnglists.h
Go to the documentation of this file.
1//===- DWARFDebugRnglists.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_DWARFDEBUGRNGLISTS_H
10#define LLVM_DEBUGINFO_DWARF_DWARFDEBUGRNGLISTS_H
11
16#include <cstdint>
17
18namespace llvm {
19
20class Error;
21class raw_ostream;
22class DWARFUnit;
23class DWARFDataExtractor;
24struct DIDumpOptions;
25namespace object {
26struct SectionedAddress;
27}
28
29/// A class representing a single range list entry.
31 /// The values making up the range list entry. Most represent a range with
32 /// a start and end address or a start address and a length. Others are
33 /// single value base addresses or end-of-list with no values. The unneeded
34 /// values are semantically undefined, but initialized to 0.
37
39 void
40 dump(raw_ostream &OS, uint8_t AddrSize, uint8_t MaxEncodingStringLength,
41 uint64_t &CurrentBase, DIDumpOptions DumpOpts,
42 llvm::function_ref<std::optional<object::SectionedAddress>(uint32_t)>
43 LookupPooledAddress) const;
44 bool isSentinel() const { return EntryKind == dwarf::DW_RLE_end_of_list; }
45};
46
47/// A class representing a single rangelist.
48class DWARFDebugRnglist : public DWARFListType<RangeListEntry> {
49public:
50 /// Build a DWARFAddressRangesVector from a rangelist.
52 std::optional<object::SectionedAddress> BaseAddr, uint8_t AddressByteSize,
53 function_ref<std::optional<object::SectionedAddress>(uint32_t)>
54 LookupPooledAddress) const;
55
56 /// Build a DWARFAddressRangesVector from a rangelist.
58 getAbsoluteRanges(std::optional<object::SectionedAddress> BaseAddr,
59 DWARFUnit &U) const;
60};
61
62class DWARFDebugRnglistTable : public DWARFListTableBase<DWARFDebugRnglist> {
63public:
65 : DWARFListTableBase(/* SectionName = */ ".debug_rnglists",
66 /* HeaderString = */ "ranges:",
67 /* ListTypeString = */ "range") {}
68};
69
70} // end namespace llvm
71
72#endif // LLVM_DEBUGINFO_DWARF_DWARFDEBUGRNGLISTS_H
This file contains constants used for implementing Dwarf debug support.
loop extract
raw_pwrite_stream & OS
A DataExtractor (typically for an in-memory copy of an object-file section) plus a relocation map for...
A class representing a single rangelist.
DWARFAddressRangesVector getAbsoluteRanges(std::optional< object::SectionedAddress > BaseAddr, uint8_t AddressByteSize, function_ref< std::optional< object::SectionedAddress >(uint32_t)> LookupPooledAddress) const
Build a DWARFAddressRangesVector from a rangelist.
A class representing a table of lists as specified in the DWARF v5 standard for location lists and ra...
A base class for lists of entries that are extracted from a particular section, such as range lists o...
Lightweight error class with error context and mandatory checking.
Definition: Error.h:160
An efficient, type-erasing, non-owning reference to a callable.
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
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.
Container for dump options that control which debug information will be dumped.
Definition: DIContext.h:193
A base class for DWARF list entries, such as range or location list entries.
uint8_t EntryKind
The DWARF encoding (DW_RLE_* or DW_LLE_*).
A class representing a single range list entry.
void dump(raw_ostream &OS, uint8_t AddrSize, uint8_t MaxEncodingStringLength, uint64_t &CurrentBase, DIDumpOptions DumpOpts, llvm::function_ref< std::optional< object::SectionedAddress >(uint32_t)> LookupPooledAddress) const
uint64_t Value0
The values making up the range list entry.