<div dir="ltr">(for history/tracking) This was reverted in <span style="color:rgb(33,33,33)">r349333 due to internal test failures I'm investigating.</span></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 17, 2018 at 12:30 AM David Blaikie via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: dblaikie<br>
Date: Mon Dec 17 00:27:19 2018<br>
New Revision: 349333<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=349333&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=349333&view=rev</a><br>
Log:<br>
DebugInfo: Assume an absence of ranges or high_pc on a CU means the CU is empty (devoid of code addresses)<br>
<br>
GCC emitted these unconditionally on/before 4.4/March 2012<br>
Clang emitted these unconditionally on/before 3.5/March 2014<br>
<br>
This improves performance when parsing CUs (especially those using split<br>
DWARF) that contain no code ranges (such as the mini CUs that may be<br>
created by ThinLTO importing - though generally they should be/are<br>
avoided, especially for Split DWARF because it produces a lot of very<br>
small CUs, which don't scale well in a bunch of other ways too<br>
(including size)).<br>
<br>
Modified:<br>
    llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp<br>
    llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test.elf-x86-64<br>
    llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test.elf-x86-64.debuglink<br>
    llvm/trunk/test/DebugInfo/Inputs/llvm-symbolizer-test.elf-x86-64<br>
    llvm/trunk/test/DebugInfo/Inputs/test-inline.o<br>
    llvm/trunk/test/DebugInfo/Inputs/test-parameters.o<br>
    llvm/trunk/test/DebugInfo/debuglineinfo.test<br>
    llvm/trunk/test/DebugInfo/llvm-symbolizer-split-dwarf-no-skel-address.test<br>
    llvm/trunk/test/DebugInfo/llvm-symbolizer.test<br>
<br>
Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp?rev=349333&r1=349332&r2=349333&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp?rev=349333&r1=349332&r2=349333&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp (original)<br>
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp Mon Dec 17 00:27:19 2018<br>
@@ -581,27 +581,6 @@ void DWARFUnit::collectAddressRanges(DWA<br>
   } else<br>
     WithColor::error() << "decoding address ranges: "<br>
                        << toString(CUDIERangesOrError.takeError()) << '\n';<br>
-<br>
-  // This function is usually called if there in no .debug_aranges section<br>
-  // in order to produce a compile unit level set of address ranges that<br>
-  // is accurate. If the DIEs weren't parsed, then we don't want all dies for<br>
-  // all compile units to stay loaded when they weren't needed. So we can end<br>
-  // up parsing the DWARF and then throwing them all away to keep memory usage<br>
-  // down.<br>
-  const bool ClearDIEs = extractDIEsIfNeeded(false) > 1;<br>
-  getUnitDIE().collectChildrenAddressRanges(CURanges);<br>
-<br>
-  // Collect address ranges from DIEs in .dwo if necessary.<br>
-  bool DWOCreated = parseDWO();<br>
-  if (DWO)<br>
-    DWO->collectAddressRanges(CURanges);<br>
-  if (DWOCreated)<br>
-    DWO.reset();<br>
-<br>
-  // Keep memory down by clearing DIEs if this generate function<br>
-  // caused them to be parsed.<br>
-  if (ClearDIEs)<br>
-    clearDIEs(true);<br>
 }<br>
<br>
 void DWARFUnit::updateAddressDieMap(DWARFDie Die) {<br>
<br>
Modified: llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test.elf-x86-64<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test.elf-x86-64?rev=349333&r1=349332&r2=349333&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test.elf-x86-64?rev=349333&r1=349332&r2=349333&view=diff</a><br>
==============================================================================<br>
Binary files - no diff available.<br>
<br>
Modified: llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test.elf-x86-64.debuglink<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test.elf-x86-64.debuglink?rev=349333&r1=349332&r2=349333&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-test.elf-x86-64.debuglink?rev=349333&r1=349332&r2=349333&view=diff</a><br>
==============================================================================<br>
Binary files - no diff available.<br>
<br>
Modified: llvm/trunk/test/DebugInfo/Inputs/llvm-symbolizer-test.elf-x86-64<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/llvm-symbolizer-test.elf-x86-64?rev=349333&r1=349332&r2=349333&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/llvm-symbolizer-test.elf-x86-64?rev=349333&r1=349332&r2=349333&view=diff</a><br>
==============================================================================<br>
Binary files - no diff available.<br>
<br>
Modified: llvm/trunk/test/DebugInfo/Inputs/test-inline.o<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/test-inline.o?rev=349333&r1=349332&r2=349333&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/test-inline.o?rev=349333&r1=349332&r2=349333&view=diff</a><br>
==============================================================================<br>
Binary files - no diff available.<br>
<br>
Modified: llvm/trunk/test/DebugInfo/Inputs/test-parameters.o<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/test-parameters.o?rev=349333&r1=349332&r2=349333&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/test-parameters.o?rev=349333&r1=349332&r2=349333&view=diff</a><br>
==============================================================================<br>
Binary files - no diff available.<br>
<br>
Modified: llvm/trunk/test/DebugInfo/debuglineinfo.test<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/debuglineinfo.test?rev=349333&r1=349332&r2=349333&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/debuglineinfo.test?rev=349333&r1=349332&r2=349333&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/debuglineinfo.test (original)<br>
+++ llvm/trunk/test/DebugInfo/debuglineinfo.test Mon Dec 17 00:27:19 2018<br>
@@ -1,50 +1,19 @@<br>
 RUN: llvm-rtdyld -printline %p/Inputs/test-inline.o \<br>
-RUN:   | FileCheck %s -check-prefix TEST_INLINE<br>
+RUN:   | FileCheck %s<br>
 RUN: llvm-rtdyld -printdebugline %p/Inputs/test-inline.o \<br>
-RUN:   | FileCheck %s -check-prefix TEST_INLINE<br>
+RUN:   | FileCheck %s<br>
 RUN: llvm-rtdyld -printline %p/Inputs/test-parameters.o \<br>
-RUN:   | FileCheck %s -check-prefix TEST_PARAMETERS<br>
+RUN:   | FileCheck %s<br>
 RUN: llvm-rtdyld -printdebugline %p/Inputs/test-parameters.o \<br>
-RUN:   | FileCheck %s -check-prefix TEST_PARAMETERS<br>
+RUN:   | FileCheck %s<br>
<br>
 ; This test verifies that relocations are correctly applied to the<br>
 ; .debug_line section and exercises DIContext::getLineInfoForAddressRange().<br>
-; If relocations are not applied the first two functions will be reported as<br>
-; both starting at address zero in the; line number table.<br>
-TEST_INLINE:      Function: _Z15test_parametersPfPA2_dR11char_structPPitm, Size = 170<br>
-TEST_INLINE-NEXT: Line info @ 0: test-inline.cpp, line:33<br>
-TEST_INLINE-NEXT: Line info @ 35: test-inline.cpp, line:34<br>
-TEST_INLINE-NEXT: Line info @ 165: test-inline.cpp, line:35<br>
-TEST_INLINE-NEXT: Function: _Z3foov, Size = 3<br>
-TEST_INLINE-NEXT: Line info @ 0: test-inline.cpp, line:28<br>
-TEST_INLINE-NEXT: Line info @ 2: test-inline.cpp, line:29<br>
-TEST_INLINE-NEXT: Function: main, Size = 146<br>
-TEST_INLINE-NEXT: Line info @ 0: test-inline.cpp, line:39<br>
-TEST_INLINE-NEXT: Line info @ 21: test-inline.cpp, line:41<br>
-TEST_INLINE-NEXT: Line info @ 39: test-inline.cpp, line:42<br>
-TEST_INLINE-NEXT: Line info @ 60: test-inline.cpp, line:44<br>
-TEST_INLINE-NEXT: Line info @ 80: test-inline.cpp, line:48<br>
-TEST_INLINE-NEXT: Line info @ 90: test-inline.cpp, line:45<br>
-TEST_INLINE-NEXT: Line info @ 95: test-inline.cpp, line:46<br>
-TEST_INLINE-NEXT: Line info @ 114: test-inline.cpp, line:48 <br>
-TEST_INLINE-NEXT: Line info @ 141: test-inline.cpp, line:49<br>
-<br>
-; This test checks the case where all code is in a single section.<br>
-TEST_PARAMETERS:      Function: _Z15test_parametersPfPA2_dR11char_structPPitm, Size = 170<br>
-TEST_PARAMETERS-NEXT: Line info @ 0: test-parameters.cpp, line:33<br>
-TEST_PARAMETERS-NEXT: Line info @ 35: test-parameters.cpp, line:34<br>
-TEST_PARAMETERS-NEXT: Line info @ 165: test-parameters.cpp, line:35<br>
-TEST_PARAMETERS-NEXT: Function: _Z3foov, Size = 3<br>
-TEST_PARAMETERS-NEXT: Line info @ 0: test-parameters.cpp, line:28<br>
-TEST_PARAMETERS-NEXT: Line info @ 2: test-parameters.cpp, line:29<br>
-TEST_PARAMETERS-NEXT: Function: main, Size = 146<br>
-TEST_PARAMETERS-NEXT: Line info @ 0: test-parameters.cpp, line:39<br>
-TEST_PARAMETERS-NEXT: Line info @ 21: test-parameters.cpp, line:41<br>
-TEST_PARAMETERS-NEXT: Line info @ 39: test-parameters.cpp, line:42<br>
-TEST_PARAMETERS-NEXT: Line info @ 60: test-parameters.cpp, line:44<br>
-TEST_PARAMETERS-NEXT: Line info @ 80: test-parameters.cpp, line:48<br>
-TEST_PARAMETERS-NEXT: Line info @ 90: test-parameters.cpp, line:45<br>
-TEST_PARAMETERS-NEXT: Line info @ 95: test-parameters.cpp, line:46<br>
-TEST_PARAMETERS-NEXT: Line info @ 114: test-parameters.cpp, line:48 <br>
-TEST_PARAMETERS-NEXT: Line info @ 141: test-parameters.cpp, line:49<br>
<br>
+CHECK:      Function: _Z2f1v, Size = 6<br>
+CHECK-NEXT:   Line info @ 0: test-inline.cpp, line:1<br>
+CHECK-NEXT:   Line info @ 4: test-inline.cpp, line:1<br>
+CHECK-NEXT: Function: _Z2f2v, Size = 11<br>
+CHECK-NEXT:   Line info @ 0: test-inline.cpp, line:2<br>
+CHECK-NEXT:   Line info @ 4: test-inline.cpp, line:2<br>
+CHECK-NEXT:   Line info @ 9: test-inline.cpp, line:2<br>
<br>
Modified: llvm/trunk/test/DebugInfo/llvm-symbolizer-split-dwarf-no-skel-address.test<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/llvm-symbolizer-split-dwarf-no-skel-address.test?rev=349333&r1=349332&r2=349333&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/llvm-symbolizer-split-dwarf-no-skel-address.test?rev=349333&r1=349332&r2=349333&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/llvm-symbolizer-split-dwarf-no-skel-address.test (original)<br>
+++ llvm/trunk/test/DebugInfo/llvm-symbolizer-split-dwarf-no-skel-address.test Mon Dec 17 00:27:19 2018<br>
@@ -15,5 +15,8 @@ Compiled to assembly with clang, modifie<br>
 high/low pc (& update the CU length field and abbrev to match) & then<br>
 compile/objcopy to make the .o and .dwo.<br>
<br>
-CHECK: _Z2f2v<br>
-CHECK: test.cpp:2:51<br>
+Ensure that the f2 inlined frame is not included - it's inefficient to have to<br>
+go and load all the debug info and search for the address ranges, so assume<br>
+that a lack of ranges on the CU means the CU covers no addresses.<br>
+<br>
+CHECK-NOT: _Z2f2v<br>
<br>
Modified: llvm/trunk/test/DebugInfo/llvm-symbolizer.test<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/llvm-symbolizer.test?rev=349333&r1=349332&r2=349333&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/llvm-symbolizer.test?rev=349333&r1=349332&r2=349333&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/llvm-symbolizer.test (original)<br>
+++ llvm/trunk/test/DebugInfo/llvm-symbolizer.test Mon Dec 17 00:27:19 2018<br>
@@ -1,10 +1,10 @@<br>
 RUN: rm -rf %t<br>
 RUN: mkdir -p %t<br>
-RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400559" > %t.input<br>
-RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64.debuglink 0x400559" >> %t.input<br>
-RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400436" >> %t.input<br>
-RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400528" >> %t.input<br>
-RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400586" >> %t.input<br>
+RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x40113f" > %t.input<br>
+RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64.debuglink 0x40113f" >> %t.input<br>
+RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x401020" >> %t.input<br>
+RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x40110e" >> %t.input<br>
+RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x401160" >> %t.input<br>
 RUN: echo "%p/Inputs/dwarfdump-test2.elf-x86-64 0x4004e8" >> %t.input<br>
 RUN: echo "%p/Inputs/dwarfdump-test2.elf-x86-64 0x4004f4" >> %t.input<br>
 RUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" >> %t.input<br>
@@ -181,8 +181,8 @@ UNKNOWN-ARCH-NOT: main<br>
 UNKNOWN-ARCH: ??<br>
 UNKNOWN-ARCH-NOT: main<br>
<br>
-RUN: echo "0x400559" > %t.input4<br>
-RUN: echo "0x400436" >> %t.input4<br>
+RUN: echo "0x40113f" > %t.input4<br>
+RUN: echo "0x401020" >> %t.input4<br>
 RUN: llvm-symbolizer --obj %p/Inputs/dwarfdump-test.elf-x86-64 < %t.input4 \<br>
 RUN:   | FileCheck %s --check-prefix=BINARY<br>
<br>
@@ -190,9 +190,9 @@ BINARY:       main<br>
 BINARY-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16<br>
 BINARY:      _start<br>
<br>
-RUN: echo "0x400720" > %t.input5<br>
-RUN: echo "0x4004a0" >> %t.input5<br>
-RUN: echo "0x4006f0" >> %t.input5<br>
+RUN: echo "0x401140" > %t.input5<br>
+RUN: echo "0x401020" >> %t.input5<br>
+RUN: echo "0x401120" >> %t.input5<br>
 RUN: llvm-symbolizer --obj %p/Inputs/llvm-symbolizer-test.elf-x86-64 < %t.input5 \<br>
 RUN:   | FileCheck %s --check-prefix=BINARY_C<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>