<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 29, 2015 at 4:08 PM, Robinson, Paul <span dir="ltr"><<a href="mailto:Paul_Robinson@playstation.sony.com" target="_blank">Paul_Robinson@playstation.sony.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p><u></u><span style="font-size:11.0pt;font-family:Wingdings;color:#1f497d"><span>Ø<span style="font:7.0pt "Times New Roman"">
</span></span></span><u></u>4) pointer size - it's specified by the CU header, but not in the line table header<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><a name="14d0770ccacaa534__MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></a></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">(beats head on table) gotta have that to interpret DW_LNE_set_address correctly, afaict that's the *only* reason .debug_line would need it. Feh. But basically
you always need that, just to get started.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p><u></u><span style="font-size:11.0pt;font-family:Wingdings;color:#1f497d"><span>Ø<span style="font:7.0pt "Times New Roman"">
</span></span></span><u></u>5) inlining info<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">For conjuring up fake frames in the traceback, presumably?</span></p></div></div></blockquote><div><br>Yep<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> That sort of thing always felt like the debugger was lying to me, personally.</span></p></div></div></blockquote><div><br>The alternative is a frame that looks like this:<br><br>outer_function() : inner_function_location.cpp:42<br><br>which tends to confuse people (& is ambiguous - which call to inner_function from outer_function are we in?).<br><br>If I'm looking for an asan report, or walking through code in a debugger, etc - it's often/usually not important that code has been inlined (just as it's not important that a variable has been put in a register or a stack slot, etc) - I just want to think about the code as though it wasn't optimized, insofar as I can.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">--paulr<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> David Blaikie [mailto:<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>]
<br>
<b>Sent:</b> Wednesday, April 29, 2015 3:33 PM<br>
<b>To:</b> Robinson, Paul<br>
<b>Cc:</b> Greg Clayton; Eric Christopher; Eric Christopher; David Blaikie; Alexey Samsonov; <a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a> Developers</span></p><div><div class="h5"><br>
<b>Subject:</b> Re: [cfe-dev] rfc: Adding a mode to -gline-tables-only to include parameter names, namespaces<u></u><u></u></div></div><p></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Wed, Apr 29, 2015 at 3:23 PM, Robinson, Paul <<a href="mailto:Paul_Robinson@playstation.sony.com" target="_blank">Paul_Robinson@playstation.sony.com</a>> wrote:<u></u><u></u></p>
<p class="MsoNormal">> -----Original Message-----<br>
> From: <a href="mailto:cfe-dev-bounces@cs.uiuc.edu" target="_blank">cfe-dev-bounces@cs.uiuc.edu</a> [mailto:<a href="mailto:cfe-dev-bounces@cs.uiuc.edu" target="_blank">cfe-dev-bounces@cs.uiuc.edu</a>] On<br>
> Behalf Of Greg Clayton<br>
> Sent: Wednesday, April 29, 2015 1:55 PM<br>
> To: Eric Christopher<br>
> Cc: Eric Christopher; Alexey Samsonov; David Blaikie; <a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">
cfe-dev@cs.uiuc.edu</a><br>
> Developers<br>
> Subject: Re: [cfe-dev] rfc: Adding a mode to -gline-tables-only to include<br>
> parameter names, namespaces<br>
><br>
> Actually parameters and their types and locations would greatly help out.<br>
> This would increase debug info size, but it would also keep me from having<br>
> to detect borked DWARF and having to avoid parsing any of it in LLDB.<br>
> Right now the -gline-tables-only will quickly make LLDB assert and die if<br>
> we try to use this debug info because we try to convert a function into a<br>
> real clang::ASTContext type and clang will quickly assert and kill the<br>
> debug session when it becomes unhappy with us trying to create functions<br>
> with no params or return types (think "operator<" with no params... Boom.<br>
> Crash).<br>
><br>
> It is too bad that DWARF requires compile units just so we can have line<br>
> tables. If it wasn't for this, we could just emit a .debug_line section<br>
> with no .debug_info.<br>
<br>
Hmmm why was that, again? I can think of three possibilities, none of<br>
which should be insurmountable:<br>
1) CU has the base directory and filename of the compilation; .debug_line<br>
can include these directly, if we know it's -gline-tables-only.<br>
2) CU has the use_utf8 flag; just assume UTF-8.<br>
3) CU points to the chunk of .debug_line for this CU; we can probably<br>
work out how to reliably subdivide .debug_line without that assist.<u></u><u></u></p>
<div>
<p class="MsoNormal"><br>
I don't think (3) is an issue - the line tables probably have their length in them.<br>
<br>
4) pointer size - it's specified by the CU header, but not in the line table header<br>
5) inlining info (this is pretty much the major point/issue with -gmlt) is not included in the line table. Cary's two-level line tables address this, though it's not implemented in LLVM. It's the minimal debug_info describing function inlining that's what confuses
LLDB.<br>
<br>
- David<br>
<u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal"><br>
Thanks,<br>
--paulr<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><br>
><br>
> More comments inline below.<br>
><br>
> > On Apr 29, 2015, at 12:47 PM, Eric Christopher <<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>><br>
> wrote:<br>
> ><br>
> ><br>
> ><br>
> > On Wed, Apr 29, 2015 at 12:41 PM Nico Weber <<a href="mailto:thakis@chromium.org" target="_blank">thakis@chromium.org</a>> wrote:<br>
> > On Wed, Apr 29, 2015 at 12:35 PM, Reid Kleckner <<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>> wrote:<br>
> > On Wed, Apr 29, 2015 at 12:25 PM, Nico Weber <<a href="mailto:thakis@chromium.org" target="_blank">thakis@chromium.org</a>><br>
> wrote:<br>
> > Hi,<br>
> ><br>
> > the motivation for -gline-tables-only was to make debug info much<br>
> smaller, but still include enough to get usable stack frames [1]. We<br>
> recently tried using it in Chromium and discovered that the stack frames<br>
> aren't all that usable: Function parameters disappear, as do function<br>
> namespaces.<br>
> ><br>
> > Are there any concerns about adding a mode to -gline-tables-only (or a<br>
> second flag -gline-tables-full, or similar) that includes function<br>
> parameter info and namespace info but still omits most debug info?<br>
><br>
> I would like this due to reasons mentioned above.<br>
> ><br>
> > (Background: We rely on dsym files to let our crash server symbolize<br>
> crash dumps we get from the wild. dsymutil uses debug info, but it<br>
> apparently crashes if debug info is > 4GB. We hit that recently. So we<br>
> started using -gline-tables-only, but now all our stacks are close to<br>
> unusable, even though the motivation for gline-tables-only was to still<br>
> have usable stacks. We can't easily use symbol names as they get stripped<br>
> very early in our pipeline, and changing that is apparently involved.)<br>
><br>
> You can still recover function bounds using the LC_FUNCTION_STARTS load<br>
> command even if you have a stripped executable. You won't have the<br>
> function names, but you can still backtrace and you can get accurate<br>
> function bound info for backtracing.<br>
><br>
> ><br>
> > Is there some way to change the pipeline to use the mangled name stored<br>
> in .symtab instead of the DW_AT_name in the DWARF? My understanding is<br>
> that the sanitizers already do this.<br>
><br>
> They probably just get the info from the symbol table.<br>
><br>
> ><br>
> > See "We can't easily use symbol names as they get stripped very early in<br>
> our pipeline." above – from what I understand, one machine does the build,<br>
> strips, runs dsymutil to get a .dSYM bundle, and then that is shipped to<br>
> the crash servers.<br>
><br>
> It better strip _after_ you run dsymutil to make the dSYM or you will get<br>
> empty dSYM files if the debug map is stripped. It really depends on what<br>
> kind of strip you are doing.<br>
><br>
> ><br>
> ><br>
> > (adding Greg for dsymutil issues, but I don't think there's much in the<br>
> way of solving it)<br>
> > Parameter names is something we could probably add. I'd like to see the<br>
> impact of it from a size perspective. I mean, next people will want<br>
> locations of parameters. Then... and we're right back to just full debug<br>
> info.<br>
><br>
> My main issue with -gline-tables-only (which LLDB doesn't support<br>
> currently due to the partial DWARF that is emitted that causes clang to<br>
> assert and kill the debugger) is that we now have DWARF that we can't<br>
> trust to use when creating types because all functions are potentially<br>
> invalid to create in a clang::ASTContext since everything has been<br>
> removed. Clang has the notion that certain types of functions must have<br>
> certain number of arguments, like C++ operators, and it gets unhappy if we<br>
> try to convert this DWARF into clang::AST types. We have a radar for clang<br>
> to somehow mark the debug info has "-gline-tables-only" so we can know<br>
> that any DW_TAG_subprogram tags we run into need to be converted to clang<br>
> AST types that return "UnknownAnyTy" and taking varargs as the parameters<br>
> so that they will be callable from the expression parser. We still might<br>
> run into names that can't be used as function names, especially if the<br>
> namespaces and class decl contexts are removed, so LLDB might have to just<br>
> say "I am not parsing any DWARF from anything that had -gline-tables-only<br>
> enabled..".<br>
><br>
> Greg Clayton<br>
><br>
><br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><u></u><u></u></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div></div></div>
</div>
</div>
</blockquote></div><br></div></div>