File tree 2 files changed +61
-7
lines changed
test/tools/llvm-dwarfdump/X86
2 files changed +61
-7
lines changed Original file line number Diff line number Diff line change @@ -921,6 +921,11 @@ void DWARFVerifier::verifyDebugLineRows() {
921
921
FileIndex++;
922
922
}
923
923
924
+ // Nothing to verify in a line table with a single row containing the end
925
+ // sequence.
926
+ if (LineTable->Rows .size () == 1 && LineTable->Rows .front ().EndSequence )
927
+ continue ;
928
+
924
929
// Verify rows.
925
930
uint64_t PrevAddress = 0 ;
926
931
uint32_t RowIndex = 0 ;
@@ -941,13 +946,7 @@ void DWARFVerifier::verifyDebugLineRows() {
941
946
OS << ' \n ' ;
942
947
}
943
948
944
- // If the prologue contains no file names and the line table has only one
945
- // row, do not verify the file index, this is a line table of an empty
946
- // file with an end_sequence, but the DWARF standard sets the file number
947
- // to 1 by default, otherwise verify file index.
948
- if ((LineTable->Prologue .FileNames .size () ||
949
- LineTable->Rows .size () != 1 ) &&
950
- !LineTable->hasFileAtIndex (Row.File )) {
949
+ if (!LineTable->hasFileAtIndex (Row.File )) {
951
950
++NumDebugLineErrors;
952
951
error () << " .debug_line["
953
952
<< format (" 0x%08" PRIx64,
Original file line number Diff line number Diff line change
1
+ # RUN: yaml2obj %s -o %t.o
2
+ # RUN: llvm-dwarfdump -debug-line -verify %t.o | FileCheck %s
3
+
4
+ # CHECK: Verifying .debug_line...
5
+ # CHECK: No errors
6
+
7
+ # In a line table like the one below, with no rows (other than the
8
+ # end_sequence), we should never verify the file index because the state
9
+ # machine initializes the file index to 1, which is invalid in DWARF 5 due to
10
+ # its 0-based indexing.
11
+
12
+ # file_names[ 0]:
13
+ # name: "/home/umb/tests_2018/106_rnglists2"
14
+ # dir_index: 0
15
+ # Address Line Column File ISA Discriminator OpIndex Flags
16
+ # ------------------ ------ ------ ------ --- ------------- ------- -------------
17
+ # 0x0000000000000000 1 0 1 0 0 0 is_stmt end_sequence
18
+
19
+
20
+ --- !ELF
21
+ FileHeader :
22
+ Class : ELFCLASS64
23
+ Data : ELFDATA2LSB
24
+ Type : ET_EXEC
25
+ DWARF :
26
+ debug_abbrev :
27
+ - ID : 0
28
+ Table :
29
+ - Code : 0x1
30
+ Tag : DW_TAG_compile_unit
31
+ Children : DW_CHILDREN_no
32
+ Attributes :
33
+ - Attribute : DW_AT_stmt_list
34
+ Form : DW_FORM_sec_offset
35
+ debug_info :
36
+ - Length : 0xd
37
+ Version : 5
38
+ UnitType : DW_UT_compile
39
+ AbbrevTableID : 0
40
+ AbbrOffset : 0x0
41
+ AddrSize : 8
42
+ Entries :
43
+ - AbbrCode : 0x1
44
+ Values :
45
+ - Value : 0x0
46
+ Sections :
47
+ - Name : .debug_line
48
+ Type : SHT_PROGBITS
49
+ AddressAlign : 0x1
50
+ Content : 300000000500080025000000010101fb0e0d00010101010000000100000101011f010000000002011f020b010000000000000101
51
+ - Name : .debug_line_str
52
+ Type : SHT_PROGBITS
53
+ Flags : [ SHF_MERGE, SHF_STRINGS ]
54
+ AddressAlign : 0x1
55
+ Content : 2F686F6D652F756D622F74657374735F323031382F3130365F726E676C697374733200746573742E63707000
You can’t perform that action at this time.
0 commit comments