1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

[DebugInfo] Fix v4 macinfo for dwo files.

Dwo files must contain have DW_AT_macro_info attribute, when macro information is emitted. Adjusted the test case
for the same.
This commit is contained in:
Sourabh Singh Tomar 2019-12-24 11:38:38 +05:30
parent 3870b03c7c
commit 55e59a9eba
2 changed files with 14 additions and 4 deletions

View File

@ -1193,10 +1193,15 @@ void DwarfDebug::finalizeModuleInfo() {
auto *CUNode = cast<DICompileUnit>(P.first);
// If compile Unit has macros, emit "DW_AT_macro_info" attribute.
if (CUNode->getMacros() && !useSplitDwarf())
U.addSectionLabel(U.getUnitDie(), dwarf::DW_AT_macro_info,
U.getMacroLabelBegin(),
TLOF.getDwarfMacinfoSection()->getBeginSymbol());
if (CUNode->getMacros())
if (useSplitDwarf())
TheCU.addLabelDelta(TheCU.getUnitDie(), dwarf::DW_AT_macro_info,
U.getMacroLabelBegin(),
TLOF.getDwarfMacinfoDWOSection()->getBeginSymbol());
else
U.addSectionLabel(U.getUnitDie(), dwarf::DW_AT_macro_info,
U.getMacroLabelBegin(),
TLOF.getDwarfMacinfoSection()->getBeginSymbol());
}
// Emit all frontend-produced Skeleton CUs, i.e., Clang modules.

View File

@ -1,5 +1,10 @@
; RUN: %llc_dwarf -O0 -split-dwarf-file=foo.dwo -filetype=obj < %s | llvm-dwarfdump -v - | FileCheck %s
; CHECK-LABEL:.debug_info.dwo contents:
; CHECK: DW_AT_GNU_dwo_name [DW_FORM_GNU_str_index] (indexed (00000006) string = "foo.dwo")
; CHECK-NEXT: DW_AT_GNU_dwo_id [DW_FORM_data8] (0xe0f109905cbe1fe4)
; CHECK-NEXT: DW_AT_macro_info [DW_FORM_data4] (0x00000000)
;CHECK-LABEL:.debug_macinfo.dwo contents:
;CHECK-NEXT: DW_MACINFO_start_file - lineno: 0 filenum: 1
;CHECK-NEXT: DW_MACINFO_start_file - lineno: 1 filenum: 2