Commit Graph

18 Commits

Author SHA1 Message Date
Rui Ueyama 00805d8b09 Remove a comment that is taken from gdb man page.
This is not an original comment but taken from gdb man page, so
a pointer to the original document should suffice.

llvm-svn: 298964
2017-03-29 00:09:40 +00:00
Rui Ueyama 8139eab3c3 Simplify. NFC.
llvm-svn: 296773
2017-03-02 17:55:29 +00:00
Rui Ueyama ac2d815a2a Split GdbIndexBuilder class into non-member functions.
That class had three member functions, and all of them are just reader
methods that did not depend on class members, so they can be just non-
member functions.

Probably we should reorganize the functions themselves because their
return types doesn't make much sense to me, but for now I just moved
these functions out of the class.

llvm-svn: 296700
2017-03-01 22:54:50 +00:00
Rui Ueyama aab18c0cfc Remove useless variables and declarations.
llvm-svn: 296695
2017-03-01 22:24:46 +00:00
Rui Ueyama 97d7a74b35 Replace `auto` with its real type.
llvm-svn: 296694
2017-03-01 22:24:25 +00:00
Rui Ueyama e5e320de06 Style fix.
llvm-svn: 296689
2017-03-01 22:03:17 +00:00
Rui Ueyama a4d9a22ba2 Reduce nesting. NFC.
llvm-svn: 296688
2017-03-01 22:02:57 +00:00
Rui Ueyama e02cc60c72 Do not inherit LoadedObjectInfo.
GdbIndexBuilder class inherited LoadedObjectInfo, but that's not necessary.

llvm-svn: 296687
2017-03-01 22:02:37 +00:00
Rui Ueyama 962a83fbe9 Unbreak Windows bots.
llvm-svn: 296680
2017-03-01 21:28:41 +00:00
Rui Ueyama d0e07b919c Don't implement the gdb hash table as a generic in-memory hash table.
Looks like .gdb.index and its support classes do things that they don't
have to or shouldn't do do. This patch addresses one of these issues.

GdbHashTab class is a hash table class. Just like other in-memory hash
tables, that incrementally updates its internal data and resizes buckets
as new elements are added so that key lookup is always fast.
But that is completely not necessary.

Unlike debuggers, we only produce hash tables for .gdb.index and
never read them. So incrementally updating a hash table in memory is
just a waste of resource and complicates the code. What we should
do is to accumulate symbols and then create the final hash table
at once.

llvm-svn: 296678
2017-03-01 21:08:21 +00:00
Rafael Espindola 774ea7d0a9 Make InputSection a class. NFC.
With the current design an InputSection is basically anything that
goes directly in a OutputSection. That includes plain input section
but also synthetic sections, so this should probably not be a
template.

llvm-svn: 295993
2017-02-23 16:49:07 +00:00
Rafael Espindola b4c9b81aad Convert InputSectionBase to a class.
Removing this template is not a big win by itself, but opens the way
for removing more templates.

llvm-svn: 295923
2017-02-23 02:28:28 +00:00
George Rimar 58f84a01a3 [ELF] - Return file offset as address only for allocatable sections when building .gdb_index
This fixes issue revealed by r289961.

Differential revision: https://reviews.llvm.org/D28045

llvm-svn: 290419
2016-12-23 07:51:59 +00:00
George Rimar 607fa711b2 [ELF] - Use DWARFDebugPubTable parser class intead of hand-written parsing.
DWARFDebugPubTable was introduced recently and allows us to get rid of
code duplication in LLD.

llvm-svn: 290042
2016-12-17 10:18:05 +00:00
George Rimar ec02b8d4c0 [ELF] - Partial support of --gdb-index command line option (Part 3).
Patch continues work started in D24706 and D25821.

in this patch symbol table and constant pool areas were
added to .gdb_index section output.

This one finishes the implementation of --gdb-index functionality in LLD.

Differential revision: https://reviews.llvm.org/D26283

llvm-svn: 289810
2016-12-15 12:07:53 +00:00
George Rimar 8b54739328 [ELF] - Partial support of --gdb-index command line option (Part 2).
Patch continues work started in D24706,

in this patch address area was added to .gdb_index section output.

Differential revision: https://reviews.llvm.org/D25821

llvm-svn: 289790
2016-12-15 09:08:13 +00:00
Rui Ueyama 3fc0f7e54f Define toString() as a generic function to get a string for error message.
We have different functions to stringize objects to construct
error messages. For InputFile, we have getFilename, and for
InputSection, we have getName. You had to memorize them.

I think this is the case where the function overloading comes in handy.

This patch defines toString() functions that are overloaded for all these
types, so that you just call it in error().

Differential Revision: https://reviews.llvm.org/D27030

llvm-svn: 287787
2016-11-23 18:07:33 +00:00
George Rimar 58fa5243cc [ELF] - Partial support of --gdb-index command line option (Part 1).
In this patch partial gdb_index section is created. 
For costructing the .gdb_index section 6 steps should be performed (details are in
SplitDebugInfo.cpp file header), this patch do first 3:

Creates proper section header.
Fills list of compilation units.
Types CU list area is not supposed to be supported, so it is ignored and therefore
can be treated as implemented either.

Differential revision: https://reviews.llvm.org/D24706

llvm-svn: 284708
2016-10-20 09:19:48 +00:00