DebugInfo: Fission: Ensure the address pool entries for location lists are emitted.
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 19 Jun 2014 17:59:14 +0000 (17:59 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 19 Jun 2014 17:59:14 +0000 (17:59 +0000)
The address pool was being emitted before location lists. The latter
could add more entries to the pool which would be lost/never emitted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211284 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp
test/DebugInfo/X86/fission-ranges.ll

index 3847eb124f3d28b794f785d9cef840c55d2efda2..f78ca2c03b4ec247a29ce4e2ee141318da349244 100644 (file)
@@ -1038,9 +1038,9 @@ void DwarfDebug::endModule() {
     emitDebugInfoDWO();
     emitDebugAbbrevDWO();
     emitDebugLineDWO();
+    emitDebugLocDWO();
     // Emit DWO addresses.
     AddrPool.emit(*Asm, Asm->getObjFileLowering().getDwarfAddrSection());
-    emitDebugLocDWO();
   } else
     // Emit info into a debug loc section.
     emitDebugLoc();
index 057039c3c5ccfa20850735e907d1f9d2c18cd564..135837582fcc671462ed00b4bd67079f0ace45ec 100644 (file)
 ; Make sure we don't produce any relocations in any .dwo section (though in particular, debug_info.dwo)
 ; HDR-NOT: .rela.{{.*}}.dwo
 
+; Make sure we have enough stuff in the debug_addr to cover the address indexes
+; (6 is the last index in debug_loc.dwo, making 7 entries of 8 bytes each, 7 * 8
+; == 56 base 10 == 38 base 16)
+
+; HDR: .debug_addr 00000038
+; HDR-NOT: .rela.{{.*}}.dwo
+
 ; From the code:
 
 ; extern int c;