[PATCH] D24706: [ELF] - Partial support of --gdb-index command line option (Part 1).

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 5 09:15:59 PDT 2016


On Wed, Oct 5, 2016 at 2:23 AM George Rimar <grimar at accesssoftek.com> wrote:

> grimar added a comment.
>
> In https://reviews.llvm.org/D24706#561568, @echristo wrote:
>
> > 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?
> >
> > Looks fine otherwise though.
> >
> > -eric
>
>
> Thanks for comments, Eric !
>
> I called it SplitDebugInfo.cpp initially as this patch is a part of
> https://reviews.llvm.org/D24267 where this file contains whole
> functionality needed
> by linker for generation --gdb-index, for example implementation of symbol
> hash table (GdbHashTab). So it is relative to fussion.
> I am fine with renaming it to something if you think it is misnomer
> though. May be GdbIndex.cpp ?
>

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)


>
> 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:
> Imaging I want to get address ranges and so I want to use
> DWARFDebugInfoEntryMinimal::getAddressRanges(const DWARFUnit *U).
> For doing that I need DWARFUnit, which requires DWARFContext in
> constructor. Looking at comments that says
> "DWARFContextInMemory is the simplest possible implementation of a
> DWARFContext.", I am opening its constructor and
> 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
> content of sections available.
>
> https://reviews.llvm.org/D24267 which is full version of this
> functionality shows that we seems need not that lot of parsing code for
> --gdb-index option in total,
> I think using own inplementation should allow to make it faster.
>

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)

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.

- Dave


>
>
>
> > echristo wrote in SplitDebugInfo.cpp:290
> > "parcer" -> "parser"
>
> Done.
>
> > echristo wrote in gdb-index.s:2
> > "were generated in this way"
>
> Done.
>
> https://reviews.llvm.org/D24706
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161005/136b425f/attachment.html>


More information about the llvm-commits mailing list