LLVM  9.0.0svn
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_DWARFDEBUGRNGLISTS_H
10 #define LLVM_DEBUGINFO_DWARFDEBUGRNGLISTS_H
11 
12 #include "llvm/ADT/Optional.h"
18 #include <cstdint>
19 #include <map>
20 #include <vector>
21 
22 namespace llvm {
23 
24 class Error;
25 class raw_ostream;
26 class DWARFUnit;
27 
28 /// A class representing a single range list entry.
30  /// The values making up the range list entry. Most represent a range with
31  /// a start and end address or a start address and a length. Others are
32  /// single value base addresses or end-of-list with no values. The unneeded
33  /// values are semantically undefined, but initialized to 0.
34  uint64_t Value0;
35  uint64_t Value1;
36 
38  void dump(raw_ostream &OS, uint8_t AddrSize, uint8_t MaxEncodingStringLength,
39  uint64_t &CurrentBase, DIDumpOptions DumpOpts,
41  LookupPooledAddress) const;
42  bool isSentinel() const { return EntryKind == dwarf::DW_RLE_end_of_list; }
43 };
44 
45 /// A class representing a single rangelist.
46 class DWARFDebugRnglist : public DWARFListType<RangeListEntry> {
47 public:
48  /// Build a DWARFAddressRangesVector from a rangelist.
50  getAbsoluteRanges(llvm::Optional<object::SectionedAddress> BaseAddr,
51  DWARFUnit &U) const;
52 };
53 
54 class DWARFDebugRnglistTable : public DWARFListTableBase<DWARFDebugRnglist> {
55 public:
57  : DWARFListTableBase(/* SectionName = */ ".debug_rnglists",
58  /* HeaderString = */ "ranges:",
59  /* ListTypeString = */ "range") {}
60 };
61 
62 } // end namespace llvm
63 
64 #endif // LLVM_DEBUGINFO_DWARFDEBUGRNGLISTS_H
uint64_t Value0
The values making up the range list entry.
This class represents lattice values for constants.
Definition: AllocatorList.h:23
An efficient, type-erasing, non-owning reference to a callable.
Definition: STLExtras.h:116
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_*).
Container for dump options that control which debug information will be dumped.
Definition: DIContext.h:157
A class representing a single rangelist.
A DataExtractor (typically for an in-memory copy of an object-file section) plus a relocation map for...
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
This file contains constants used for implementing Dwarf debug support.
std::vector< DWARFAddressRange > DWARFAddressRangesVector
DWARFAddressRangesVector - represents a set of absolute address ranges.
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:45
A class representing a single range list entry.
A base class for lists of entries that are extracted from a particular section, such as range lists o...
A class representing a table of lists as specified in the DWARF v5 standard for location lists and ra...
Error extract(DWARFDataExtractor Data, uint32_t End, uint32_t *OffsetPtr)