<p dir="ltr"><br>
On Apr 21, 2014 4:58 PM, "Alexey Samsonov" <<a href="mailto:samsonov@google.com">samsonov@google.com</a>> wrote:<br>
><br>
> On Mon, Apr 21, 2014 at 4:56 PM, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:<br>
>><br>
>> On Mon, Apr 21, 2014 at 4:16 PM, Alexey Samsonov <<a href="mailto:samsonov@google.com">samsonov@google.com</a>> wrote:<br>
>> ><br>
>> > On Mon, Apr 21, 2014 at 11:09 AM, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> I worry that this will give the inaccurate answers that we were<br>
>> >> worried about without -gmlt turned on (inlining issues primarily).<br>
>> >><br>
>> >><br>
>> >> Thoughts? Some, maybe slightly inaccurate, info is better than no info?<br>
>> ><br>
>> ><br>
>> > Yes, I guess so. We will still get a correct file/line data, but if the<br>
>> > PC/address belongs to<br>
>> > an inlined call, we might print the function name it was inlined into,<br>
>> > instead of the name of inlined subroutine.<br>
>> > This is still probably better than no information at all.<br>
>><br>
>> Sure. Might be worth putting out a note as part of the inline symbolication?<br>
><br>
><br>
> What do you mean by "note" here? I'd rather not output extra information to keep<br>
> symbolizer output machine-readable.<br>
>  </p>
<p dir="ltr">Seems reasonable. </p>
<p dir="ltr">>><br>
>><br>
>> -eric<br>
>><br>
>> ><br>
>> >><br>
>> >><br>
>> >> -eric<br>
>> >><br>
>> >> On Fri, Apr 18, 2014 at 3:22 PM, Alexey Samsonov <<a href="mailto:samsonov@google.com">samsonov@google.com</a>><br>
>> >> wrote:<br>
>> >> > Author: samsonov<br>
>> >> > Date: Fri Apr 18 17:22:44 2014<br>
>> >> > New Revision: 206665<br>
>> >> ><br>
>> >> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=206665&view=rev">http://llvm.org/viewvc/llvm-project?rev=206665&view=rev</a><br>
>> >> > Log:<br>
>> >> > [llvm-symbolizer] Print file/line for a PC even if there is no DIE<br>
>> >> > describing it.<br>
>> >> ><br>
>> >> > This is important for symbolizing executables with debug info in<br>
>> >> > unavailable .dwo files. Even if all DIE entries are missing, we can<br>
>> >> > still symbolize an address: function name can be fetched from symbol<br>
>> >> > table,<br>
>> >> > and file/line info can be fetched from line table.<br>
>> >> ><br>
>> >> > Added:<br>
>> >> >     llvm/trunk/test/DebugInfo/Inputs/llvm-symbolizer-dwo-test   (with<br>
>> >> > props)<br>
>> >> >     llvm/trunk/test/DebugInfo/Inputs/llvm-symbolizer-dwo-test.cc<br>
>> >> > Modified:<br>
>> >> >     llvm/trunk/lib/DebugInfo/DWARFContext.cpp<br>
>> >> >     llvm/trunk/test/DebugInfo/llvm-symbolizer.test<br>
>> >> ><br>
>> >> > Modified: llvm/trunk/lib/DebugInfo/DWARFContext.cpp<br>
>> >> > URL:<br>
>> >> > <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFContext.cpp?rev=206665&r1=206664&r2=206665&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFContext.cpp?rev=206665&r1=206664&r2=206665&view=diff</a><br>

>> >> ><br>
>> >> > ==============================================================================<br>
>> >> > --- llvm/trunk/lib/DebugInfo/DWARFContext.cpp (original)<br>
>> >> > +++ llvm/trunk/lib/DebugInfo/DWARFContext.cpp Fri Apr 18 17:22:44 2014<br>
>> >> > @@ -545,18 +545,32 @@ DILineInfoTable DWARFContext::getLineInf<br>
>> >> ><br>
>> >> >  DIInliningInfo DWARFContext::getInliningInfoForAddress(uint64_t<br>
>> >> > Address,<br>
>> >> >      DILineInfoSpecifier Specifier) {<br>
>> >> > +  DIInliningInfo InliningInfo;<br>
>> >> > +<br>
>> >> >    DWARFCompileUnit *CU = getCompileUnitForAddress(Address);<br>
>> >> >    if (!CU)<br>
>> >> > -    return DIInliningInfo();<br>
>> >> > +    return InliningInfo;<br>
>> >> ><br>
>> >> > +  const DWARFLineTable *LineTable = nullptr;<br>
>> >> > +  const bool NeedsAbsoluteFilePath =<br>
>> >> > +      Specifier.needs(DILineInfoSpecifier::AbsoluteFilePath);<br>
>> >> >    const DWARFDebugInfoEntryInlinedChain &InlinedChain =<br>
>> >> >        CU->getInlinedChainForAddress(Address);<br>
>> >> > -  if (InlinedChain.DIEs.size() == 0)<br>
>> >> > -    return DIInliningInfo();<br>
>> >> > +  if (InlinedChain.DIEs.size() == 0) {<br>
>> >> > +    // If there is no DIE for address (e.g. it is in unavailable .dwo<br>
>> >> > file),<br>
>> >> > +    // try to at least get file/line info from symbol table.<br>
>> >> > +    if (Specifier.needs(DILineInfoSpecifier::FileLineInfo)) {<br>
>> >> > +      DILineInfo Frame;<br>
>> >> > +      LineTable = getLineTableForCompileUnit(CU);<br>
>> >> > +      if (getFileLineInfoForCompileUnit(CU, LineTable, Address,<br>
>> >> > +                                        NeedsAbsoluteFilePath, Frame))<br>
>> >> > {<br>
>> >> > +        InliningInfo.addFrame(Frame);<br>
>> >> > +      }<br>
>> >> > +    }<br>
>> >> > +    return InliningInfo;<br>
>> >> > +  }<br>
>> >> ><br>
>> >> > -  DIInliningInfo InliningInfo;<br>
>> >> >    uint32_t CallFile = 0, CallLine = 0, CallColumn = 0;<br>
>> >> > -  const DWARFLineTable *LineTable = nullptr;<br>
>> >> >    for (uint32_t i = 0, n = InlinedChain.DIEs.size(); i != n; i++) {<br>
>> >> >      const DWARFDebugInfoEntryMinimal &FunctionDIE =<br>
>> >> > InlinedChain.DIEs[i];<br>
>> >> >      DILineInfo Frame;<br>
>> >> > @@ -566,16 +580,13 @@ DIInliningInfo DWARFContext::getInlining<br>
>> >> >          Frame.FunctionName = Name;<br>
>> >> >      }<br>
>> >> >      if (Specifier.needs(DILineInfoSpecifier::FileLineInfo)) {<br>
>> >> > -      const bool NeedsAbsoluteFilePath =<br>
>> >> > -          Specifier.needs(DILineInfoSpecifier::AbsoluteFilePath);<br>
>> >> >        if (i == 0) {<br>
>> >> >          // For the topmost frame, initialize the line table of this<br>
>> >> >          // compile unit and fetch file/line info from it.<br>
>> >> >          LineTable = getLineTableForCompileUnit(CU);<br>
>> >> >          // For the topmost routine, get file/line info from line table.<br>
>> >> >          getFileLineInfoForCompileUnit(CU, LineTable, Address,<br>
>> >> > -                                      NeedsAbsoluteFilePath,<br>
>> >> > -                                      Frame);<br>
>> >> > +                                      NeedsAbsoluteFilePath, Frame);<br>
>> >> >        } else {<br>
>> >> >          // Otherwise, use call file, call line and call column from<br>
>> >> >          // previous DIE in inlined chain.<br>
>> >> ><br>
>> >> > Added: llvm/trunk/test/DebugInfo/Inputs/llvm-symbolizer-dwo-test<br>
>> >> > URL:<br>
>> >> > <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/llvm-symbolizer-dwo-test?rev=206665&view=auto">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/llvm-symbolizer-dwo-test?rev=206665&view=auto</a><br>

>> >> ><br>
>> >> > ==============================================================================<br>
>> >> > Binary file - no diff available.<br>
>> >> ><br>
>> >> > Propchange: llvm/trunk/test/DebugInfo/Inputs/llvm-symbolizer-dwo-test<br>
>> >> ><br>
>> >> > ------------------------------------------------------------------------------<br>
>> >> >     svn:executable = *<br>
>> >> ><br>
>> >> > Propchange: llvm/trunk/test/DebugInfo/Inputs/llvm-symbolizer-dwo-test<br>
>> >> ><br>
>> >> > ------------------------------------------------------------------------------<br>
>> >> >     svn:mime-type = application/octet-stream<br>
>> >> ><br>
>> >> > Added: llvm/trunk/test/DebugInfo/Inputs/llvm-symbolizer-dwo-test.cc<br>
>> >> > URL:<br>
>> >> > <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/llvm-symbolizer-dwo-test.cc?rev=206665&view=auto">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/llvm-symbolizer-dwo-test.cc?rev=206665&view=auto</a><br>

>> >> ><br>
>> >> > ==============================================================================<br>
>> >> > --- llvm/trunk/test/DebugInfo/Inputs/llvm-symbolizer-dwo-test.cc (added)<br>
>> >> > +++ llvm/trunk/test/DebugInfo/Inputs/llvm-symbolizer-dwo-test.cc Fri Apr<br>
>> >> > 18 17:22:44 2014<br>
>> >> > @@ -0,0 +1,18 @@<br>
>> >> > +int f(int a, int b) {<br>
>> >> > +  return a + b;<br>
>> >> > +}<br>
>> >> > +<br>
>> >> > +int g(int a) {<br>
>> >> > +  return a + 1;<br>
>> >> > +}<br>
>> >> > +<br>
>> >> > +<br>
>> >> > +int main() {<br>
>> >> > +  return f(2, g(2));<br>
>> >> > +}<br>
>> >> > +<br>
>> >> > +// Built with Clang 3.5.0:<br>
>> >> > +// $ mkdir -p /tmp/dbginfo<br>
>> >> > +// $ cp llvm-symbolizer-dwo-test.cc /tmp/dbginfo<br>
>> >> > +// $ cd /tmp/dbginfo<br>
>> >> > +// $ clang -gsplit-dwarf llvm-symbolizer-dwo-test.cc<br>
>> >> ><br>
>> >> > Modified: llvm/trunk/test/DebugInfo/llvm-symbolizer.test<br>
>> >> > URL:<br>
>> >> > <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/llvm-symbolizer.test?rev=206665&r1=206664&r2=206665&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/llvm-symbolizer.test?rev=206665&r1=206664&r2=206665&view=diff</a><br>

>> >> ><br>
>> >> > ==============================================================================<br>
>> >> > --- llvm/trunk/test/DebugInfo/llvm-symbolizer.test (original)<br>
>> >> > +++ llvm/trunk/test/DebugInfo/llvm-symbolizer.test Fri Apr 18 17:22:44<br>
>> >> > 2014<br>
>> >> > @@ -8,6 +8,7 @@ RUN: echo "\"%p/Inputs/dwarfdump-test3.e<br>
>> >> >  RUN: echo "%p/Inputs/macho-universal 0x1f84" >> %t.input<br>
>> >> >  RUN: echo "%p/Inputs/macho-universal:i386 0x1f67" >> %t.input<br>
>> >> >  RUN: echo "%p/Inputs/macho-universal:x86_64 0x100000f05" >> %t.input<br>
>> >> > +RUN: echo "%p/Inputs/llvm-symbolizer-dwo-test 0x400514" >> %t.input<br>
>> >> ><br>
>> >> >  RUN: llvm-symbolizer --functions --inlining --demangle=false \<br>
>> >> >  RUN:    --default-arch=i386 < %t.input | FileCheck %s<br>
>> >> > @@ -48,6 +49,9 @@ CHECK:      main<br>
>> >> >  CHECK:      _Z3inci<br>
>> >> >  CHECK:      _Z3inci<br>
>> >> ><br>
>> >> > +CHECK: main<br>
>> >> > +CHECK-NEXT: llvm-symbolizer-dwo-test.cc:11<br>
>> >> > +<br>
>> >> >  RUN: echo "unexisting-file 0x1234" > %t.input2<br>
>> >> >  RUN: llvm-symbolizer < %t.input2<br>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> > _______________________________________________<br>
>> >> > llvm-commits mailing list<br>
>> >> > <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
>> >> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> > --<br>
>> > Alexey Samsonov, Mountain View, CA<br>
><br>
><br>
><br>
><br>
> -- <br>
> Alexey Samsonov, Mountain View, CA</p>