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

41 Commits

Author SHA1 Message Date
Zachary Turner
de0ff2102f [msf] Create LLVMDebugInfoMsf
This provides a better layering of responsibilities among different
aspects of PDB writing code.  Some of the MSF related code was
contained in CodeView, and some was in PDB prior to this.  Further,
we were often saying PDB when we meant MSF, and the two are
actually independent of each other since in theory you can have
other types of data besides PDB data in an MSF.  So, this patch
separates the MSF specific code into its own library, with no
dependencies on anything else, and DebugInfoCodeView and
DebugInfoPDB take dependencies on DebugInfoMsf.

llvm-svn: 276458
2016-07-22 19:56:05 +00:00
Zachary Turner
ae0563fb6f [pdb] Teach MsfBuilder and other classes about the Free Page Map.
Block 1 and 2 of an MSF file are bit vectors that represent the
list of blocks allocated and free in the file.  We had been using
these blocks to write stream data and other data, so we mark them
as the free page map now.  We don't yet serialize these pages to
the disk, but at least we make a note of what it is, and avoid
writing random data to them.

Doing this also necessitated cleaning up some of the tests to be
more general and hardcode fewer values, which is nice.

llvm-svn: 275629
2016-07-15 22:17:19 +00:00
Zachary Turner
88e1ef47a6 [pdb] Use MsfBuilder to handle the writing PDBs.
Previously we would read a PDB, then write some of it back out,
but write the directory, super block, and other pertinent metadata
back out unchanged.  This generates incorrect PDBs since the amount
of data written was not always the same as the amount of data read.

This patch changes things to use the newly introduced `MsfBuilder`
class to write out a correct and accurate set of Msf metadata for
the data *actually* written, which opens up the door for adding and
removing type records, symbol records, and other types of data to
an existing PDB.

llvm-svn: 275627
2016-07-15 22:16:56 +00:00
Zachary Turner
e62ff3e5c3 [pdb] Introduce MsfBuilder for laying out PDB files.
Reviewed by: ruiu
Differential Revision: https://reviews.llvm.org/D22308

llvm-svn: 275611
2016-07-15 20:43:38 +00:00
David Majnemer
634a992c4e [llvm-pdbdump] Propagate errors a little more consistently
PDBFile::getBlockData didn't really return any indication that it
failed.  It merely returned an empty buffer.

llvm-svn: 275009
2016-07-10 03:34:47 +00:00
Zachary Turner
0b8e9a6cd3 Try to fix compilation error in DebugInfoPDBTests.
llvm-svn: 274881
2016-07-08 16:57:14 +00:00
NAKAMURA Takumi
62479a2a36 DebugInfoPDBTests:MappedBlockStreamTest.TestWriteThenRead: Avoid assigning temporary object to ArrayRef.
llvm-svn: 272457
2016-06-11 06:37:28 +00:00
Zachary Turner
3ce2291b08 Try again to fix this endianness issue.
llvm-svn: 272440
2016-06-10 22:12:18 +00:00
Zachary Turner
d2ab2f7431 [pdb] Fix issues with pdb writing.
This fixes an alignment issue by forcing all cached allocations
to be 8 byte aligned, and also fixes an issue arising on big
endian systems by writing ulittle32_t's instead of uint32_t's
in the test.

llvm-svn: 272437
2016-06-10 21:47:26 +00:00
Zachary Turner
8110e5a8a3 Add support for writing through StreamInterface.
This adds method and tests for writing to a PDB stream.  With
this, even a PDB stream which is discontiguous can be treated
as a sequential stream of bytes for the purposes of writing.

Reviewed By: ruiu
Differential Revision: http://reviews.llvm.org/D21157

llvm-svn: 272369
2016-06-10 05:09:12 +00:00
Zachary Turner
0a756c9656 [pdb] Fix build errors in PDB unit tests.
llvm-svn: 272174
2016-06-08 17:32:25 +00:00
Zachary Turner
6663a6a4c4 [pdb] Fix broken unit test compilation.
llvm-svn: 272059
2016-06-07 20:46:39 +00:00
Zachary Turner
e2db98503c [pdb] Fix broken unit tests after r271982.
llvm-svn: 271983
2016-06-07 05:32:48 +00:00
David Majnemer
7be7a53496 [CodeView] Take the StreamRef::readBytes offset into account when validating
We only considered the length of the operation and the length of the
StreamRef without considered what it meant for the offset to be at a
non-zero position.

llvm-svn: 271496
2016-06-02 06:21:44 +00:00
NAKAMURA Takumi
db0d754acf Rework r271439. I forgot to save the buffer for editing.
llvm-svn: 271441
2016-06-01 23:03:46 +00:00
NAKAMURA Takumi
00bd147d8f MappedBlockStreamTest.cpp: Simplify array initializers.
llvm-svn: 271439
2016-06-01 22:59:06 +00:00
Zachary Turner
a2230c62dd [pdb] silence warnings about moving from a temporary.
llvm-svn: 271420
2016-06-01 18:18:55 +00:00
David Majnemer
818581cd0c [CodeView] Make sure StreamRef::readBytes doesn't read too much
llvm-svn: 271418
2016-06-01 18:13:06 +00:00
David Majnemer
c93b9f9ce9 [PDB] Silence sign comparison warnings in MappedBlockStreamTest
llvm-svn: 271416
2016-06-01 18:13:02 +00:00
NAKAMURA Takumi
546766bc6f MappedBlockStreamTest.cpp: Appease msc18 to avoid initializer for std::vector.
llvm-svn: 271397
2016-06-01 14:26:54 +00:00
NAKAMURA Takumi
75e76fb82e DebugInfoPDBTests: Update libdeps for r271346.
llvm-svn: 271355
2016-06-01 00:30:15 +00:00
Zachary Turner
3c1133f753 [pdb] Add unit tests for PDB MappedBlockStream and zero copy
Differential Revision: http://reviews.llvm.org/D20837
Reviewed By: ruiu

llvm-svn: 271346
2016-05-31 22:41:52 +00:00
Zachary Turner
7adc75a795 Fix build of DebugInfoPDBTests.
Missing a using statement.

llvm-svn: 268552
2016-05-04 21:06:12 +00:00
Zachary Turner
f3c152db24 [DebugInfoPDB] Add source / line number accessors for PDB.
This patch adds a variety of different methods to query source
and line number information from PDB files.

llvm-svn: 261239
2016-02-18 18:47:29 +00:00
Chris Bieneman
1b8d4f74aa Remove autoconf support
Summary:
This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html

"I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened."
- Obi Wan Kenobi

Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark

Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits

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

llvm-svn: 258861
2016-01-26 21:29:08 +00:00
Zachary Turner
9e9f1636a9 Fix compilation of PDBApiTest.
llvm-svn: 236345
2015-05-01 20:51:49 +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
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
84f485f220 Fix the build, I forgot to check that UnitTests still built.
llvm-svn: 229021
2015-02-13 01:39:22 +00:00
Zachary Turner
d0cba5883a Fix warning due to unused private member variable.
llvm-svn: 228774
2015-02-11 00:33:00 +00:00
Zachary Turner
a89d75c45b Convert std::make_unique<> to llvm::make_unique<>.
llvm-svn: 228768
2015-02-10 23:46:48 +00:00
Zachary Turner
3222ed56a7 Add missing function and header include.
llvm-svn: 228758
2015-02-10 22:56:21 +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
99035c991d Fix build due to mismatched function signatures.
llvm-svn: 228752
2015-02-10 21:40:29 +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
Chandler Carruth
29a4099354 Consistently use override rather than virtual.
This fixes -Winconsistent-missing-override warnings.

llvm-svn: 228489
2015-02-07 08:12:22 +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
2af5383bf3 Resubmit unittests for DebugInfoPDB.
These were originally submitted as part of r228428, but this part
caused a build breakage in LLVMConfig.  The library portion was
resubmitted independently since it was not causing breakage.

There were two reasons this was causing the build to fail.  The
first is that there were no Makefiles added for the PDB tests.  And
the second is that the DebugInfoPDB library was only being built by
CMake behind an "if (MSVC)" check.  This is wrong since this the
library hides platform specific details, and it was causing
LLVM-Config to not find the library when trying to build unittests.

llvm-svn: 228482
2015-02-07 01:47:14 +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