1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

397 Commits

Author SHA1 Message Date
Zachary Turner
341f9d58a9 [DebugInfoPDB] A few cleanups on PDB Variant class.
Also implements the PDBSymbolCompilandEnv::getValue() method,
which until now had been unimplemented specifically because
variant did not support string values.

llvm-svn: 261173
2016-02-17 22:46:33 +00:00
Zachary Turner
5f7b5f80e5 [DebugInfoPDB] Raise getSymIndexId() up to PDBSymbol
Every symbol, no matter what it's tag is, supports the method
getSymIndexId().  However, this was being forwarded on every
concrete symbol type, so if someone had a PDBSymbol that they
didn't know what type it was (or simply didn't have an instance
of the concrete symbol type), they would not be able to get its
index id.  This patch moves the method up to PDBSymbol, so that
no matter what type of object you have, you can always get its
id.

llvm-svn: 261153
2016-02-17 21:13:34 +00:00
Zachary Turner
e25dd60195 [DebugInfoPDB] Teach Variant to support string types.
The IDiaSymbol::getValue() method returns a variant.  Until now,
I had never encountered a string value, so the Variant wrapper
did not support VT_BSTR.  Now we have need to support string
values, so this patch just adds support for one extra type to
Variant.

llvm-svn: 261152
2016-02-17 21:13:15 +00:00
Igor Laevsky
7660fa06ad Re-submit r256008 "Improve DWARFDebugFrame::parse to also handle __eh_frame."
Originally this change was causing failures on windows buildbots.
But those problems were fixed in r258806.

llvm-svn: 258811
2016-01-26 15:09:42 +00:00
Reid Kleckner
0f638161ba [readobj] Expand CodeView dumping functionality
This rewrites and expands the existing codeview dumping functionality in
llvm-readobj using techniques similar to those in lib/Object. This defines a
number of new records and enums useful for reading memory mapped codeview
sections in COFF objects.

The dumper is intended as a testing tool for LLVM as it grows more codeview
output capabilities.

Reviewers: majnemer

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

llvm-svn: 257658
2016-01-13 19:32:35 +00:00
Pete Cooper
cda523f460 Revert "Improve DWARFDebugFrame::parse to also handle __eh_frame."
This reverts commit r256008.

Its breaking multiple buildbots, although works for me locally.

llvm-svn: 256013
2015-12-18 19:45:38 +00:00
Pete Cooper
70c961d67d Improve DWARFDebugFrame::parse to also handle __eh_frame.
LLVM MC has single methods which can handle the output of EH frame and DWARF CIE's and FDE's.

This code improves DWARFDebugFrame::parse to do the same for parsing.

This also allows llvm-objdump to support the --dwarf=frames option which objdump supports.  This
option dumps the .eh_frame section using the new code in DWARFDebugFrame::parse.

http://reviews.llvm.org/D15535

Reviewed by Rafael Espindola.

llvm-svn: 256008
2015-12-18 18:51:08 +00:00
David Majnemer
6f3ef70e32 [llvm-pdbdump] Provide a mechanism to dump the raw contents of a PDB
A PDB can be thought of as a very simple file system.  It is
occasionally illuminating to see the contents of the underlying files.

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

llvm-svn: 250356
2015-10-15 01:27:19 +00:00
Reid Kleckner
758673811a [llvm-symbolizer] Make --relative-address work with DWARF contexts
Summary:
Previously the relative address flag only affected PDB debug info.  Now
both DIContext implementations always expect to be passed virtual
addresses. llvm-symbolizer is now responsible for adding ImageBase to
module offsets when --relative-offset is passed.

Reviewers: zturner

Subscribers: llvm-commits

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

llvm-svn: 249784
2015-10-09 00:15:01 +00:00
Alexander Kornienko
f993659b8f Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)
Apparently, the style needs to be agreed upon first.

llvm-svn: 240390
2015-06-23 09:49:53 +00:00
Alexander Kornienko
40cb19d802 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!

llvm-svn: 240137
2015-06-19 15:57:42 +00:00
Zachary Turner
193194d5e5 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.

llvm-svn: 236653
2015-05-06 22:26:30 +00:00
Zachary Turner
392b300d04 Fix build.
llvm-svn: 236343
2015-05-01 20:33:10 +00:00
Zachary Turner
49ec888ed3 [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).

llvm-svn: 236342
2015-05-01 20:24:26 +00:00
Zachary Turner
3aea053fae Make llvm-symbolizer work on Windows.
Differential Revision: http://reviews.llvm.org/D9234
Reviewed By: Alexey Samsonov

llvm-svn: 235900
2015-04-27 17:19:51 +00:00
Zachary Turner
7bf82f4127 [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.

llvm-svn: 235237
2015-04-17 22:40:36 +00:00
Alexander Kornienko
71412ece39 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

llvm-svn: 234679
2015-04-11 02:11:45 +00:00
Zachary Turner
077c624adf [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.

llvm-svn: 231215
2015-03-04 06:09:53 +00:00
Zachary Turner
c961d86cad [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.

llvm-svn: 230933
2015-03-02 04:39:56 +00:00
Zachary Turner
bc938afb61 [llvm-pdbdump] Clean up method signatures.
llvm-svn: 230889
2015-03-01 06:51:29 +00:00
Zachary Turner
2d0c903eb8 [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.

llvm-svn: 230868
2015-02-28 20:23:18 +00:00
Zachary Turner
143598ffbf [llvm-pdbdump] Fix warnings found by clang-cl self host.
llvm-svn: 230745
2015-02-27 09:15:31 +00:00
Zachary Turner
98eef62d28 [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.

llvm-svn: 230703
2015-02-26 23:49:23 +00:00
Zachary Turner
bf3f275325 [llvm-pdbdump] Very minor code cleanup.
This just removes some dead enums as well as some debug flushes
of stdout.

llvm-svn: 230204
2015-02-23 05:59:14 +00:00
Zachary Turner
b7d9bc75c5 [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.

llvm-svn: 230203
2015-02-23 05:58:34 +00:00
Zachary Turner
1a7a66bda7 [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.

llvm-svn: 230184
2015-02-22 22:03:38 +00:00
Zachary Turner
e9cd3c4989 llvm-pdbdump: Add flags controlling the type of values to dump.
llvm-svn: 229330
2015-02-15 20:27:53 +00:00
Zachary Turner
ee319cd955 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.

llvm-svn: 229232
2015-02-14 03:54:28 +00:00
Zachary Turner
56655b0bb0 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.

llvm-svn: 229129
2015-02-13 17:57:09 +00:00
Chandler Carruth
33dabe4f44 Re-sort #include lines using my handy dandy ./utils/sort_includes.py
script. This is in preparation for changes to lots of include lines.

llvm-svn: 229088
2015-02-13 09:09:03 +00:00
Zachary Turner
0d71c47d7a Fix the windows build *again*. Grrr, MSVC.
llvm-svn: 229081
2015-02-13 07:55:29 +00:00
Zachary Turner
fb935fca62 Fix non-windows builds unhappy about a missing header.
llvm-svn: 229079
2015-02-13 07:45:49 +00:00
Zachary Turner
96be932905 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.

llvm-svn: 229076
2015-02-13 07:40:03 +00:00
Zachary Turner
bacf14945c 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.

llvm-svn: 229012
2015-02-13 01:23:51 +00:00
David Blaikie
52492e048a Add missing override.
llvm-svn: 228974
2015-02-12 22:58:53 +00:00
Zachary Turner
8f5e13b9c7 Attempt to fix the build again.
llvm-svn: 228964
2015-02-12 21:25:58 +00:00
Zachary Turner
5a969b378c Attempt to fix Linux builds after r228960.
llvm-svn: 228962
2015-02-12 21:17:07 +00:00
Zachary Turner
6cde1e9388 Add concrete type overloads to PDBSymbol::findChildren().
Frequently you only want to iterate over children of a specific
type (e.g. functions).  Previously you would get back a generic
interface that allowed iteration over the base symbol type,
which you would have to dyn_cast<> each one of.  With this patch,
we allow the user to specify the concrete type as a template
parameter, and it will return an iterator which returns instances
of the concrete type directly.

llvm-svn: 228960
2015-02-12 21:09:24 +00:00
Zachary Turner
473b4aac78 Rewrite llvm-pdbdump in terms of LLVMDebugInfoPDB.
This makes llvm-pdbdump available on all platforms, although it
will currently fail to create a dumper if there is no PDB reader
implementation for the current platform.

It implements dumping of compilands and children, which is less
information than was previously available, but it has to be
rewritten from scratch using the new set of interfaces, so the
rest of the functionality will be added back in subsequent commits.

llvm-svn: 228755
2015-02-10 22:43:25 +00:00
Zachary Turner
422f6e29d5 Provide DIA implementation of DebugInfoPDB.
This implements DebugInfoPDB when the DIA SDK is present on the system.
Specifically, this means that the following conditions are met:
  1) You are building on Windows.
  2) You are building with MSVC.
  3) Visual Studio did not corrupt the installation of DIA due to a
     known issue with side-by-side installations of VS2012 and VS2013.
If all of these conditions are true, you will be able to pass a value
of PDB_Reader::DIA to PDB::createPdbReader().

There are no tests for this yet, as any test will be in the form of a
lit test which tests the llvm-pdbdump.exe, which still needs to be
rewritten in terms of this library.

llvm-svn: 228747
2015-02-10 21:17:52 +00:00
Zachary Turner
71e3bf6e80 Make PDBSymbol's IPDBSymbol reference const.
llvm-svn: 228553
2015-02-08 22:53:53 +00:00
Zachary Turner
754851ad80 DebugInfoPDB: Make the symbol base case hold an IPDBSession ref.
Dumping a symbol often requires access to data that isn't inside
the symbol hierarchy, but which is only accessible through the
top-level session.  This patch is a pure interface change to give
symbols a reference to the session.

llvm-svn: 228542
2015-02-08 20:58:09 +00:00
Zachary Turner
ca172bdb48 Some cleanup for libpdb.
This patch implements a few of the optional suggestions from the
initial patch comitting libpdb.  In particular, it implements a
virtual function out of line for each of the concrete classes.

A few other minor cleanups exist as well, such as using override
instead of virtual, etc.

llvm-svn: 228516
2015-02-08 00:29:29 +00:00
Zachary Turner
58559798ed Change RHS-style decltype to LHS-style decltype<declval()>.
Seems some compilers don't like the RHS-style decltype specifier.

This should fix the buildbots.

llvm-svn: 228484
2015-02-07 02:02:23 +00:00
Zachary Turner
743a32b50f Resubmit "Create lib/DebugInfo/PDB" (r228428)
This change resubmits the patch that broke the build, this time
without unittests.  The unittests will be submitted separately
after the problem has been addressed:

--Original Commit Message--

Create lib/DebugInfo/PDB.

This patch creates a platform-independent interface to a PDB reader.
There is currently no implementation of this interface, which will
be provided in future patches.  This defines the basic object model
which any implementation must conform to.

Reviewed by: David Blaikie
Differential Revision: http://reviews.llvm.org/D7356

llvm-svn: 228435
2015-02-06 20:30:52 +00:00
Zachary Turner
434f023380 Revert "Create lib/DebugInfo/PDB."
This reverts commit 21028, as it is causing failures in LLVMConfig.

llvm-svn: 228431
2015-02-06 20:00:18 +00:00
Zachary Turner
bfc7e60f16 Create lib/DebugInfo/PDB.
This patch creates a platform-independent interface to a PDB reader.
There is currently no implementation of this interface, which will
be provided in future patches.  This defines the basic object model
which any implementation must conform to.

Reviewed by: David Blaikie
Differential Revision: http://reviews.llvm.org/D7356

llvm-svn: 228428
2015-02-06 19:44:09 +00:00