9#ifndef LLVM_DEBUGINFO_DWARF_DWARFVERIFIER_H
10#define LLVM_DEBUGINFO_DWARF_DWARFVERIFIER_H
23struct DWARFAddressRange;
28class DWARFDataExtractor;
29class DWARFDebugAbbrev;
35 std::map<std::string, unsigned> Aggregation;
40 : IncludeDetail(includeDetail) {}
41 void ShowDetail(
bool showDetail) { IncludeDetail = showDetail; }
55 std::vector<DWARFAddressRange>
Ranges;
102 using ReferenceMap = std::map<uint64_t, std::set<uint64_t>>;
143 bool &isUnitDWARF64);
144 bool verifyName(
const DWARFDie &Die);
161 unsigned verifyUnitContents(
DWARFUnit &Unit,
162 ReferenceMap &UnitLocalReferences,
163 ReferenceMap &CrossUnitReferences);
181 unsigned verifyDebugInfoCallSite(
const DWARFDie &Die);
202 unsigned verifyDebugInfoAttribute(
const DWARFDie &Die,
218 ReferenceMap &UnitLocalReferences,
219 ReferenceMap &CrossUnitReferences);
231 unsigned verifyDebugInfoReferences(
232 const ReferenceMap &,
237 void verifyDebugLineStmtOffsets();
244 void verifyDebugLineRows();
263 unsigned verifyAppleAccelTable(
const DWARFSection *AccelSection,
276 unsigned verifyNameIndexCompleteness(
const DWARFDie &Die,
296 unsigned verifyDebugNames(
const DWARFSection &AccelSection,
373 return std::tie(
LHS.Ranges,
LHS.Die) < std::tie(
RHS.Ranges,
RHS.Die);
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
This class holds an abstract representation of an Accelerator Table, consisting of a sequence of buck...
DWARFContext This data structure is the top level entity that deals with dwarf debug information pars...
Represents a single accelerator table within the DWARF v5 .debug_names section.
A single entry in the Name Table (DWARF v5 sect.
.debug_names section consists of one or more units.
Utility class that carries the DWARF compile/type unit and the debug info entry in an object.
Describe a collection of units.
A class that verifies DWARF debug information given a DWARF Context.
bool handleAccelTables()
Verify the information in accelerator tables, if they exist.
bool verifyDebugStrOffsets(std::optional< dwarf::DwarfFormat > LegacyFormat, StringRef SectionName, const DWARFSection &Section, StringRef StrData)
bool handleDebugTUIndex()
Verify the information in the .debug_tu_index section.
bool handleDebugStrOffsets()
Verify the information in the .debug_str_offsets[.dwo].
bool handleDebugCUIndex()
Verify the information in the .debug_cu_index section.
bool handleDebugInfo()
Verify the information in the .debug_info and .debug_types sections.
bool handleDebugLine()
Verify the information in the .debug_line section.
void summarize()
Emits any aggregate information collected, depending on the dump options.
bool handleDebugAbbrev()
Verify the information in any of the following sections, if available: .debug_abbrev,...
void ShowDetail(bool showDetail)
void Report(StringRef s, std::function< void()> detailCallback)
void EnumerateResults(std::function< void(StringRef, unsigned)> handleCounts)
size_t GetNumCategories() const
OutputCategoryAggregator(bool includeDetail=false)
SectionKind - This is a simple POD value that classifies the properties of a section.
StringRef - Represent a constant reference to a string, i.e.
An efficient, type-erasing, non-owning reference to a callable.
This class implements an extremely fast bulk output stream that can only output to a stream.
UnitType
Constants for unit types in DWARF v5.
This is an optimization pass for GlobalISel generic memory operations.
bool operator<(int64_t V1, const APSInt &V2)
DWARFSectionKind
The enum of section identifiers to be used in internal interfaces.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.
Container for dump options that control which debug information will be dumped.
static DIDumpOptions getForSingleDIE()
Return default option set for printing a single DIE without children.
Encapsulates a DWARF attribute value and all of the data required to describe the attribute value.
Abbreviation describing the encoding of Name Index entries.
Index attribute and its encoding.
A class that keeps the address range information for a single DIE.
DieRangeInfo(DWARFDie Die)
std::vector< DWARFAddressRange > Ranges
Sorted DWARFAddressRanges.
bool contains(const DieRangeInfo &RHS) const
Return true if ranges in this object contains all ranges within RHS.
std::set< DieRangeInfo >::const_iterator die_range_info_iterator
bool intersects(const DieRangeInfo &RHS) const
Return true if any range in this object intersects with any range in RHS.
DieRangeInfo(std::vector< DWARFAddressRange > Ranges)
Used for unit testing.
std::set< DieRangeInfo > Children
Sorted DWARFAddressRangeInfo.
std::optional< DWARFAddressRange > insert(const DWARFAddressRange &R)
Inserts the address range.