1 //===- DWARFDebugRnglists.h -------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_DEBUGINFO_DWARFDEBUGRNGLISTS_H
10 #define LLVM_DEBUGINFO_DWARFDEBUGRNGLISTS_H
12 #include "llvm/ADT/Optional.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"
28 /// A class representing a single range list entry.
29 struct RangeListEntry
: public DWARFListEntryBase
{
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.
37 Error
extract(DWARFDataExtractor Data
, uint64_t End
, uint64_t *OffsetPtr
);
38 void dump(raw_ostream
&OS
, uint8_t AddrSize
, uint8_t MaxEncodingStringLength
,
39 uint64_t &CurrentBase
, DIDumpOptions DumpOpts
,
40 llvm::function_ref
<Optional
<object::SectionedAddress
>(uint32_t)>
41 LookupPooledAddress
) const;
42 bool isSentinel() const { return EntryKind
== dwarf::DW_RLE_end_of_list
; }
45 /// A class representing a single rangelist.
46 class DWARFDebugRnglist
: public DWARFListType
<RangeListEntry
> {
48 /// Build a DWARFAddressRangesVector from a rangelist.
49 DWARFAddressRangesVector
50 getAbsoluteRanges(llvm::Optional
<object::SectionedAddress
> BaseAddr
,
54 class DWARFDebugRnglistTable
: public DWARFListTableBase
<DWARFDebugRnglist
> {
56 DWARFDebugRnglistTable()
57 : DWARFListTableBase(/* SectionName = */ ".debug_rnglists",
58 /* HeaderString = */ "ranges:",
59 /* ListTypeString = */ "range") {}
62 } // end namespace llvm
64 #endif // LLVM_DEBUGINFO_DWARFDEBUGRNGLISTS_H