LLVM  14.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 
12 #include "llvm/ADT/Optional.h"
13 #include "llvm/ADT/STLExtras.h"
19 #include <cstdint>
20 
21 namespace llvm {
22 
23 class Error;
24 class raw_ostream;
25 class DWARFUnit;
26 
27 /// A class representing a single range list entry.
29  /// The values making up the range list entry. Most represent a range with
30  /// a start and end address or a start address and a length. Others are
31  /// single value base addresses or end-of-list with no values. The unneeded
32  /// values are semantically undefined, but initialized to 0.
35 
37  void dump(raw_ostream &OS, uint8_t AddrSize, uint8_t MaxEncodingStringLength,
38  uint64_t &CurrentBase, DIDumpOptions DumpOpts,
40  LookupPooledAddress) const;
41  bool isSentinel() const { return EntryKind == dwarf::DW_RLE_end_of_list; }
42 };
43 
44 /// A class representing a single rangelist.
45 class DWARFDebugRnglist : public DWARFListType<RangeListEntry> {
46 public:
47  /// Build a DWARFAddressRangesVector from a rangelist.
50  uint8_t AddressByteSize,
52  LookupPooledAddress) const;
53 
54  /// Build a DWARFAddressRangesVector from a rangelist.
57  DWARFUnit &U) const;
58 };
59 
60 class DWARFDebugRnglistTable : public DWARFListTableBase<DWARFDebugRnglist> {
61 public:
63  : DWARFListTableBase(/* SectionName = */ ".debug_rnglists",
64  /* HeaderString = */ "ranges:",
65  /* ListTypeString = */ "range") {}
66 };
67 
68 } // end namespace llvm
69 
70 #endif // LLVM_DEBUGINFO_DWARF_DWARFDEBUGRNGLISTS_H
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::lltok::Error
@ Error
Definition: LLToken.h:21
Optional.h
llvm::DWARFDebugRnglistTable::DWARFDebugRnglistTable
DWARFDebugRnglistTable()
Definition: DWARFDebugRnglists.h:62
llvm::DWARFListEntryBase::EntryKind
uint8_t EntryKind
The DWARF encoding (DW_RLE_* or DW_LLE_*).
Definition: DWARFListTable.h:31
llvm::RangeListEntry::isSentinel
bool isSentinel() const
Definition: DWARFDebugRnglists.h:41
llvm::DWARFListType
A base class for lists of entries that are extracted from a particular section, such as range lists o...
Definition: DWARFListTable.h:38
llvm::Optional
Definition: APInt.h:33
llvm::DWARFListEntryBase
A base class for DWARF list entries, such as range or location list entries.
Definition: DWARFListTable.h:27
STLExtras.h
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::Data
@ Data
Definition: SIMachineScheduler.h:55
llvm::RangeListEntry::extract
Error extract(DWARFDataExtractor Data, uint64_t *OffsetPtr)
Definition: DWARFDebugRnglists.cpp:20
DWARFDebugRangeList.h
llvm::DWARFDebugRnglist
A class representing a single rangelist.
Definition: DWARFDebugRnglists.h:45
llvm::RangeListEntry
A class representing a single range list entry.
Definition: DWARFDebugRnglists.h:28
llvm::DWARFDebugRnglist::getAbsoluteRanges
DWARFAddressRangesVector getAbsoluteRanges(Optional< object::SectionedAddress > BaseAddr, uint8_t AddressByteSize, function_ref< Optional< object::SectionedAddress >(uint32_t)> LookupPooledAddress) const
Build a DWARFAddressRangesVector from a rangelist.
Definition: DWARFDebugRnglists.cpp:95
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
DWARFListTable.h
llvm::function_ref
An efficient, type-erasing, non-owning reference to a callable.
Definition: STLExtras.h:168
llvm::DWARFListTableBase
A class representing a table of lists as specified in the DWARF v5 standard for location lists and ra...
Definition: DWARFListTable.h:147
llvm::DWARFDebugRnglistTable
Definition: DWARFDebugRnglists.h:60
uint64_t
Dwarf.h
uint32_t
llvm::RangeListEntry::dump
void dump(raw_ostream &OS, uint8_t AddrSize, uint8_t MaxEncodingStringLength, uint64_t &CurrentBase, DIDumpOptions DumpOpts, llvm::function_ref< Optional< object::SectionedAddress >(uint32_t)> LookupPooledAddress) const
Definition: DWARFDebugRnglists.cpp:175
DIContext.h
llvm::DWARFAddressRangesVector
std::vector< DWARFAddressRange > DWARFAddressRangesVector
DWARFAddressRangesVector - represents a set of absolute address ranges.
Definition: DWARFAddressRange.h:83
llvm::DWARFUnit
Definition: DWARFUnit.h:203
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
llvm::RangeListEntry::Value1
uint64_t Value1
Definition: DWARFDebugRnglists.h:34
llvm::RangeListEntry::Value0
uint64_t Value0
The values making up the range list entry.
Definition: DWARFDebugRnglists.h:33
DWARFDataExtractor.h
llvm::DIDumpOptions
Container for dump options that control which debug information will be dumped.
Definition: DIContext.h:180