Commit Graph

116 Commits

Author SHA1 Message Date
Alexander Kornienko
cd52a7a381 Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)
Apparently, the style needs to be agreed upon first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240390 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 09:49:53 +00:00
Alexander Kornienko
cf0db29df2 Fixed/added namespace ending comments using clang-tidy. NFC
The patch is generated using this command:

tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \
  -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \
  llvm/lib/


Thanks to Eugene Kosov for the original patch!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240137 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 15:57:42 +00:00
David Blaikie
a520577e7e Re-unique_ptrify LoadedObjectInfo::clone after it was reverted due to some other changes that broke on GCC around the same time
Apparently this functionality isn't used in-tree (or I would go & make
the explicit unique_ptr constructions into implicit constructions to
make them more self documenting now that clone doesn't return a raw
owning pointer anymore) but only by the Julia frontend. This isn't
ideal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239091 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-04 20:54:32 +00:00
David Blaikie
ea36630528 Retry defaulting the virtual dtor in LoadedObjectInfo
Originally committed in r237975, GCC 4.7 gave a compilation error
regarding "looser throw specification" though it seemed to be pointing
to a virtual defaulted dtor in a base class and an override defaulted
dtor in a derived class - so I'm not quite sure why/how they could end
up with different throw specifications. To simplify and reduce the risk
of this, I've just removed the pointless override in the derived class,
the base class's should be sufficient. *fingers crossed*

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239088 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-04 20:41:51 +00:00
David Blaikie
711ff5004a Having another go at some simple cleanup from r237975/r237976
I made a few changes here in a couple of commits - breaking them out
into smaller ones in case I hit the GCC oddities again.

I'm still not /entirely/ sure what the issues were, so apologies if any
of these experiments break things again. Feel free to revert
immediately.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239083 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-04 20:23:13 +00:00
Keno Fischer
23125c500f [DWARF] Fix a bug in line info handling
This fixes a bug in the line info handling in the dwarf code, based on a
problem I when implementing RelocVisitor support for MachO.
Since addr+size will give the first address past the end of the function,
we need to back up one line table entry. Fix this by looking up the
end_addr-1, which is the last address in the range. Note that this also
removes a duplicate output from the llvm-rtdyld line table dump. The
relevant line is the end_sequence one in the line table and has an offset
of the first address part the end of the range and hence should not be
included.
Also factor out the common functionality into a separate function.
This comes up on MachO much more than on ELF, since MachO
doesn't store the symbol size separately, hence making
said situation always occur.

Differential Revision: http://reviews.llvm.org/D9925

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238699 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-31 23:37:04 +00:00
Ed Maste
5d25204af9 DebugInfo: .debug_line DWARF64 support
This adds support for the 64-bit DWARF format, but is still limited to
less than 4GB of debug data by the DataExtractor class.  Some versions
of the GNU MIPS toolchain generate 64-Bit DWARF even though it isn't
actually necessary.

Differential Revision: http://reviews.llvm.org/D1988


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238434 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-28 15:38:17 +00:00
NAKAMURA Takumi
117f3a66e8 Revert part of r237975, "Fix Clang -Wmissing-override warning" in DIContext.h, to appease g++-4.7.
llvm/include/llvm/DebugInfo/DIContext.h:144:11: error:   overriding ‘virtual llvm::LoadedObjectInfo::~LoadedObjectInfo() noexcept (true)’

It seems the destructor in the base class may not be "default".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238000 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 05:52:50 +00:00
Tobias Grosser
82967c0bcd Revert "unique_ptrify LoadedObjectInfo::clone"
This reverts commit r237976, which seems to break existing gcc 4.7 buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237996 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 05:33:54 +00:00
David Blaikie
fcf7993d4a unique_ptrify LoadedObjectInfo::clone
As noted in the original review, this is unused in tree & is used by
Julia... that's problematic. This API coudl easily be deleted/modified
by accident without any validation that it remains correct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237976 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 00:05:05 +00:00
David Blaikie
a89d43a2ce Fix Clang -Wmissing-override warning
& remove the duplication by introducing a CRTP base to implement the
clone behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237975 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 00:00:00 +00:00
Keno Fischer
b6976af3cd Make it easier to use DwarfContext with MCJIT
Summary:
This supersedes http://reviews.llvm.org/D4010, hopefully properly
dealing with the JIT case and also adds an actual test case.
DwarfContext was basically already usable for the JIT (and back when
we were overwriting ELF files it actually worked out of the box by
accident), but in order to resolve relocations correctly it needs
to know the load address of the section.
Rather than trying to get this out of the ObjectFile or requiring
the user to create a new ObjectFile just to get some debug info,
this adds the capability to pass in that info directly.
As part of this I separated out part of the LoadedObjectInfo struct
from RuntimeDyld, since it is now required at a higher layer.

Reviewers: lhames, echristo

Reviewed By: echristo

Subscribers: vtjnash, friss, rafael, llvm-commits

Differential Revision: http://reviews.llvm.org/D6961

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237961 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 21:24:32 +00:00
Alexey Samsonov
05f725eb67 [DWARF parser] Make DWARF parser more robust against missing compile/type units.
DWARF standard claims that each compilation/type unit header in
.debug_info/.debug_types section must be followed by corresponding
compile/type unit DIE, possibly with its children. Two situations
are possible:

 * compile/type unit DIE is missing because DWARF producer failed to
   emit it.
 * DWARF parser failed to parse unit DIE correctly, for instance if it
   contains some unsupported attributes (see r237721, for instance).

In either of these cases, the library, and the tools that use it
(llvm-dwarfdump, llvm-symbolizer) should not crash. Insert appropriate
checks to protect against this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237733 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 21:54:32 +00:00
Alexey Samsonov
4ca606f22f [DWARF parser] Add basic support for DWZ DWARF multifile extensions.
This change implements basic support for DWARF alternate sections
proposal: http://www.dwarfstd.org/ShowIssue.php?issue=120604.1&type=open

LLVM tools now understand new forms: DW_FORM_GNU_ref_alt and
DW_FORM_GNU_strp_alt, which are used as references to .debug_info and
.debug_str sections respectively, stored in a separate file, and
possibly shared between different executables / shared objects.

llvm-dwarfdump and llvm-symbolizer don't yet know how to access this
alternate debug file (usually pointed by .gnu_debugaltlink section),
but they can at lease properly parse and dump regular files, which
refer to it.

This change should fix crashes of llvm-dwarfdump and llvm-symbolizer on
files produced by running "dwz" tool. Such files are already installed
on some modern Linux distributions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237721 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 20:29:28 +00:00
Richard Smith
96086ad501 Add more missing #includes, found by modules build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237062 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-11 22:41:07 +00:00
Zachary Turner
43afa42908 A few fixes for llvm-symbolizer on Windows.
Specifically, this patch correctly respects the -demangle option,
and additionally adds a hidden --relative-address option allows
input addresses to be relative to the module load address instead
of absolute addresses into the image.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236653 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-06 22:26:30 +00:00
Zachary Turner
2e8b406d43 Fix build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236343 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-01 20:33:10 +00:00
Zachary Turner
7c69a58214 [llvm-pdbdump] Support dynamic load address and external symbols.
This patch adds the --load-address command line option to
llvm-pdbdump, which dumps all addresses assuming the module has
loaded at the specified address.

Additionally, this patch adds an option to llvm-pdbdump to support
dumping of public symbols (i.e. symbols with external linkage).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236342 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-01 20:24:26 +00:00
Zachary Turner
7b8e8e5dc0 Make llvm-symbolizer work on Windows.
Differential Revision: http://reviews.llvm.org/D9234
Reviewed By: Alexey Samsonov

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235900 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-27 17:19:51 +00:00
Zachary Turner
45e7e93c6f Move DIContext.h to common DebugInfo location.
This will enable us to create a PDBContext so as to expose some
amount of debug info functionality through a common interace.

Differential Revision: http://reviews.llvm.org/D9205
Reviewed by: Alexey Samsonov

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235612 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-23 17:37:47 +00:00
Zachary Turner
9d74bda3e3 [PDB] Support executables and source/line info.
Previously DebugInfoPDB could only load data for a PDB given a
path to the PDB.  It could not open an EXE and find the matching
PDB and verify it matched, etc.  This patch adds support for that
so that we can simply load debug information for a PDB directly.

Additionally, this patch extends DebugInfoPDB to support getting
source and line information for symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235237 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-17 22:40:36 +00:00
Benjamin Kramer
829e013107 Remove empty non-virtual destructors or mark them =default when non-public
These add no value but can make a class non-trivially copyable. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234688 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-11 15:32:26 +00:00
Alexander Kornienko
c16fc54851 Use 'override/final' instead of 'virtual' for overridden methods
The patch is generated using clang-tidy misc-use-override check.

This command was used:

  tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \
    -checks='-*,misc-use-override' -header-filter='llvm|clang' \
    -j=32 -fix -format

http://reviews.llvm.org/D8925



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234679 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-11 02:11:45 +00:00
Frederic Riss
97fb4907c5 DWARFDebugRangeList: make the list of entries available to clients.
For users like llvm-dsymutil that want to have access to the encoded
debug_ranges entries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232230 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-13 23:30:07 +00:00
Yaron Keren
217f2279be Add missing include guards.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232078 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-12 18:39:54 +00:00
Eric Christopher
b0b21de627 Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231547 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-07 01:39:09 +00:00
Frederic Riss
17b5682094 DWARFFormValue: Add getAsSignedConstant method.
The implementation accepts explicitely signed forms (DW_FORM_sdata),
but also unsigned forms as long as they fit in an int64_t.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231299 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04 22:07:41 +00:00
Frederic Riss
c7e4df3846 Make the DWARFAbbreviationDeclaration::AttributeSpec type public.
It was already exposed through the iterators anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231297 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04 22:07:30 +00:00
Zachary Turner
b9c28bc7f1 [llvm-pdbdump] Display full enum definitions.
This will now display enum definitions both at the global
scope as well as nested inside of classes.  Additionally,
it will no longer display enums at the global scope if the
enum is nested.  Instead, it will omit the definition of
the enum globally and instead emit it in the corresponding
class definition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231215 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04 06:09:53 +00:00
Zachary Turner
0c7c98a27d [llvm-pdbdump] Many minor fixes and improvements
A short list of some of the improvements:

1) Now supports -all command line argument, which implies many
   other command line arguments to simplify usage.
2) Now supports -no-compiler-generated command line argument to
   exclude compiler generated types.
3) Prints base class list.
4) -class-definitions implies -types.
5) Proper display of bitfields.
6) Can now distinguish between struct/class/interface/union.

And a few other minor tweaks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230933 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-02 04:39:56 +00:00
Benjamin Kramer
d59c5f9a06 Add missing includes. make_unique proliferated everywhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230909 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-01 21:28:53 +00:00
Zachary Turner
53e4b56257 [llvm-pdbdump] Clean up method signatures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230889 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-01 06:51:29 +00:00
Zachary Turner
e09af84db5 [llvm-pdbdump] Better error handling.
Previously it was impossible to distinguish between "There is
no PDB implementation for this platform" and "I tried to load
the PDB, but couldn't find the file", making it hard to figure
out if you built llvm-pdbdump incorrectly or if you just mistyped
a file name.

This patch adds proper error handling so that we can know exactly
what went wrong.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230868 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-28 20:23:18 +00:00
Zachary Turner
ade49914b6 [llvm-pdbdump] Fix warnings found by clang-cl self host.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230745 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 09:15:31 +00:00
Zachary Turner
6aba383ab5 [llvm-pdbdump] Fix dumping of function pointers and basic types.
Function pointers were not correctly handled by the dumper, and
they would print as "* name".  They now print as
"int (__cdecl *name)(int arg1, int arg2)" as they should.

Also, doubles were being printed as floats.  This fixes that bug
as well, and adds tests for all builtin types. as well as a test
for function pointers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230703 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26 23:49:23 +00:00
Zachary Turner
4ad658d8f1 [llvm-pdbdump] Very minor code cleanup.
This just removes some dead enums as well as some debug flushes
of stdout.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230204 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 05:59:14 +00:00
Zachary Turner
92d755ea65 [llvm-pdbdump] Add an option to dump full class definitions.
This adds the --class-definitions flag.  If specified, when dumping
types, instead of "class Foo" you will see the full class definition,
with member functions, constructors, access specifiers.

NOTE: Using this option can be very slow, as generating a full class
definition requires accessing many different parts of the PDB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230203 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 05:58:34 +00:00
Zachary Turner
395adf9f89 [llvm-pdbdump] Rewrite dumper using visitor pattern.
This increases the flexibility of how to dump different
symbol types -- necessary for context-sensitive formatting of
symbol types -- and also improves the modularity by allowing
the dumping to be implemented in the actual dumper, as opposed
to in the PDB library.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230184 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 22:03:38 +00:00
Aaron Ballman
66981fe208 Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229340 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 22:54:22 +00:00
Zachary Turner
7f6d93f718 llvm-pdbdump: Add flags controlling the type of values to dump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229330 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 20:27:53 +00:00
Zachary Turner
73a1e454d7 llvm-pdbdump: Only dump whitelisted global symbols.
Dumping the global scope contains a lot of very uninteresting
things and is generally polluted with a lot of random junk.
Furthermore, it dumps values unsorted, making it hard to read.
This patch dumps known interesting types only, and as a side
effect sorts the list by symbol type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229232 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-14 03:54:28 +00:00
Frederic Riss
ae0c4604d4 DWARFUnit: Add a couple of helpers to access the DIE array.
To be used in dsymutil (or any other client that wants to take
advantage of the fact that DIEs are stored in a vector).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229179 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 23:18:24 +00:00
Zachary Turner
4c0a8b3025 llvm-pdbdump: Improve printing of functions and signatures.
This correctly prints the function pointers, and also prints
function signatures for symbols as opposed to just types.  So
actual functions in your program will now be printed with full
name and signature, as opposed to just name as before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229129 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 17:57:09 +00:00
Chandler Carruth
02d6288667 Re-sort #include lines using my handy dandy ./utils/sort_includes.py
script. This is in preparation for changes to lots of include lines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229088 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 09:09:03 +00:00
Zachary Turner
60f22886e3 Fix the windows build *again*. Grrr, MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229081 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 07:55:29 +00:00
Zachary Turner
2614564769 Fix non-windows builds unhappy about a missing header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229079 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 07:45:49 +00:00
Zachary Turner
eb95a535aa llvm-pdbdump: Add more comprehensive dumping of symbol types.
In particular this patch adds the ability to dump complete
function signature information including argument types as
correctly formatted strings.  A side effect of this is that
almost all symbol and meta types are now formatted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229076 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 07:40:03 +00:00
Zachary Turner
bcaafc81ab Improve llvm-pdbdump output display.
This patch adds a number of improvements to llvm-pdbdump.

1) Dumping of the entire global scope, and not only those
   symbols that live in individual compilands.
2) Prepend class name to member functions and data
3) Improved display of bitfields.
4) Support for dumping more kinds of data symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229012 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 01:23:51 +00:00
David Blaikie
122ea21abf Add missing override.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228974 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 22:58:53 +00:00
Zachary Turner
3231937293 Attempt to fix the build again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228964 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12 21:25:58 +00:00