<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Oct 5, 2016 at 2:23 AM George Rimar <<a href="mailto:grimar@accesssoftek.com">grimar@accesssoftek.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">grimar added a comment.<br class="gmail_msg">
<br class="gmail_msg">
In <a href="https://reviews.llvm.org/D24706#561568" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D24706#561568</a>, @echristo wrote:<br class="gmail_msg">
<br class="gmail_msg">
> I think calling the file SplitDebugInfo.cpp is a bit of a misnomer, there's nothing related to fission/split-dwarf/etc in it other than a couple of references. Also not sure why we need yet another dwarf parser here rather than using the one in llvm?<br class="gmail_msg">
><br class="gmail_msg">
> Looks fine otherwise though.<br class="gmail_msg">
><br class="gmail_msg">
> -eric<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
Thanks for comments, Eric !<br class="gmail_msg">
<br class="gmail_msg">
I called it SplitDebugInfo.cpp initially as this patch is a part of <a href="https://reviews.llvm.org/D24267" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D24267</a> where this file contains whole functionality needed<br class="gmail_msg">
by linker for generation --gdb-index, for example implementation of symbol hash table (GdbHashTab). So it is relative to fussion.<br class="gmail_msg">
I am fine with renaming it to something if you think it is misnomer though. May be GdbIndex.cpp ?<br class="gmail_msg"></blockquote><div><br>I think Eric's point is that the gdb_index isn't required for or only useful for Fission. You could have a gdb_index in a non-fission build (to speed up the debugger so it doesn't have to read all the DWARF at load time) or skip the index in a fission build (to reduce executable size at the expense of slower gdb startup time)<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="gmail_msg">
We are trying to keep code minimal and fast in linker, but llvm parsers are generic and generally do more job than we need, short quick example:<br class="gmail_msg">
Imaging I want to get address ranges and so I want to use DWARFDebugInfoEntryMinimal::getAddressRanges(const DWARFUnit *U).<br class="gmail_msg">
For doing that I need DWARFUnit, which requires DWARFContext in constructor. Looking at comments that says<br class="gmail_msg">
"DWARFContextInMemory is the simplest possible implementation of a DWARFContext.", I am opening its constructor and<br class="gmail_msg">
see that it takes an object and do a scan over all sections uncompresses the compressed ones. But we do not need that as we already have<br class="gmail_msg">
content of sections available.<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://reviews.llvm.org/D24267" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D24267</a> which is full version of this functionality shows that we seems need not that lot of parsing code for --gdb-index option in total,<br class="gmail_msg">
I think using own inplementation should allow to make it faster.<br class="gmail_msg"></blockquote><div><br></div><div>It would possibly be better to make the common implementation in LLVM more flexible to this use case and more efficient - this could have benefits for other LLVM tools (like LLDB, llvm-dsymutil, and llvm-dwp)<br><br>If that means splitting up parts of the API so they can be used independently, providing ways to provide the contents of sections already available through other means, etc, - those seem like reasonable changes to make to the common APIs.<br><br>- Dave</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
> echristo wrote in SplitDebugInfo.cpp:290<br class="gmail_msg">
> "parcer" -> "parser"<br class="gmail_msg">
<br class="gmail_msg">
Done.<br class="gmail_msg">
<br class="gmail_msg">
> echristo wrote in gdb-index.s:2<br class="gmail_msg">
> "were generated in this way"<br class="gmail_msg">
<br class="gmail_msg">
Done.<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://reviews.llvm.org/D24706" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D24706</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div></div>