Skip to content

Commit aba7154

Browse files
author
git apple-llvm automerger
committed
Merge commit '9ac059cf46a7' from apple/stable/20200714 into swift/main
2 parents 264500e + 9ac059c commit aba7154

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,15 @@ unsigned DWARFVerifier::verifyUnitContents(DWARFUnit &Unit) {
172172
NumUnitErrors += verifyDebugInfoForm(Die, AttrValue);
173173
}
174174

175+
if (Die.hasChildren()) {
176+
if (Die.getFirstChild().isValid() &&
177+
Die.getFirstChild().getTag() == DW_TAG_null) {
178+
warn() << dwarf::TagString(Die.getTag())
179+
<< " has DW_CHILDREN_yes but DIE has no children: ";
180+
Die.dump(OS);
181+
}
182+
}
183+
175184
NumUnitErrors += verifyDebugInfoCallSite(Die);
176185
}
177186

llvm/test/DebugInfo/X86/skeleton-unit-verify.s

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
# CHECK: Verifying .debug_abbrev...
55
# CHECK-NEXT: Verifying .debug_info Unit Header Chain...
6+
# CHECK-NEXT: warning: DW_TAG_skeleton_unit has DW_CHILDREN_yes but DIE has no children
7+
# CHECK-NEXT: DW_TAG_skeleton_unit
68
# CHECK-NEXT: error: Skeleton compilation unit has children.
79
# CHECK-NEXT: Verifying .debug_info references...
810
# CHECK-NEXT: Verifying .debug_types Unit Header Chain...
@@ -30,7 +32,7 @@
3032
.byte 8 # Address Size (in bytes)
3133
.long .debug_abbrev # Offset Into Abbrev. Section
3234
.quad -6573227469967412476
33-
.byte 1 # Abbrev [1]
35+
.byte 1 # Abbrev [1]
3436
.byte 0
3537
.Lcu_end0:
3638
.long .Lcu_end1-.Lcu_start1 # Length of Unit

llvm/test/tools/llvm-dwarfdump/X86/verify_die_ranges.s

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
# RUN: | FileCheck %s
44

55
# CHECK: Verifying .debug_info Unit Header Chain...
6-
# CHECK-NEXT: error: Invalid address range [0x0000000000000007, 0x0000000000000006)
6+
# CHECK: warning: DW_TAG_compile_unit has DW_CHILDREN_yes but DIE has no children:
7+
# CHECK: error: Invalid address range [0x0000000000000007, 0x0000000000000006)
78

89
.section __TEXT,__text,regular,pure_instructions
910
.macosx_version_min 10, 12

0 commit comments

Comments
 (0)