diff options
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp | 7 | ||||
-rw-r--r-- | llvm/test/DebugInfo/X86/dwarfdump-header-64.s | 12 | ||||
-rw-r--r-- | llvm/test/DebugInfo/X86/dwarfdump-header.s | 24 | ||||
-rw-r--r-- | llvm/test/DebugInfo/X86/dwarfdump-line-only.s | 12 | ||||
-rw-r--r-- | llvm/test/MC/ARM/dwarf-asm-multiple-sections.s | 2 | ||||
-rw-r--r-- | llvm/test/MC/ELF/debug-md5.s | 6 |
6 files changed, 33 insertions, 30 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp index 861122cfbaf..7bc6f10e516 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp @@ -73,10 +73,13 @@ void DWARFDebugLine::Prologue::dump(raw_ostream &OS) const { OS << format("standard_opcode_lengths[%s] = %u\n", LNStandardString(I + 1).data(), StandardOpcodeLengths[I]); - if (!IncludeDirectories.empty()) + if (!IncludeDirectories.empty()) { + // DWARF v5 starts directory indexes at 0. + uint32_t DirBase = getVersion() >= 5 ? 0 : 1; for (uint32_t I = 0; I != IncludeDirectories.size(); ++I) - OS << format("include_directories[%3u] = '", I + 1) + OS << format("include_directories[%3u] = '", I + DirBase) << IncludeDirectories[I] << "'\n"; + } if (!FileNames.empty()) { if (HasMD5) diff --git a/llvm/test/DebugInfo/X86/dwarfdump-header-64.s b/llvm/test/DebugInfo/X86/dwarfdump-header-64.s index f0baa592d8d..f9aa51c682e 100644 --- a/llvm/test/DebugInfo/X86/dwarfdump-header-64.s +++ b/llvm/test/DebugInfo/X86/dwarfdump-header-64.s @@ -122,11 +122,11 @@ LH_5_params: # File table entries .byte 2 # Two files .asciz "File5a" - .byte 1 + .byte 0 .byte 0x51 .byte 0x52 .asciz "File5b" - .byte 2 + .byte 1 .byte 0x53 .byte 0x54 LH_5_header_end: @@ -141,9 +141,9 @@ LH_5_end: # CHECK: seg_select_size: 0 # CHECK: prologue_length: 0x00000044 # CHECK: max_ops_per_inst: 1 -# CHECK: include_directories[ 1] = 'Directory5a' -# CHECK: include_directories[ 2] = 'Directory5b' +# CHECK: include_directories[ 0] = 'Directory5a' +# CHECK: include_directories[ 1] = 'Directory5b' # CHECK-NOT: include_directories -# CHECK: file_names[ 1] 1 0x00000051 0x00000052 File5a{{$}} -# CHECK: file_names[ 2] 2 0x00000053 0x00000054 File5b{{$}} +# CHECK: file_names[ 1] 0 0x00000051 0x00000052 File5a{{$}} +# CHECK: file_names[ 2] 1 0x00000053 0x00000054 File5b{{$}} # CHECK-NOT: file_names diff --git a/llvm/test/DebugInfo/X86/dwarfdump-header.s b/llvm/test/DebugInfo/X86/dwarfdump-header.s index a0588b56652..4c90485faa3 100644 --- a/llvm/test/DebugInfo/X86/dwarfdump-header.s +++ b/llvm/test/DebugInfo/X86/dwarfdump-header.s @@ -308,11 +308,11 @@ LH_5_params: # File table entries .byte 2 # Two files .asciz "File5a" - .byte 1 + .byte 0 .quad 0x7766554433221100 .quad 0xffeeddccbbaa9988 .asciz "File5b" - .byte 2 + .byte 1 .quad 0x8899aabbccddeeff .quad 0x0011223344556677 LH_5_header_end: @@ -324,12 +324,12 @@ LH_5_end: # CHECK: address_size: 8 # CHECK: seg_select_size: 0 # CHECK: max_ops_per_inst: 1 -# CHECK: include_directories[ 1] = 'Directory5a' -# CHECK: include_directories[ 2] = 'Directory5b' +# CHECK: include_directories[ 0] = 'Directory5a' +# CHECK: include_directories[ 1] = 'Directory5b' # CHECK-NOT: include_directories # CHECK: MD5 Checksum -# CHECK: file_names[ 1] 1 00112233445566778899aabbccddeeff File5a{{$}} -# CHECK: file_names[ 2] 2 ffeeddccbbaa99887766554433221100 File5b{{$}} +# CHECK: file_names[ 1] 0 00112233445566778899aabbccddeeff File5a{{$}} +# CHECK: file_names[ 2] 1 ffeeddccbbaa99887766554433221100 File5b{{$}} # CHECK-NOT: file_names .section .debug_line.dwo,"",@progbits @@ -383,11 +383,11 @@ dwo_LH_5_params: # File table entries .byte 2 # Two files .asciz "DWOFile5a" - .byte 1 + .byte 0 .byte 0x15 .byte 0x25 .asciz "DWOFile5b" - .byte 2 + .byte 1 .byte 0x35 .byte 0x45 dwo_LH_5_header_end: @@ -399,9 +399,9 @@ dwo_LH_5_end: # CHECK: address_size: 8 # CHECK: seg_select_size: 0 # CHECK: max_ops_per_inst: 1 -# CHECK: include_directories[ 1] = 'DWODirectory5a' -# CHECK: include_directories[ 2] = 'DWODirectory5b' +# CHECK: include_directories[ 0] = 'DWODirectory5a' +# CHECK: include_directories[ 1] = 'DWODirectory5b' # CHECK-NOT: include_directories -# CHECK: file_names[ 1] 1 0x00000015 0x00000025 DWOFile5a{{$}} -# CHECK: file_names[ 2] 2 0x00000035 0x00000045 DWOFile5b{{$}} +# CHECK: file_names[ 1] 0 0x00000015 0x00000025 DWOFile5a{{$}} +# CHECK: file_names[ 2] 1 0x00000035 0x00000045 DWOFile5b{{$}} # CHECK-NOT: file_names diff --git a/llvm/test/DebugInfo/X86/dwarfdump-line-only.s b/llvm/test/DebugInfo/X86/dwarfdump-line-only.s index 299dc2cf97a..bfcebd6c08a 100644 --- a/llvm/test/DebugInfo/X86/dwarfdump-line-only.s +++ b/llvm/test/DebugInfo/X86/dwarfdump-line-only.s @@ -59,11 +59,11 @@ LH_5_params: .byte 0x0f # DW_FORM_udata # File table entries .byte 2 # Two file entries - .byte 2 + .byte 1 .asciz "File1" .byte 0x51 .byte 0x52 - .byte 1 + .byte 0 .asciz "File2" .byte 0x53 .byte 0x54 @@ -84,10 +84,10 @@ LH_5_end: # CHECK: address_size: 8 # CHECK: seg_select_size: 0 # CHECK: max_ops_per_inst: 1 -# CHECK: include_directories[ 1] = 'Directory1' -# CHECK: include_directories[ 2] = 'Directory2' +# CHECK: include_directories[ 0] = 'Directory1' +# CHECK: include_directories[ 1] = 'Directory2' # CHECK-NOT: include_directories -# CHECK: file_names[ 1] 2 0x00000051 0x00000052 File1{{$}} -# CHECK: file_names[ 2] 1 0x00000053 0x00000054 File2{{$}} +# CHECK: file_names[ 1] 1 0x00000051 0x00000052 File1{{$}} +# CHECK: file_names[ 2] 0 0x00000053 0x00000054 File2{{$}} # CHECK-NOT: file_names # CHECK: 0x0000000000000000 {{.*}} is_stmt end_sequence diff --git a/llvm/test/MC/ARM/dwarf-asm-multiple-sections.s b/llvm/test/MC/ARM/dwarf-asm-multiple-sections.s index 1f13a5abf9c..a873e505f73 100644 --- a/llvm/test/MC/ARM/dwarf-asm-multiple-sections.s +++ b/llvm/test/MC/ARM/dwarf-asm-multiple-sections.s @@ -54,7 +54,7 @@ b: // DWARF-DL: .debug_line contents: // DWARF-DL: version: [[DWVER]] // DWARF-DL-5: address_size: 4 -// DWARF-DL-5: include_directories[ 1] = '' +// DWARF-DL-5: include_directories[ 0] = '' // DWARF-DL: file_names[ 1] {{.*}} <stdin> // DWARF-DL: 0x0000000000000000 17 0 1 0 0 is_stmt // DWARF-DL-NEXT: 0x0000000000000004 17 0 1 0 0 is_stmt end_sequence diff --git a/llvm/test/MC/ELF/debug-md5.s b/llvm/test/MC/ELF/debug-md5.s index 16ec47db83a..d854c034d3c 100644 --- a/llvm/test/MC/ELF/debug-md5.s +++ b/llvm/test/MC/ELF/debug-md5.s @@ -9,9 +9,9 @@ # CHECK: debug_line[0x00000000] # CHECK: version: 5 -# CHECK: include_directories[ 1] = '' -# CHECK: include_directories[ 2] = 'dir1' -# CHECK: include_directories[ 3] = 'dir2' +# CHECK: include_directories[ 0] = '' +# CHECK: include_directories[ 1] = 'dir1' +# CHECK: include_directories[ 2] = 'dir2' # CHECK-NOT: include_directories # CHECK: Dir MD5 Checksum File Name # CHECK: file_names[ 1] 1 00112233445566778899aabbccddeeff foo |