diff --git a/llvm/test/tools/llvm-dwp/X86/cu_and_tu_info_section_v5.s b/llvm/test/tools/llvm-dwp/X86/cu_and_tu_info_section_v5.s --- a/llvm/test/tools/llvm-dwp/X86/cu_and_tu_info_section_v5.s +++ b/llvm/test/tools/llvm-dwp/X86/cu_and_tu_info_section_v5.s @@ -3,30 +3,43 @@ # RUN: llvm-mc --triple=x86_64-unknown-linux --filetype=obj --split-dwarf-file=%t.dwo -dwarf-version=5 %s -o %t.o # RUN: llvm-dwp %t.dwo -o %t.dwp -# RUN: llvm-dwarfdump %t.dwp | FileCheck %s +# RUN: llvm-dwarfdump -debug-info -debug-tu-index %t.dwp | FileCheck %s # CHECK-DAG: .debug_info.dwo contents -# CHECK: 0x00000000: Compile Unit: length = 0x00000011, format = DWARF32, version = 0x0005, unit_type = DW_UT_split_compile, abbr_offset = 0x0000, addr_size = 0x08, DWO_id = {{.*}} - - .section .debug_info.dwo,"e",@progbits - .long .Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit +# CHECK-NOT: Type Unit: +# CHECK: 0x00000000: Compile Unit: length = 0x00000011, format = DWARF32, version = 0x0005, unit_type = DW_UT_split_compile, abbr_offset = 0x0000, addr_size = 0x08, DWO_id = {{.*}} (next unit at 0x00000015) + .section .debug_info.dwo,"e",@progbits + .long .Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit .Ldebug_info_dwo_start0: - .short 5 # DWARF version number - .byte 6 # DWARF Unit Type (DW_UT_split_type) - .byte 8 # Address Size (in bytes) - .long 0 # Offset Into Abbrev. Section - .quad -4287463584810542331 # Type Signature - .long 31 # Type DIE Offset + .short 5 # DWARF version number + .byte 6 # DWARF Unit Type (DW_UT_split_type) + .byte 8 # Address Size (in bytes) + .long 0 # Offset Into Abbrev. Section + .quad 5657452045627120676 # Type Signature + .long 25 # Type DIE Offset + .byte 1 # Abbrev [1] DW_TAG_type_unit + .byte 2 # Abbrev [2] DW_TAG_structure_type + .byte 0 # End Of Children Mark .Ldebug_info_dwo_end0: - .long .Ldebug_info_dwo_end1-.Ldebug_info_dwo_start1 # Length of Unit + .section .debug_info.dwo,"e",@progbits + .long .Ldebug_info_dwo_end1-.Ldebug_info_dwo_start1 # Length of Unit .Ldebug_info_dwo_start1: - .short 5 # DWARF version number - .byte 5 # DWARF Unit Type (DW_UT_split_compile) - .byte 8 # Address Size (in bytes) - .long 0 # Offset Into Abbrev. Section - .quad 1152943841751211454 - .byte 1 # Abbrev [1] 0x14:0x2be DW_TAG_compile_unit + .short 5 # DWARF version number + .byte 5 # DWARF Unit Type (DW_UT_split_compile) + .byte 8 # Address Size (in bytes) + .long 0 # Offset Into Abbrev. Section + .quad -1506010254921578184 + .byte 3 # Abbrev [3] DW_TAG_compile_unit .Ldebug_info_dwo_end1: - .section .debug_abbrev.dwo,"e",@progbits - .byte 1 # Abbreviation Code - .byte 17 # DW_TAG_compile_unit + .section .debug_abbrev.dwo,"e",@progbits + .byte 1 # Abbreviation Code + .byte 65 # DW_TAG_type_unit + .byte 1 # DW_CHILDREN_yes + .byte 0 # EOM(1) + .byte 0 # EOM(2) + .byte 3 # Abbreviation Code + .byte 17 # DW_TAG_compile_unit + .byte 0 # DW_CHILDREN_no + .byte 0 # EOM(1) + .byte 0 # EOM(2) + .byte 0 # EOM(3) diff --git a/llvm/tools/llvm-dwp/llvm-dwp.cpp b/llvm/tools/llvm-dwp/llvm-dwp.cpp --- a/llvm/tools/llvm-dwp/llvm-dwp.cpp +++ b/llvm/tools/llvm-dwp/llvm-dwp.cpp @@ -143,9 +143,9 @@ MinHeaderLength = 7; } if (Header.Length < MinHeaderLength) { - return make_error( - "compile unit length is too small: expected at least " + - utostr(MinHeaderLength) + " got " + utostr(Header.Length) + "."); + return make_error("unit length is too small: expected at least " + + utostr(MinHeaderLength) + " got " + + utostr(Header.Length) + "."); } if (Header.Version >= 5) { Header.UnitType = InfoData.getU8(&Offset);