From 9a4f3cb275b148f11850ca24c8ff245990ee327d Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 22 Apr 2016 21:32:59 +0000 Subject: [PATCH] llvm-symbolizer: prefer .dwo contents over fission-gmlt-like-data when .dwo file is present Rather than relying on the gmlt-like data emitted into the .o/executable which only contains the simple name of any inlined functions, use the .dwo file if present. Test symbolication with/without a .dwo, and the old test that was testing behavior when no gmlt-like data was present. (I haven't included a test of non-gmlt-like data + no .dwo (that would be akin to symbolication with no debug info) but we could add one for completeness) The test was simplified a bit to be a little clearer (unoptimized, force inline, using a function call as the inlined entity) and regenerated with ToT clang. For the no-gmlt-like-data case, I modified Clang back to its old behavior temporarily & the .dwo file is identical so it is shared between the two executables. llvm-svn: 267227 --- llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp | 19 +++++------- llvm/test/DebugInfo/Inputs/split-dwarf-test | Bin 9379 -> 9208 bytes llvm/test/DebugInfo/Inputs/split-dwarf-test-nogmlt | Bin 0 -> 9128 bytes llvm/test/DebugInfo/Inputs/split-dwarf-test.cc | 13 +++++--- llvm/test/DebugInfo/Inputs/split-dwarf-test.dwo | Bin 1609 -> 1377 bytes llvm/test/DebugInfo/llvm-symbolizer.test | 34 +++++++++++++++------ 6 files changed, 40 insertions(+), 26 deletions(-) create mode 100755 llvm/test/DebugInfo/Inputs/split-dwarf-test-nogmlt diff --git a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp index fdc9da3..0430265 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp @@ -378,19 +378,14 @@ DWARFUnit::getInlinedChainForAddress(uint64_t Address) { // First, find a subprogram that contains the given address (the root // of inlined chain). const DWARFUnit *ChainCU = nullptr; - const DWARFDebugInfoEntryMinimal *SubprogramDIE = - getSubprogramForAddress(Address); - if (SubprogramDIE) { + const DWARFDebugInfoEntryMinimal *SubprogramDIE; + // Try to look for subprogram DIEs in the DWO file. + parseDWO(); + if (DWO) { + if ((SubprogramDIE = DWO->getUnit()->getSubprogramForAddress(Address))) + ChainCU = DWO->getUnit(); + } else if ((SubprogramDIE = getSubprogramForAddress(Address))) ChainCU = this; - } else { - // Try to look for subprogram DIEs in the DWO file. - parseDWO(); - if (DWO.get()) { - SubprogramDIE = DWO->getUnit()->getSubprogramForAddress(Address); - if (SubprogramDIE) - ChainCU = DWO->getUnit(); - } - } // Get inlined chain rooted at this subprogram DIE. if (!SubprogramDIE) diff --git a/llvm/test/DebugInfo/Inputs/split-dwarf-test b/llvm/test/DebugInfo/Inputs/split-dwarf-test index a4411129a9b677d643c68bd8991f8a4d69a5a7b8..4d6aa0cd98a34dbda578f74b1174b56542859fad 100755 GIT binary patch literal 9208 zcmeHNeQX>@6`wtS=IeY(6XGPKIgmrn4c_?9i8+&$-uWXrr%oK4bDOkrSLeI6eQ;m8 z+jDFpL5oSiYSJ1ZP(>yFfKnRx2h<9Jgs6i{lm3M(6%+HU+dp(s_-s1j<9_h#Qa zZ^pI+2>v2Z-hJ~ves5;p&g{<2`72#L`(2tQm|Ws>0;TE7kW|@sAueo^BI$x+g$Rj8 z;S<%Mse~&eEy(Q>^A9OB^IGz&0FJnz%T@$kAz5Jlaa%2za|@AIk%mY6X*V6-|&i(KI#gAgmMU(=#=*b zj=o4ou38B!pQV1BtqGwTWSj4kk`T-p_j$l!JO5qkBiwR%S$IBnWbWUtRC2I&_pVf; zDV59=$C}21txc`F^+Hw;$bMtmG3N&k_e&t>u^uFB^Ln^&450nxz^)a;kL>!%GpD|M z{>-OOeI|L*EP!cA!kFupurz|syM#Wtj6S-IKC_Ho7zXq>ZWOFo-ZIj$WJVn5>2B{Z z0(wB-BhZGOZw0^MbT&hNhA_ILhm3@oH;0o2%gjd)b)>QxGa4IAnYL|d%fV5jk02eX zSfKz3fhr1CBEEB{T@Q%qa%ngYEknuADd6#rd@=E$#b>06ZQwxDL=-nCR|pu?_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QCpc-~hqp8c5r z4Dh%YV43#=asdZ64K5^ZKgY4OLfn7?>KL!lcU&V!?kC1^{;cmHd>aMi{a%m&ydOjn z+oIxe{f2$Y-#^|z4HKUCP2eJl)GUfFDB1Col>eksKLb2eV7^Vk^EzgV@ZZMZHewvB z9tOL;e%|l#k7l@*wv(Fw3xwz2o_L*;qYhF1S!RBS@cjHnYeKTRQNpjqd-bzcr`E8cdP=wZZ$?( zOe%f`TvQ#R7_Zt?`Q-}uWmG@U^B5CJ#V420q2I%VZ$!aHD*iFBsXBB&NO*PrSAF+^ zLe(KYLHJ`R*huwtf&$ksDqSSJ`u?cz@7Dm&bEiGVEa6|Kfq~x{JSXDu$Nl;&;CbxW b@u%p(lmAbGZEF5cSHNGS7x%mZP(<-hi4fr^ literal 0 HcmV?d00001 diff --git a/llvm/test/DebugInfo/Inputs/split-dwarf-test.cc b/llvm/test/DebugInfo/Inputs/split-dwarf-test.cc index 5ed56f9..b41423d 100644 --- a/llvm/test/DebugInfo/Inputs/split-dwarf-test.cc +++ b/llvm/test/DebugInfo/Inputs/split-dwarf-test.cc @@ -1,13 +1,16 @@ -int foo(int a) { - return a + 1; +void f1() { } -int main(int argc, char *argv[]) { - return foo(argc); +inline __attribute__((always_inline)) void f2() { + f1(); +} + +int main() { + f2(); } // Build instructions: -// 1) clang++ -### -O2 -gsplit-dwarf.cc split-dwarf-test.cc -o split-dwarf-test +// 1) clang++ -### -gsplit-dwarf split-dwarf-test.cc -o split-dwarf-test // 2) Replace the value "-fdebug-compilation-dir" flag to "Output" // (this is the temp directory used by lit). // 3) Manually run clang-cc1, objcopy and ld invocations. diff --git a/llvm/test/DebugInfo/Inputs/split-dwarf-test.dwo b/llvm/test/DebugInfo/Inputs/split-dwarf-test.dwo index 74183a4b622fbce4e7163fdc4b8ca37026265aff..588374d7d21e1830d12b1bee2dfa67ce640322c4 100644 GIT binary patch literal 1377 zcmbtUO>fgc5S_JSC&dDkMo2{n$%j^Ik>WOvs2Yk)T8S^I2TlmMBu-)nQ^%&Zo2rKj z;a|cLaiTXaT=)%$JHLYqGxnNT8zT-(G@hCF-t3O;jo&>ydL%Ihg)y*TQ57h_p0vpO zS=xsyP>1-f?Ydpq8*}#ibCujxKhEfC8WS0I~sPK-X{#gK;U>J#CRvxec9GM!e8o zqD)-}DwHPsVJGKjgS*Dl7HY}v(!tes3l$&G*n)4 zVJdK9Kh>pA!XNdQ{J#btIkJM0PH%(PYbCsD|Dlo#s`lfp{|xfd-R3QF<;3(HswN?v R-;A)M41CBXoW3Z6{RX0Yev<$I literal 1609 zcmbtUOKTHR6h3!ec}!Gd7A8nB3&j@ckXW$R$22NR3+loLt%8KfWReb~Gi7E>shiLU zTF`~i{~@?@Be-Ys{R<&nibqf1?dzyiossD#wK#F=vVdC%5tr)1E?xY5bS!EB2(8f zlgoCRaF%PhGPRr_00oSznYcK^nw5Bqb^Qr;(kV|Xlup1Z8n6eJ*RKzqAas4NzF=H3 z8ui(W&Bf;8(j0_a12>xQZd*ZbK61jyux)5RUFi9~3#h>LBCuf7ay_tuzD;Tf_J$QC zSC1O63*`8_CO%Gt8I&f<63TTHy82rvD=7C+9-tgUkpM3d82f#k8W`cuW@L5HMnPgX zQm^ZDp7-0X*Yl0;whu-UM>|_im<6m(Cvb*Y1RG?-fp2F+%(nerFLa{6+6-LJiD|gh z|DV&?BEBD?Rg1^(1YG1^z`Tf2$ycE+4MpxXOo$k9)B2BTA-5v;KH`Km1l}Get_gTr zpW0`> %t.input RUN: echo "%p/Inputs/fission-ranges.elf-x86_64 0x720" >> %t.input RUN: echo "%p/Inputs/arange-overlap.elf-x86_64 0x714" >> %t.input RUN: cp %p/Inputs/split-dwarf-test.dwo %T -RUN: echo "%p/Inputs/split-dwarf-test 0x4004d0" >> %t.input -RUN: echo "%p/Inputs/split-dwarf-test 0x4004c0" >> %t.input +RUN: echo "%p/Inputs/split-dwarf-test 0x4005d4" >> %t.input +RUN: echo "%p/Inputs/split-dwarf-test 0x4005c4" >> %t.input RUN: echo "%p/Inputs/cross-cu-inlining.x86_64-macho.o 0x17" >> %t.input RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \ -RUN: --default-arch=i386 < %t.input | FileCheck %s +RUN: --default-arch=i386 < %t.input | FileCheck --check-prefix=CHECK --check-prefix=SPLIT --check-prefix=DWO %s + +Ensure we get the same results in the absence of gmlt-like data in the executable but the presence of a .dwo file + +RUN: echo "%p/Inputs/split-dwarf-test-nogmlt 0x4005d4" >> %t.input +RUN: echo "%p/Inputs/split-dwarf-test-nogmlt 0x4005c4" >> %t.input +RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \ +RUN: --default-arch=i386 < %t.input | FileCheck --check-prefix=SPLIT --check-prefix=DWO %s + +Ensure we get gmlt like results in the absence of a .dwo file but the presence of gmlt-like data in the executable + +RUN: rm %T/split-dwarf-test.dwo +RUN: echo "%p/Inputs/split-dwarf-test 0x4005d4" >> %t.input +RUN: echo "%p/Inputs/split-dwarf-test 0x4005c4" >> %t.input +RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \ +RUN: --default-arch=i386 < %t.input | FileCheck --check-prefix=SPLIT --check-prefix=NODWO %s CHECK: main CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16 @@ -102,13 +117,14 @@ CHECK-NEXT: {{.*}}fission-ranges.cc:6 CHECK: _ZN1S3bazEv CHECK-NEXT: {{.*}}arange-overlap.cc:6 -CHECK: _Z3fooi -CHECK-NEXT: {{.*}}split-dwarf-test.cc -CHECK-NEXT: main -CHECK-NEXT: {{.*}}split-dwarf-test.cc +DWO: _Z2f2v +NODWO: {{^f2$}} +SPLIT-NEXT: {{.*}}split-dwarf-test.cc +SPLIT-NEXT: main +SPLIT-NEXT: {{.*}}split-dwarf-test.cc -CHECK: _Z3fooi -CHECK-NEXT: {{.*}}split-dwarf-test.cc +SPLIT: _Z2f1v +SPLIT-NEXT: {{.*}}split-dwarf-test.cc ; func has been inlined into main by LTO. Check that the symbolizer is able ; to resolve the cross-cu reference and retrieve func's name -- 2.7.4