Skip to content

Commit 09f43c1

Browse files
committedDec 29, 2021
DWARFVerifier: fix remaining tests and compact/rephrase the output
1 parent 6edc389 commit 09f43c1

16 files changed

+21
-7
lines changed
 

‎llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,12 @@ unsigned DWARFVerifier::verifyUnits(const DWARFUnitVector &Units) {
322322
unsigned NumDebugInfoErrors = 0;
323323
ReferenceMap CrossUnitReferences;
324324

325-
unsigned int Index = 0;
325+
unsigned int Index = 1;
326326
for (const auto &Unit : Units) {
327-
OS << "Verifying unit: " << Index << " / " << Units.getNumUnits() << '\n';
328-
OS << "Unit Name: " << Unit->getUnitDIE(true).getShortName() << '\n';
327+
OS << "Verifying unit: " << Index << " / " << Units.getNumUnits();
328+
if (const char* Name = Unit->getUnitDIE(true).getShortName())
329+
OS << ", \"" << Name << '\"';
330+
OS << '\n';
329331
OS.flush();
330332
ReferenceMap UnitLocalReferences;
331333
NumDebugInfoErrors +=

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

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
# CHECK-NEXT: Verifying .debug_info Unit Header Chain...
66
# CHECK-NEXT: Verifying .debug_types Unit Header Chain...
77
# CHECK-NEXT: Verifying non-dwo Units...
8-
# CHECK-NEXT: Verifying unit: 0 / 2
9-
# CHECK-NEXT: Unit Name: test.cpp
10-
# CHECK-NEXT: Verifying unit: 1 / 2
11-
# CHECK-NEXT: Unit Name:
8+
# CHECK-NEXT: Verifying unit: 1 / 2, "test.cpp"
9+
# CHECK-NEXT: Verifying unit: 2 / 2
1210
# CHECK-NEXT: warning: DW_TAG_skeleton_unit has DW_CHILDREN_yes but DIE has no children
1311
# CHECK-NEXT: DW_TAG_skeleton_unit
1412
# CHECK-NEXT: error: Skeleton compilation unit has children.

‎llvm/test/tools/llvm-dwarfdump/X86/verify_curanges_incomplete.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# RUN: not llvm-dwarfdump -verify %t.o | FileCheck %s
33

44
# CHECK: Verifying non-dwo Units...
5+
# CHECK-NEXT: Verifying unit: 1 / 1, "/tmp/main.c"
56
# CHECK-NEXT: error: DIE address ranges are not contained in its parent's ranges:
67

78
--- !ELF

‎llvm/test/tools/llvm-dwarfdump/X86/verify_debug_info.s

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
# CHECK-NEXT: DW_AT_decl_file [DW_FORM_data1] (0x01)
4747
# CHECK-NEXT: DW_AT_decl_line [DW_FORM_data1] (2)
4848
# CHECK-NEXT: DW_AT_use_location [DW_FORM_ref4] (cu + 0x0053 => {0x00000053}){{[[:space:]]}}
49+
# CHECK-NEXT: Verifying unit: 2 / 2
4950
# CHECK-NEXT: error: Compilation unit root DIE is not a unit DIE: DW_TAG_null.
5051
# CHECK-NEXT: error: Compilation unit type (DW_UT_compile) and root DIE (DW_TAG_null) do not match.
5152

‎llvm/test/tools/llvm-dwarfdump/X86/verify_die_ranges.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# RUN: not llvm-dwarfdump -verify %t.o | FileCheck %s
33

44
# CHECK: Verifying non-dwo Units...
5+
# CHECK-NEXT: Verifying unit: 1 / 1
56
# CHECK-NEXT: error: Invalid address range [0x0000000000000007, 0x0000000000000006)
67

78
--- !ELF

‎llvm/test/tools/llvm-dwarfdump/X86/verify_invalid_cu_ref.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# RUN: not llvm-dwarfdump -debug-info -verify %t.o | FileCheck %s
33

44
# CHECK: Verifying non-dwo Units...
5+
# CHECK-NEXT: Verifying unit: 1 / 1, "/tmp/main.c"
56
# CHECK-NEXT: error: DW_FORM_ref4 CU offset 0x00001234 is invalid (must be less than CU size of 0x0000001a):
67

78
--- !ELF

‎llvm/test/tools/llvm-dwarfdump/X86/verify_invalid_die_range.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# RUN: not llvm-dwarfdump -verify %t.o | FileCheck %s
33

44
# CHECK: Verifying non-dwo Units...
5+
# CHECK-NEXT: Verifying unit: 1 / 1, "/tmp/main.c"
56
# CHECK-NEXT: error: Invalid address range
67

78
--- !ELF

‎llvm/test/tools/llvm-dwarfdump/X86/verify_invalid_ranges.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# RUN: not llvm-dwarfdump -debug-info -verify %t.o | FileCheck %s
33

44
# CHECK: Verifying non-dwo Units...
5+
# CHECK-NEXT: Verifying unit: 1 / 1, "/tmp/main.c"
56
# CHECK-NEXT: error: DW_AT_ranges offset is beyond .debug_ranges bounds: 0x00001000
67

78
--- !ELF

‎llvm/test/tools/llvm-dwarfdump/X86/verify_invalid_ref_addr.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# RUN: not llvm-dwarfdump -debug-info -verify %t.o | FileCheck %s
33

44
# CHECK: Verifying non-dwo Units...
5+
# CHECK-NEXT: Verifying unit: 1 / 1, "/tmp/main.c"
56
# CHECK-NEXT: error: DW_FORM_ref_addr offset beyond .debug_info bounds:
67

78
--- !ELF

‎llvm/test/tools/llvm-dwarfdump/X86/verify_invalid_ref_addr_between.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# RUN: not llvm-dwarfdump -debug-info -verify %t.o | FileCheck %s
33

44
# CHECK: Verifying non-dwo Units...
5+
# CHECK-NEXT: Verifying unit: 1 / 1, "/tmp/main.c"
56
# CHECK-NEXT: error: invalid DIE reference 0x00000011. Offset is in between DIEs:
67

78
--- !ELF

‎llvm/test/tools/llvm-dwarfdump/X86/verify_invalid_rnglists.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# RUN: not llvm-dwarfdump -debug-info -verify %t.o | FileCheck %s
33

44
# CHECK: Verifying non-dwo Units...
5+
# CHECK-NEXT: Verifying unit: 1 / 1, "/tmp/main.c"
56
# CHECK-NEXT: error: DW_AT_ranges offset is beyond .debug_rnglists bounds: 0x00001000
67

78
--- !ELF

‎llvm/test/tools/llvm-dwarfdump/X86/verify_invalid_stmt_list.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# RUN: not llvm-dwarfdump -debug-info -verify %t.o | FileCheck %s
33

44
# CHECK: Verifying non-dwo Units...
5+
# CHECK-NEXT: Verifying unit: 1 / 1, "/tmp/main.c"
56
# CHECK-NEXT: error: DW_AT_stmt_list offset is beyond .debug_line bounds: 0x00001000
67

78
--- !ELF

‎llvm/test/tools/llvm-dwarfdump/X86/verify_invalid_strp.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# RUN: not llvm-dwarfdump -debug-info -verify %t.o | FileCheck %s
33

44
# CHECK: Verifying non-dwo Units...
5+
# CHECK-NEXT: Verifying unit: 1 / 1
56
# CHECK-NEXT: error: DW_FORM_strp offset 4660 is beyond .debug_str bounds:
67

78
--- !ELF

‎llvm/test/tools/llvm-dwarfdump/X86/verify_lexical_block_ranges.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# RUN: not llvm-dwarfdump -verify %t.o | FileCheck %s
33

44
# CHECK: Verifying non-dwo Units...
5+
# CHECK-NEXT: Verifying unit: 1 / 1, "/tmp/main.c"
56
# CHECK-NEXT: error: DIE address ranges are not contained in its parent's ranges:
67

78
--- !ELF

‎llvm/test/tools/llvm-dwarfdump/X86/verify_overlapping_function_ranges.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# RUN: not llvm-dwarfdump -verify %t.o | FileCheck %s
33

44
# CHECK: Verifying non-dwo Units...
5+
# CHECK-NEXT: Verifying unit: 1 / 1, "/tmp/main.c"
56
# CHECK-NEXT: error: DIEs have overlapping address ranges
67

78
--- !ELF

‎llvm/test/tools/llvm-dwarfdump/X86/verify_overlapping_lexical_block_ranges.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# RUN: not llvm-dwarfdump -verify %t.o | FileCheck %s
33

44
# CHECK: Verifying non-dwo Units...
5+
# CHECK-NEXT: Verifying unit: 1 / 1, "/tmp/main.c"
56
# CHECK-NEXT: error: DIEs have overlapping address ranges
67

78
--- !ELF

0 commit comments

Comments
 (0)