9#ifndef LLVM_DEBUGINFO_DWARF_DWARFVERIFIER_H
10#define LLVM_DEBUGINFO_DWARF_DWARFVERIFIER_H
27struct DWARFAddressRange;
32class DWARFDataExtractor;
33class DWARFDebugAbbrev;
44 std::mutex WriteMutex;
45 std::map<std::string, AggregationData, std::less<>> Aggregation;
51 : IncludeDetail(includeDetail) {}
52 void ShowDetail(
bool showDetail) { IncludeDetail = showDetail; }
55 std::function<
void()> detailCallback);
57 std::function<
void()> detailCallback);
62 std::function<
void(
StringRef,
unsigned)> handleCounts);
75 std::vector<DWARFAddressRange>
Ranges;
98 LLVM_ABI std::optional<DWARFAddressRange>
127 using ReferenceMap = std::map<uint64_t, std::set<uint64_t>>;
128 std::mutex AccessMutex;
169 bool &isUnitDWARF64);
170 bool verifyName(
const DWARFDie &Die);
187 unsigned verifyUnitContents(
DWARFUnit &Unit,
188 ReferenceMap &UnitLocalReferences,
189 ReferenceMap &CrossUnitReferences);
207 unsigned verifyDebugInfoCallSite(
const DWARFDie &Die);
228 unsigned verifyDebugInfoAttribute(
const DWARFDie &Die,
244 ReferenceMap &UnitLocalReferences,
245 ReferenceMap &CrossUnitReferences);
257 unsigned verifyDebugInfoReferences(
258 const ReferenceMap &,
263 void verifyDebugLineStmtOffsets();
270 void verifyDebugLineRows();
289 void verifyAppleAccelTable(
const DWARFSection *AccelSection,
299 void verifyNameIndexEntries(
303 void verifyNameIndexCompleteness(
420 return std::tie(
LHS.Ranges,
LHS.Die) < std::tie(
RHS.Ranges,
RHS.Die);
This file defines the StringMap class.
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
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.
This class represents an Operation in the Expression.
Describe a collection of units.
A class that verifies DWARF debug information given a DWARF Context.
LLVM_ABI bool handleAccelTables()
Verify the information in accelerator tables, if they exist.
LLVM_ABI bool verifyDebugStrOffsets(std::optional< dwarf::DwarfFormat > LegacyFormat, StringRef SectionName, const DWARFSection &Section, StringRef StrData)
LLVM_ABI bool handleDebugTUIndex()
Verify the information in the .debug_tu_index section.
LLVM_ABI bool handleDebugStrOffsets()
Verify the information in the .debug_str_offsets[.dwo].
LLVM_ABI bool handleDebugCUIndex()
Verify the information in the .debug_cu_index section.
LLVM_ABI bool handleDebugInfo()
Verify the information in the .debug_info and .debug_types sections.
LLVM_ABI bool handleDebugLine()
Verify the information in the .debug_line section.
LLVM_ABI void summarize()
Emits any aggregate information collected, depending on the dump options.
LLVM_ABI bool handleDebugAbbrev()
Verify the information in any of the following sections, if available: .debug_abbrev,...
Implements a dense probed hash-table based set.
LLVM_ABI void Report(StringRef category, StringRef sub_category, std::function< void()> detailCallback)
void ShowDetail(bool showDetail)
LLVM_ABI void EnumerateResults(std::function< void(StringRef, unsigned)> handleCounts)
size_t GetNumCategories() const
LLVM_ABI void EnumerateDetailedResultsFor(StringRef category, std::function< void(StringRef, unsigned)> handleCounts)
OutputCategoryAggregator(bool includeDetail=false)
LLVM_ABI void Report(StringRef category, std::function< void()> detailCallback)
uint64_t GetNumErrors() const
Return the number of errors that have been reported.
SectionKind - This is a simple POD value that classifies the properties of a section.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
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.
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.
std::map< std::string, unsigned > DetailedCounts
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.
LLVM_ABI 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
LLVM_ABI 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.
LLVM_ABI std::optional< DWARFAddressRange > insert(const DWARFAddressRange &R)
Inserts the address range.