diff options
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 5 | ||||
-rw-r--r-- | llvm/test/DebugInfo/X86/fission-cu.ll | 26 |
2 files changed, 19 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 589f88d1de6..9829d0f4537 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -391,8 +391,11 @@ DwarfDebug::constructDwarfCompileUnit(const DICompileUnit *DIUnit) { DwarfCompileUnit &NewCU = *OwnedUnit; DIE &Die = NewCU.getUnitDie(); InfoHolder.addUnit(std::move(OwnedUnit)); - if (useSplitDwarf()) + if (useSplitDwarf()) { NewCU.setSkeleton(constructSkeletonCU(NewCU)); + NewCU.addString(Die, dwarf::DW_AT_GNU_dwo_name, + DIUnit->getSplitDebugFilename()); + } // LTO with assembly output shares a single line table amongst multiple CUs. // To avoid the compilation directory being ambiguous, let the line table diff --git a/llvm/test/DebugInfo/X86/fission-cu.ll b/llvm/test/DebugInfo/X86/fission-cu.ll index d52333ce6d9..2437010b191 100644 --- a/llvm/test/DebugInfo/X86/fission-cu.ll +++ b/llvm/test/DebugInfo/X86/fission-cu.ll @@ -33,6 +33,7 @@ ; CHECK: .debug_abbrev.dwo contents: ; CHECK: Abbrev table for offset: 0x00000000 ; CHECK: [1] DW_TAG_compile_unit DW_CHILDREN_yes +; CHECK: DW_AT_GNU_dwo_name DW_FORM_GNU_str_index ; CHECK: DW_AT_producer DW_FORM_GNU_str_index ; CHECK: DW_AT_language DW_FORM_data2 ; CHECK: DW_AT_name DW_FORM_GNU_str_index @@ -64,38 +65,41 @@ ; Check that the rest of the compile units have information. ; CHECK: .debug_info.dwo contents: ; CHECK: DW_TAG_compile_unit -; CHECK: DW_AT_producer [DW_FORM_GNU_str_index] ( indexed (00000000) string = "clang version 3.3 (trunk 169021) (llvm/trunk 169020)") +; CHECK: DW_AT_GNU_dwo_name [DW_FORM_GNU_str_index] ( indexed (00000000) string = "baz.dwo") +; CHECK: DW_AT_producer [DW_FORM_GNU_str_index] ( indexed (00000001) string = "clang version 3.3 (trunk 169021) (llvm/trunk 169020)") ; CHECK: DW_AT_language [DW_FORM_data2] (DW_LANG_C99) -; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000001) string = "baz.c") +; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000002) string = "baz.c") ; CHECK-NOT: DW_AT_low_pc ; CHECK-NOT: DW_AT_stmt_list ; CHECK-NOT: DW_AT_comp_dir ; CHECK: DW_AT_GNU_dwo_id [DW_FORM_data8] (0x1f1f859683d49324) ; CHECK: DW_TAG_variable -; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000002) string = "a") +; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000003) string = "a") ; CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x{{[0-9a-f]*}} => {[[TYPE:0x[0-9a-f]*]]}) ; CHECK: DW_AT_external [DW_FORM_flag_present] (true) ; CHECK: DW_AT_decl_file [DW_FORM_data1] (0x01) ; CHECK: DW_AT_decl_line [DW_FORM_data1] (1) ; CHECK: DW_AT_location [DW_FORM_exprloc] (<0x2> fb 00 ) ; CHECK: [[TYPE]]: DW_TAG_base_type -; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000003) string = "int") +; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000004) string = "int") ; CHECK: .debug_str contents: ; CHECK: 0x00000000: "baz.dwo" ; CHECK: 0x00000008: "/usr/local/google/home/echristo/tmp" ; CHECK: .debug_str.dwo contents: -; CHECK: 0x00000000: "clang version 3.3 (trunk 169021) (llvm/trunk 169020)" -; CHECK: 0x00000035: "baz.c" -; CHECK: 0x0000003b: "a" -; CHECK: 0x0000003d: "int" +; CHECK: 0x00000000: "baz.dwo" +; CHECK: 0x00000008: "clang version 3.3 (trunk 169021) (llvm/trunk 169020)" +; CHECK: 0x0000003d: "baz.c" +; CHECK: 0x00000043: "a" +; CHECK: 0x00000045: "int" ; CHECK: .debug_str_offsets.dwo contents: ; CHECK: 0x00000000: 00000000 -; CHECK: 0x00000004: 00000035 -; CHECK: 0x00000008: 0000003b -; CHECK: 0x0000000c: 0000003d +; CHECK: 0x00000004: 00000008 +; CHECK: 0x00000008: 0000003d +; CHECK: 0x0000000c: 00000043 +; CHECK: 0x00000010: 00000045 ; Object file checks ; For x86-64-linux we should have this set of relocations for the debug info section |