llvm.org GIT mirror llvm / 97f383e
[debuginfo] Include dwo_name in the split unit to improve dwp diagnostics When multiple DWP files are merged together and duplicate DWO IDs are found it's currently difficult to give an actionable error message - the DW_AT_name of the CU could be provided, but might be identical (if the same source file is built into two different configurations), which doesn't help the user identify the problem. When no intermediate DWP files are generated, the path to the two DWO files could be provided - but is lost once the DWOs are merged into a DWP. So, include the name of the DWO (dwo_name) in the split file so that collissions involving a source CU from a DWP can be better diagnosed. (improvements to llvm-dwp using this to come shortly) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264316 91177308-0d34-0410-b5e6-96231b3b80d8 David Blaikie 4 years ago
2 changed file(s) with 19 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
390390 DwarfCompileUnit &NewCU = *OwnedUnit;
391391 DIE &Die = NewCU.getUnitDie();
392392 InfoHolder.addUnit(std::move(OwnedUnit));
393 if (useSplitDwarf())
393 if (useSplitDwarf()) {
394394 NewCU.setSkeleton(constructSkeletonCU(NewCU));
395 NewCU.addString(Die, dwarf::DW_AT_GNU_dwo_name,
396 DIUnit->getSplitDebugFilename());
397 }
395398
396399 // LTO with assembly output shares a single line table amongst multiple CUs.
397400 // To avoid the compilation directory being ambiguous, let the line table
3232 ; CHECK: .debug_abbrev.dwo contents:
3333 ; CHECK: Abbrev table for offset: 0x00000000
3434 ; CHECK: [1] DW_TAG_compile_unit DW_CHILDREN_yes
35 ; CHECK: DW_AT_GNU_dwo_name DW_FORM_GNU_str_index
3536 ; CHECK: DW_AT_producer DW_FORM_GNU_str_index
3637 ; CHECK: DW_AT_language DW_FORM_data2
3738 ; CHECK: DW_AT_name DW_FORM_GNU_str_index
6364 ; Check that the rest of the compile units have information.
6465 ; CHECK: .debug_info.dwo contents:
6566 ; CHECK: DW_TAG_compile_unit
66 ; CHECK: DW_AT_producer [DW_FORM_GNU_str_index] ( indexed (00000000) string = "clang version 3.3 (trunk 169021) (llvm/trunk 169020)")
67 ; CHECK: DW_AT_GNU_dwo_name [DW_FORM_GNU_str_index] ( indexed (00000000) string = "baz.dwo")
68 ; CHECK: DW_AT_producer [DW_FORM_GNU_str_index] ( indexed (00000001) string = "clang version 3.3 (trunk 169021) (llvm/trunk 169020)")
6769 ; CHECK: DW_AT_language [DW_FORM_data2] (DW_LANG_C99)
68 ; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000001) string = "baz.c")
70 ; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000002) string = "baz.c")
6971 ; CHECK-NOT: DW_AT_low_pc
7072 ; CHECK-NOT: DW_AT_stmt_list
7173 ; CHECK-NOT: DW_AT_comp_dir
7274 ; CHECK: DW_AT_GNU_dwo_id [DW_FORM_data8] (0x1f1f859683d49324)
7375 ; CHECK: DW_TAG_variable
74 ; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000002) string = "a")
76 ; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000003) string = "a")
7577 ; CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x{{[0-9a-f]*}} => {[[TYPE:0x[0-9a-f]*]]})
7678 ; CHECK: DW_AT_external [DW_FORM_flag_present] (true)
7779 ; CHECK: DW_AT_decl_file [DW_FORM_data1] (0x01)
7880 ; CHECK: DW_AT_decl_line [DW_FORM_data1] (1)
7981 ; CHECK: DW_AT_location [DW_FORM_exprloc] (<0x2> fb 00 )
8082 ; CHECK: [[TYPE]]: DW_TAG_base_type
81 ; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000003) string = "int")
83 ; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000004) string = "int")
8284
8385 ; CHECK: .debug_str contents:
8486 ; CHECK: 0x00000000: "baz.dwo"
8587 ; CHECK: 0x00000008: "/usr/local/google/home/echristo/tmp"
8688
8789 ; CHECK: .debug_str.dwo contents:
88 ; CHECK: 0x00000000: "clang version 3.3 (trunk 169021) (llvm/trunk 169020)"
89 ; CHECK: 0x00000035: "baz.c"
90 ; CHECK: 0x0000003b: "a"
91 ; CHECK: 0x0000003d: "int"
90 ; CHECK: 0x00000000: "baz.dwo"
91 ; CHECK: 0x00000008: "clang version 3.3 (trunk 169021) (llvm/trunk 169020)"
92 ; CHECK: 0x0000003d: "baz.c"
93 ; CHECK: 0x00000043: "a"
94 ; CHECK: 0x00000045: "int"
9295
9396 ; CHECK: .debug_str_offsets.dwo contents:
9497 ; CHECK: 0x00000000: 00000000
95 ; CHECK: 0x00000004: 00000035
96 ; CHECK: 0x00000008: 0000003b
97 ; CHECK: 0x0000000c: 0000003d
98 ; CHECK: 0x00000004: 00000008
99 ; CHECK: 0x00000008: 0000003d
100 ; CHECK: 0x0000000c: 00000043
101 ; CHECK: 0x00000010: 00000045
98102
99103 ; Object file checks
100104 ; For x86-64-linux we should have this set of relocations for the debug info section