mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-15 04:29:42 +00:00
[llvm/DebugInfo] Print DW_AT_ranges offset as part of verifier error.
Print the DW_AT_ranges offset as part of the verifier error, like we do for the DW_AT_stmt_list offset.
This commit is contained in:
parent
da8918f27e
commit
bbaa639ba9
@ -458,7 +458,8 @@ unsigned DWARFVerifier::verifyDebugInfoAttribute(const DWARFDie &Die,
|
||||
// Make sure the offset in the DW_AT_ranges attribute is valid.
|
||||
if (auto SectionOffset = AttrValue.Value.getAsSectionOffset()) {
|
||||
if (*SectionOffset >= DObj.getRangesSection().Data.size())
|
||||
ReportError("DW_AT_ranges offset is beyond .debug_ranges bounds:");
|
||||
ReportError("DW_AT_ranges offset is beyond .debug_ranges bounds: " +
|
||||
llvm::formatv("{0:x8}", *SectionOffset));
|
||||
break;
|
||||
}
|
||||
ReportError("DIE has invalid DW_AT_ranges encoding:");
|
||||
|
@ -2008,8 +2008,9 @@ TEST(DWARFDebugInfo, TestDwarfVerifyInvalidRanges) {
|
||||
ASSERT_TRUE((bool)ErrOrSections);
|
||||
std::unique_ptr<DWARFContext> DwarfContext =
|
||||
DWARFContext::create(*ErrOrSections, 8);
|
||||
VerifyError(*DwarfContext,
|
||||
"error: DW_AT_ranges offset is beyond .debug_ranges bounds:");
|
||||
VerifyError(
|
||||
*DwarfContext,
|
||||
"error: DW_AT_ranges offset is beyond .debug_ranges bounds: 0x00001000");
|
||||
}
|
||||
|
||||
TEST(DWARFDebugInfo, TestDwarfVerifyInvalidStmtList) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user