1 //===- DWARFDebugRnglists.h -------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_DEBUGINFO_DWARFDEBUGRNGLISTS_H
11 #define LLVM_DEBUGINFO_DWARFDEBUGRNGLISTS_H
13 #include "llvm/BinaryFormat/Dwarf.h"
14 #include "llvm/DebugInfo/DIContext.h"
15 #include "llvm/DebugInfo/DWARF/DWARFDataExtractor.h"
16 #include "llvm/DebugInfo/DWARF/DWARFDebugRangeList.h"
17 #include "llvm/DebugInfo/DWARF/DWARFListTable.h"
27 /// A class representing a single range list entry.
28 struct RangeListEntry : public DWARFListEntryBase {
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.
36 Error extract(DWARFDataExtractor Data, uint32_t End, uint32_t *OffsetPtr);
37 void dump(raw_ostream &OS, uint8_t AddrSize, uint8_t MaxEncodingStringLength,
38 uint64_t &CurrentBase, DIDumpOptions DumpOpts) const;
39 bool isSentinel() const { return EntryKind == dwarf::DW_RLE_end_of_list; }
42 /// A class representing a single rangelist.
43 class DWARFDebugRnglist : public DWARFListType<RangeListEntry> {
45 /// Build a DWARFAddressRangesVector from a rangelist.
46 DWARFAddressRangesVector
47 getAbsoluteRanges(llvm::Optional<BaseAddress> BaseAddr) const;
50 class DWARFDebugRnglistTable : public DWARFListTableBase<DWARFDebugRnglist> {
52 DWARFDebugRnglistTable()
53 : DWARFListTableBase(/* SectionName = */ ".debug_rnglists",
54 /* HeaderString = */ "ranges:",
55 /* ListTypeString = */ "range") {}
58 } // end namespace llvm
60 #endif // LLVM_DEBUGINFO_DWARFDEBUGRNGLISTS_H