LLVM 20.0.0git
|
A class that verifies DWARF debug information given a DWARF Context. More...
#include "llvm/DebugInfo/DWARF/DWARFVerifier.h"
Classes | |
struct | DieRangeInfo |
A class that keeps the address range information for a single DIE. More... | |
Public Member Functions | |
DWARFVerifier (raw_ostream &S, DWARFContext &D, DIDumpOptions DumpOpts=DIDumpOptions::getForSingleDIE()) | |
bool | handleDebugAbbrev () |
Verify the information in any of the following sections, if available: .debug_abbrev, debug_abbrev.dwo. | |
bool | handleDebugInfo () |
Verify the information in the .debug_info and .debug_types sections. | |
bool | handleDebugCUIndex () |
Verify the information in the .debug_cu_index section. | |
bool | handleDebugTUIndex () |
Verify the information in the .debug_tu_index section. | |
bool | handleDebugLine () |
Verify the information in the .debug_line section. | |
bool | handleAccelTables () |
Verify the information in accelerator tables, if they exist. | |
bool | handleDebugStrOffsets () |
Verify the information in the .debug_str_offsets[.dwo]. | |
bool | verifyDebugStrOffsets (std::optional< dwarf::DwarfFormat > LegacyFormat, StringRef SectionName, const DWARFSection &Section, StringRef StrData) |
void | summarize () |
Emits any aggregate information collected, depending on the dump options. | |
A class that verifies DWARF debug information given a DWARF Context.
Definition at line 48 of file DWARFVerifier.h.
DWARFVerifier::DWARFVerifier | ( | raw_ostream & | S, |
DWARFContext & | D, | ||
DIDumpOptions | DumpOpts = DIDumpOptions::getForSingleDIE() |
||
) |
Definition at line 1083 of file DWARFVerifier.cpp.
References F, llvm::DWARFContext::getDWARFObj(), llvm::DWARFObject::getFile(), llvm::OutputCategoryAggregator::ShowDetail(), and llvm::DIDumpOptions::Verbose.
bool DWARFVerifier::handleAccelTables | ( | ) |
Verify the information in accelerator tables, if they exist.
Any errors are reported to the stream that was this object was constructed with.
Definition at line 1940 of file DWARFVerifier.cpp.
References D, llvm::DWARFContext::getDWARFObj(), and llvm::DWARFContext::isLittleEndian().
Referenced by llvm::DWARFContext::verify().
bool DWARFVerifier::handleDebugAbbrev | ( | ) |
Verify the information in any of the following sections, if available: .debug_abbrev, debug_abbrev.dwo.
Any errors are reported to the stream that was this object was constructed with.
Definition at line 394 of file DWARFVerifier.cpp.
References llvm::StringRef::empty(), llvm::DWARFObject::getAbbrevDWOSection(), llvm::DWARFObject::getAbbrevSection(), llvm::DWARFContext::getDebugAbbrev(), llvm::DWARFContext::getDebugAbbrevDWO(), llvm::DWARFContext::getDWARFObj(), and OS.
Referenced by llvm::DWARFContext::verify().
bool DWARFVerifier::handleDebugCUIndex | ( | ) |
Verify the information in the .debug_cu_index section.
Any errors are reported to the stream that was this object was constructed with.
Definition at line 518 of file DWARFVerifier.cpp.
References llvm::DWARFObject::getCUIndexSection(), and llvm::DWARFContext::getDWARFObj().
Referenced by llvm::DWARFContext::verify().
bool DWARFVerifier::handleDebugInfo | ( | ) |
Verify the information in the .debug_info and .debug_types sections.
Any errors are reported to the stream that this object was constructed with.
Definition at line 528 of file DWARFVerifier.cpp.
References llvm::DWARFObject::forEachInfoSections(), llvm::DWARFObject::forEachTypesSections(), llvm::DWARFContext::getDWARFObj(), llvm::DWARFContext::getDWOUnitsVector(), llvm::DWARFContext::getNormalUnitsVector(), and OS.
Referenced by llvm::DWARFContext::verify().
bool DWARFVerifier::handleDebugLine | ( | ) |
Verify the information in the .debug_line section.
Any errors are reported to the stream that was this object was constructed with.
Definition at line 1095 of file DWARFVerifier.cpp.
References OS.
Referenced by llvm::DWARFContext::verify().
bool DWARFVerifier::handleDebugStrOffsets | ( | ) |
Verify the information in the .debug_str_offsets[.dwo].
Any errors are reported to the stream that was this object was constructed with.
Definition at line 1962 of file DWARFVerifier.cpp.
References llvm::DWARFObject::forEachInfoDWOSections(), llvm::DWARFContext::getDWARFObj(), llvm::DWARFDataExtractor::getInitialLength(), llvm::DWARFObject::getStrDWOSection(), llvm::DWARFObject::getStrOffsetsDWOSection(), llvm::DWARFObject::getStrOffsetsSection(), llvm::DWARFObject::getStrSection(), llvm::DataExtractor::getU16(), llvm::DWARFContext::isLittleEndian(), llvm::Offset, Success, and verifyDebugStrOffsets().
Referenced by llvm::DWARFContext::verify().
bool DWARFVerifier::handleDebugTUIndex | ( | ) |
Verify the information in the .debug_tu_index section.
Any errors are reported to the stream that was this object was constructed with.
Definition at line 523 of file DWARFVerifier.cpp.
References llvm::DW_SECT_EXT_TYPES, llvm::DWARFContext::getDWARFObj(), and llvm::DWARFObject::getTUIndexSection().
Referenced by llvm::DWARFContext::verify().
void DWARFVerifier::summarize | ( | ) |
Emits any aggregate information collected, depending on the dump options.
Definition at line 2111 of file DWARFVerifier.cpp.
References llvm::count(), llvm::OutputCategoryAggregator::EnumerateResults(), llvm::OutputCategoryAggregator::GetNumCategories(), llvm::DIDumpOptions::JsonErrSummaryFile, llvm::sys::fs::OF_Text, llvm::DIDumpOptions::ShowAggregateErrors, and llvm::json::Object::try_emplace().
Referenced by llvm::DWARFContext::verify().
bool DWARFVerifier::verifyDebugStrOffsets | ( | std::optional< dwarf::DwarfFormat > | LegacyFormat, |
StringRef | SectionName, | ||
const DWARFSection & | Section, | ||
StringRef | StrData | ||
) |
Definition at line 1992 of file DWARFVerifier.cpp.
References llvm::CallingConv::C, llvm::Format, llvm::formatv(), llvm::DWARFContext::getDWARFObj(), llvm::dwarf::getDwarfOffsetByteSize(), llvm::DWARFContext::isLittleEndian(), llvm::Length, llvm::OutputCategoryAggregator::Report(), llvm::StringRef::size(), Success, llvm::dwarf::toString(), and llvm::Version.
Referenced by handleDebugStrOffsets().