[llvm] 9e8bff7 - DebugInfo: Allow dumping macinfo and macinfo.dwo from the same file

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 31 12:47:58 PST 2020


Author: David Blaikie
Date: 2020-01-31T12:47:50-08:00
New Revision: 9e8bff71d073abf0ef7f8bb4ac04ec8689babcad

URL: https://github.com/llvm/llvm-project/commit/9e8bff71d073abf0ef7f8bb4ac04ec8689babcad
DIFF: https://github.com/llvm/llvm-project/commit/9e8bff71d073abf0ef7f8bb4ac04ec8689babcad.diff

LOG: DebugInfo: Allow dumping macinfo and macinfo.dwo from the same file

If dumping an Split DWARF file that hasn't been split into separate
files (such as from llc - that includes the plain and .dwo sections in
the same file) allow both macinfo and macinfo.dwo sections to be dumped.

Added: 
    

Modified: 
    llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
    llvm/test/tools/llvm-dwarfdump/X86/brief.s

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
index e363290212dd..eddc1e91f098 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
@@ -438,14 +438,14 @@ void DWARFContext::dump(
                                    DObj->getEHFrameSection().Data))
     getEHFrame()->dump(OS, getRegisterInfo(), *Off);
 
-  if (DumpType & DIDT_DebugMacro) {
-    if (Explicit || !getDebugMacro()->empty()) {
-      OS << "\n.debug_macinfo contents:\n";
-      getDebugMacro()->dump(OS);
-    } else if (ExplicitDWO || !getDebugMacroDWO()->empty()) {
-      OS << "\n.debug_macinfo.dwo contents:\n";
-      getDebugMacroDWO()->dump(OS);
-    }
+  if (shouldDump(Explicit, ".debug_macinfo", DIDT_ID_DebugMacro,
+                 DObj->getMacinfoSection())) {
+    getDebugMacro()->dump(OS);
+  }
+
+  if (shouldDump(Explicit, ".debug_macinfo.dwo", DIDT_ID_DebugMacro,
+                 DObj->getMacinfoDWOSection())) {
+    getDebugMacroDWO()->dump(OS);
   }
 
   if (shouldDump(Explicit, ".debug_aranges", DIDT_ID_DebugAranges,

diff  --git a/llvm/test/tools/llvm-dwarfdump/X86/brief.s b/llvm/test/tools/llvm-dwarfdump/X86/brief.s
index 98835d435601..090c9be36a87 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/brief.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/brief.s
@@ -150,10 +150,6 @@ Lset3 = Lfunc_end0-Lfunc_begin0         ## DW_AT_high_pc
 	.byte	0                       ## End Of Children Mark
 	.section	__DWARF,__debug_ranges,regular,debug
 Ldebug_range:
-	.section	__DWARF,__debug_macinfo,regular,debug
-Ldebug_macinfo:
-Lcu_macro_begin0:
-	.byte	0                       ## End Of Macro List Mark
 	.section	__DWARF,__apple_names,regular,debug
 Lnames_begin:
 	.long	1212240712              ## Header Magic


        


More information about the llvm-commits mailing list