LLVM  16.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"
17 #include <cstdint>
18 
19 namespace llvm {
20 
21 class Error;
22 class raw_ostream;
23 class DWARFUnit;
24 class DWARFDataExtractor;
25 struct DIDumpOptions;
26 namespace object {
27 struct SectionedAddress;
28 }
29 
30 /// A class representing a single range list entry.
32  /// The values making up the range list entry. Most represent a range with
33  /// a start and end address or a start address and a length. Others are
34  /// single value base addresses or end-of-list with no values. The unneeded
35  /// values are semantically undefined, but initialized to 0.
38 
40  void dump(raw_ostream &OS, uint8_t AddrSize, uint8_t MaxEncodingStringLength,
41  uint64_t &CurrentBase, DIDumpOptions DumpOpts,
43  LookupPooledAddress) const;
44  bool isSentinel() const { return EntryKind == dwarf::DW_RLE_end_of_list; }
45 };
46 
47 /// A class representing a single rangelist.
48 class DWARFDebugRnglist : public DWARFListType<RangeListEntry> {
49 public:
50  /// Build a DWARFAddressRangesVector from a rangelist.
53  uint8_t AddressByteSize,
55  LookupPooledAddress) const;
56 
57  /// Build a DWARFAddressRangesVector from a rangelist.
60  DWARFUnit &U) const;
61 };
62 
63 class DWARFDebugRnglistTable : public DWARFListTableBase<DWARFDebugRnglist> {
64 public:
66  : DWARFListTableBase(/* SectionName = */ ".debug_rnglists",
67  /* HeaderString = */ "ranges:",
68  /* ListTypeString = */ "range") {}
69 };
70 
71 } // end namespace llvm
72 
73 #endif // LLVM_DEBUGINFO_DWARF_DWARFDEBUGRNGLISTS_H
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::lltok::Error
@ Error
Definition: LLToken.h:21
Optional.h
llvm::DWARFDebugRnglistTable::DWARFDebugRnglistTable
DWARFDebugRnglistTable()
Definition: DWARFDebugRnglists.h:65
llvm::DWARFListEntryBase::EntryKind
uint8_t EntryKind
The DWARF encoding (DW_RLE_* or DW_LLE_*).
Definition: DWARFListTable.h:30
llvm::RangeListEntry::isSentinel
bool isSentinel() const
Definition: DWARFDebugRnglists.h:44
llvm::DWARFListType
A base class for lists of entries that are extracted from a particular section, such as range lists o...
Definition: DWARFListTable.h:37
DWARFAddressRange.h
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:26
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
llvm::DWARFDebugRnglist
A class representing a single rangelist.
Definition: DWARFDebugRnglists.h:48
llvm::RangeListEntry
A class representing a single range list entry.
Definition: DWARFDebugRnglists.h:31
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:52
DWARFListTable.h
STLFunctionalExtras.h
llvm::function_ref
An efficient, type-erasing, non-owning reference to a callable.
Definition: STLFunctionalExtras.h:36
llvm::DWARFListTableBase
A class representing a table of lists as specified in the DWARF v5 standard for location lists and ra...
Definition: DWARFListTable.h:146
object
bar al al movzbl eax ret Missed when stored in a memory object
Definition: README.txt:1411
llvm::DWARFDebugRnglistTable
Definition: DWARFDebugRnglists.h:63
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
llvm::DWARFAddressRangesVector
std::vector< DWARFAddressRange > DWARFAddressRangesVector
DWARFAddressRangesVector - represents a set of absolute address ranges.
Definition: DWARFAddressRange.h:88
llvm::DWARFUnit
Definition: DWARFUnit.h:207
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:155
llvm::RangeListEntry::Value1
uint64_t Value1
Definition: DWARFDebugRnglists.h:37
llvm::RangeListEntry::Value0
uint64_t Value0
The values making up the range list entry.
Definition: DWARFDebugRnglists.h:36
llvm::DIDumpOptions
Container for dump options that control which debug information will be dumped.
Definition: DIContext.h:188