Commit Graph

96 Commits

Author SHA1 Message Date
Adrian McCarthy
b841963b25 Make IPDBSession::getGlobalScope a non-const method
There doesn't seem to be a compelling reason why this method should be const
other than it was possible with the DIA implementation.  The native session
is going to act as a symbol factory and cache.  This could be acheived with
mutable (and the existing const_cast), but it seems cleaner to accept that
this method affects the state of the session.

This change eliminates an existing const_cast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306041 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-22 18:42:23 +00:00
Zachary Turner
458f91302f Don't include TestingSupport in LLVM_LINK_COMPONENTS.
Instead use target_link_libraries directly.  Thanks to
Juergen Ributzka for the suggestion, which fixes an issue
when llvm is configured with no targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305421 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-14 22:33:43 +00:00
Zachary Turner
83a953d909 [gtest] Create a shared include directory for gtest utilities.
Many times unit tests for different libraries would like to use
the same helper functions for checking common types of errors.

This patch adds a common library with helpers for testing things
in Support, and introduces helpers in here for integrating the
llvm::Error and llvm::Expected<T> classes with gtest and gmock.

Normally, we would just be able to write:

   EXPECT_THAT(someFunction(), succeeded());

but due to some quirks in llvm::Error's move semantics, gmock
doesn't make this easy, so two macros EXPECT_THAT_ERROR() and
EXPECT_THAT_EXPECTED() are introduced to gloss over the difficulties.
Consider this an exception, and possibly only temporary as we
look for ways to improve this.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305395 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-14 16:41:50 +00:00
Zachary Turner
a5be24d937 [PDB] Fix use after free.
Previously MappedBlockStream owned its own BumpPtrAllocator that
it would allocate from when a read crossed a block boundary.  This
way it could still return the user a contiguous buffer of the
requested size.  However, It's not uncommon to open a stream, read
some stuff, close it, and then save the information for later.
After all, since the entire file is mapped into memory, the data
should always be available as long as the file is open.

Of course, the exception to this is when the data isn't *in* the
file, but rather in some buffer that we temporarily allocated to
present this contiguous view.  And this buffer would get destroyed
as soon as the strema was closed.

The fix here is to force the user to specify the allocator, this
way it can provide an allocator that has whatever lifetime it
chooses.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304623 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 00:33:35 +00:00
Zachary Turner
63d6d7548d Fix a bug in MappedBlockStream.
It was using the number of blocks of the entire PDB file as the number
of blocks of each stream that was created.  This was only an issue in
the readLongestContiguousChunk function, which  was never called prior.
This bug surfaced when I updated an algorithm to use this function and
the algorithm broke.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303916 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 21:12:00 +00:00
Zachary Turner
c254cb777d [CodeView] Simplify the use of visiting type records & streams.
There is often a lot of boilerplate code required to visit a type
record or type stream.  The  use case is that you have a sequence
of bytes that represent one or more records, and you want to
deserialize each one, switch on it, and call a callback with the
deserialized record that the user can examine.  Currently this
requires at least 6 lines of code:

  codeview::TypeVisitorCallbackPipeline Pipeline;
  Pipeline.addCallbackToPipeline(Deserializer);
  Pipeline.addCallbackToPipeline(MyCallbacks);

  codeview::CVTypeVisitor Visitor(Pipeline);
  consumeError(Visitor.visitTypeRecord(Record));

With this patch, it becomes one line of code:

  consumeError(codeview::visitTypeRecord(Record, MyCallbacks));

This is done by having the deserialization happen internally inside
of the visitTypeRecord function.  Since this is occasionally not
desirable, the function provides a 3rd parameter that can be used
to change this behavior.

Hopefully this can significantly reduce the barrier to entry
to using the visitation infrastructure.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303271 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-17 16:39:06 +00:00
Zachary Turner
43f488639f Delete dead function causing compilation failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302057 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-03 17:38:49 +00:00
Zachary Turner
f393f97e65 [llvm-readobj] Update readobj to re-use parsing code.
llvm-readobj hand rolls some CodeView parsing code for string
tables, so this patch updates it to re-use some of the newly
introduced parsing code in LLVMDebugInfoCodeView.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302052 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-03 17:11:11 +00:00
Zachary Turner
6b4b26a1a7 Resubmit r301986 and r301987 "Add codeview::StringTable"
This was reverted due to a "missing" file, but in reality
what happened was that I renamed a file, and then due to
a merge conflict both the old file and the new file got
added to the repository.  This led to an unused cpp file
being in the repo and not referenced by any CMakeLists.txt
but #including a .h file that wasn't in the repo.  In an
even more unfortunate coincidence, CMake didn't report the
unused cpp file because it was in a subdirectory of the
folder with the CMakeLists.txt, and not in the same directory
as any CMakeLists.txt.

The presence of the unused file was then breaking certain
tools that determine file lists by globbing rather than
by what's specified in CMakeLists.txt

In any case, the fix is to just remove the unused file from
the patch set.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302042 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-03 15:58:37 +00:00
Daniel Jasper
5d9d83fb55 Revert r301986 (and subsequent r301987).
The patch is failing to add StringTableStreamBuilder.h, but that isn't
even discovered because the corresponding StringTableStreamBuilder.cpp
isn't added to any CMakeLists.txt file and thus never built. I think
this patch is just incomplete.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302002 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-03 07:29:25 +00:00
Zachary Turner
288180ac40 Make codeview::StringTable.
Previously we had knowledge of how to serialize and deserialize
a string table inside of DebugInfo/PDB, but the string table
that it serializes contains a piece that is actually considered
CodeView and can appear outside of a PDB.  We already have logic
in llvm-readobj and MCCodeView to read and write this format,
so it doesn't make sense to duplicate the logic in DebugInfoPDB
as well.

This patch makes codeview::StringTable (for writing) and
codeview::StringTableRef (for reading), updates DebugInfoPDB
to use these classes for its own writing, and updates llvm-readobj
to additionally use StringTableRef for reading.

It's a bit more difficult to get MCCodeView to use this for
writing, but it's a logical next step.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301986 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-02 23:36:17 +00:00
Zachary Turner
479f5fd8d4 Rename pdb::StringTable -> pdb::PDBStringTable.
With the forthcoming codeview::StringTable which a pdb::StringTable
would hold an instance of as one member, this ambiguity becomes
confusing.  Rename to PDBStringTable to avoid this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301948 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-02 18:00:13 +00:00
Zachary Turner
7724dc63a7 [llvm-pdbdump] More advanced class definition dumping.
Previously the dumping of class definitions was very primitive,
and it made it hard to do more than the most trivial of output
formats when dumping.  As such, we would only dump one line for
each field, and then dump non-layout items like nested types
and enums.

With this patch, we do a complete analysis of the object
hierarchy including aggregate types, bases, virtual bases,
vftable analysis, etc.  The only immediately visible effects
of this are that a) we can now dump a line for the vfptr where
before we would treat that as padding, and b) we now don't
treat virtual bases that come at the end of a class as padding
since we have a more detailed analysis of the class's storage
usage.

In subsequent patches, we should be able to use this analysis
to display a complete graphical view of a class's layout including
recursing arbitrarily deep into an object's base class / aggregate
member hierarchy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300133 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 23:18:21 +00:00
Zachary Turner
f3491b21c5 [Support] Move Stream library from MSF -> Support.
After several smaller patches to get most of the core improvements
finished up, this patch is a straight move and header fixup of
the source.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296810 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-02 20:52:51 +00:00
Zachary Turner
22bd547eb3 Re-enable BinaryStreamTest.StreamReaderObject.
This was failing because I was using memcmp to compare two
objects that included padding bytes, which were uninitialized.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296681 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 21:30:06 +00:00
Zachary Turner
6256a696c1 Disable BinaryStreamTest.StreamReaderObject.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296672 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 20:58:28 +00:00
Zachary Turner
ed2fd5866d [PDB] Fix and re-enable BinaryStreamArray test.
This was due to the test stream choosing an arbitrary partition
index for introducing the discontinuity rather than choosing
an index that would be correctly aligned for the type of data.

Also added an assertion into FixedStreamArray so that this will
be caught on all bots in the future, and not just the UBSan bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296661 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 19:29:11 +00:00
Zachary Turner
ece82f9d23 [PDB] Re-add BinaryStreamTest.
This re-adds all the binary stream tests.  This was reverted due
to some misaligned reads.  For now the offending test is
disabled while I investigate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296643 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 17:22:36 +00:00
Vedant Kumar
e6c13ecad7 Remove unittests/DebugInfo/PDB/BinaryStreamTest.cpp (from r296555)
It breaks the ToT UBSan bots:

/Users/vk/Desktop/llvm/include/llvm/DebugInfo/MSF/BinaryStreamArray.h:246:12: runtime error: reference binding to misaligned address 0x7f925540939a for type 'const int', which requires 4 byte alignment
0x7f925540939a: note: pointer points here
 05 00  00 00 01 00 00 00 02 00  00 00 03 00 00 00 00 00  00 00 00 00 00 00 00 00  70 98 50 06 01 00
              ^
0  DebugInfoPDBTests                   0x0000000106263cbd llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 45
1  DebugInfoPDBTests                   0x00000001062628ff llvm::sys::RunSignalHandlers() + 159
2  DebugInfoPDBTests                   0x0000000106264593 SignalHandler(int) + 179
3  libsystem_platform.dylib            0x0000000107bb3fba _sigtramp + 26
4  libsystem_pthread.dylib             0x0000000107bd82c8 _pthread_keys + 9720
5  libsystem_c.dylib                   0x0000000107947f83 abort + 127
6  libclang_rt.ubsan_osx_dynamic.dylib 0x0000000106bb5fc2 __sanitizer::Abort() + 66
7  DebugInfoPDBTests                   0x000000010613f880 llvm::FixedStreamArrayIterator<int>::operator+=(long) + 0
8  DebugInfoPDBTests                   0x000000010613f615 llvm::FixedStreamArrayIterator<int>::operator*() const + 37
9  DebugInfoPDBTests                   0x000000010613f3cb std::__1::enable_if<__is_forward_iterator<llvm::FixedStreamArrayIterator<int> >::value, void>::type std::__1::vector<int, std::__1::allocator<int> >::__construct_at_end<llvm::FixedStreamArrayIterator<int> >(llvm::FixedStreamArrayIterator<int>, llvm::FixedStreamArrayIterator<int>, unsigned long) + 251
10 DebugInfoPDBTests                   0x000000010613f292 std::__1::vector<int, std::__1::allocator<int> >::vector<llvm::FixedStreamArrayIterator<int> >(llvm::FixedStreamArrayIterator<int>, std::__1::enable_if<(__is_forward_iterator<llvm::FixedStreamArrayIterator<int> >::value) && (is_constructible<int, std::__1::iterator_traits<llvm::FixedStreamArrayIterator<int> >::reference>::value), llvm::FixedStreamArrayIterator<int> >::type) + 226
11 DebugInfoPDBTests                   0x000000010613ddb7 std::__1::vector<int, std::__1::allocator<int> >::vector<llvm::FixedStreamArrayIterator<int> >(llvm::FixedStreamArrayIterator<int>, std::__1::enable_if<(__is_forward_iterator<llvm::FixedStreamArrayIterator<int> >::value) && (is_constructible<int, std::__1::iterator_traits<llvm::FixedStreamArrayIterator<int> >::reference>::value), llvm::FixedStreamArrayIterator<int> >::type) + 87
12 DebugInfoPDBTests                   0x000000010613d4af (anonymous namespace)::BinaryStreamTest_StreamReaderIntegerArray_Test::TestBody() + 1279
13 DebugInfoPDBTests                   0x00000001062780f3 testing::Test::Run() + 179
14 DebugInfoPDBTests                   0x0000000106279594 testing::TestInfo::Run() + 308
15 DebugInfoPDBTests                   0x000000010627a6a3 testing::TestCase::Run() + 307
16 DebugInfoPDBTests                   0x00000001062849d4 testing::internal::UnitTestImpl::RunAllTests() + 756
17 DebugInfoPDBTests                   0x0000000106284558 testing::UnitTest::Run() + 152
18 DebugInfoPDBTests                   0x0000000106266fa5 main + 117
19 libdyld.dylib                       0x00000001078506a5 start + 1
zsh: abort      ./unittests/DebugInfo/PDB/DebugInfoPDBTests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296641 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 17:10:03 +00:00
Zachary Turner
952e6397e2 [PDB] Remove use of std error codes.
I already created a BinaryStreamError class for this purpose,
so update the code to use that on the remaining occurrences
of errc values.

This should also address the issue which led to r296583.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296640 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 17:02:41 +00:00
NAKAMURA Takumi
de3bf07274 (Rewroking r296581) PDB/BinaryStreamTest.cpp: Appease mingw to avoid std::errc::no_buffer_space.
Unfortunately, mingw's libstdc++ doesn't provide winsock2 errors.
That said, we should avoid raising OS-oriented error code in our code.

For now, I suggest to define custom error from std::error_category.
See also; https://reviews.llvm.org/D20592

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296583 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 05:11:41 +00:00
NAKAMURA Takumi
0d660ddb6d Revert r296581, "PDB/BinaryStreamTest.cpp: Appease mingw to avoid std::errc::no_buffer_space."
Wrong commit -- I have unstaged changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296582 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 05:11:37 +00:00
NAKAMURA Takumi
f2c4103083 PDB/BinaryStreamTest.cpp: Appease mingw to avoid std::errc::no_buffer_space.
Unfortunately, mingw's libstdc++ doesn't provide winsock2 errors.
That said, we should avoid raising OS-oriented error code in our code.

For now, I suggest to define custom error from std::error_category.
See also; https://reviews.llvm.org/D20592

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296581 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 05:06:31 +00:00
Zachary Turner
22de43b01e Move constexpr arrays out of class definition.
GCC Linker doesn't seem to like this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296560 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 01:17:31 +00:00
Zachary Turner
2848ebe89e Fix signed / unsigned comparison warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296557 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 01:07:10 +00:00
Zachary Turner
00d9a548e8 [PDB] Add an additional test for BinaryStreamRef.
A bug was uncovered where if you have a StreamRef whose ViewOffset
is > 0, then when you call readLongestContiguousChunk it will
succeed even when it shouldn't, and it always return you a
buffer that was taken as if the ViewOffset was 0.

Fixed this bug and added a test for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296556 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 01:04:16 +00:00
Zachary Turner
854f9fd147 [PDB] Add tests for BinaryStream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296555 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 01:03:53 +00:00
Zachary Turner
54a7acb455 [PDB] Add BinaryStreamError.
This migrates the stream code away from MSFError to using its
own custom Error class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296494 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 17:49:34 +00:00
Zachary Turner
d9b4aa7542 [PDB] Make streams carry their own endianness.
Before the endianness was specified on each call to read
or write of the StreamReader / StreamWriter, but in practice
it's extremely rare for streams to have data encoded in
multiple different endiannesses, so we should optimize for the
99% use case.

This makes the code cleaner and more general, but otherwise
has NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296415 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 00:04:07 +00:00
Zachary Turner
2219387eaf [PDB] Partial resubmit of r296215, which improved PDB Stream Library.
This was reverted because it was breaking some builds, and
because of incorrect error code usage.  Since the CL was
large and contained many different things, I'm resubmitting
it in pieces.

This portion is NFC, and consists of:

1) Renaming classes to follow a consistent naming convention.
2) Fixing the const-ness of the interface methods.
3) Adding detailed doxygen comments.
4) Fixing a few instances of passing `const BinaryStream& X`.  These
   are now passed as `BinaryStreamRef X`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296394 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-27 22:11:43 +00:00
NAKAMURA Takumi
96678fa6d8 Revert r296215, "[PDB] General improvements to Stream library." and followings.
r296215, "[PDB] General improvements to Stream library."
r296217, "Disable BinaryStreamTest.StreamReaderObject temporarily."
r296220, "Re-enable BinaryStreamTest.StreamReaderObject."
r296244, "[PDB] Disable some tests that are breaking bots."
r296249, "Add static_cast to silence -Wc++11-narrowing."

std::errc::no_buffer_space should be used for OS-oriented errors for socket transmission.
(Seek discussions around llvm/xray.)

I could substitute s/no_buffer_space/others/g, but I revert whole them ATM.

Could we define and use LLVM errors there?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296258 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-25 17:04:23 +00:00
Daniel Jasper
b646c0a82a Add static_cast to silence -Wc++11-narrowing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296249 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-25 07:53:36 +00:00
Zachary Turner
f18ff27042 [PDB] Disable some tests that are breaking bots.
This has to do with big endian, but I can't fix it until
Monday.  The code itself is fine, just the tests are wrong.
Disabling 3 tests for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296244 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-25 05:57:57 +00:00
Zachary Turner
0a1a6e3516 Re-enable BinaryStreamTest.StreamReaderObject.
I had an invalid pointer / size calculation that was causing
a stack smash.  Should be fixed now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296220 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-25 01:20:08 +00:00
Zachary Turner
9e80319674 Disable BinaryStreamTest.StreamReaderObject temporarily.
This is crashing on some bots, so I need some time to investigate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296217 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-25 00:52:59 +00:00
Zachary Turner
5433d115a4 [PDB] General improvements to Stream library.
This adds various new functionality and cleanup surrounding the
use of the Stream library.  Major changes include:

* Renaming of all classes for more consistency / meaningfulness
* Addition of some new methods for reading multiple values at once.
* Full suite of unit tests for reader / writer functionality.
* Full set of doxygen comments for all classes.
* Streams now store their own endianness.
* Fixed some bugs in a few of the classes that were discovered
  by the unit tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296215 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-25 00:44:30 +00:00
Zachary Turner
40ea28492e [PDB] Rename Stream related source files.
This is part of a larger effort to get the Stream code moved
up to Support.  I don't want to do it in one large patch, in
part because the changes are so big that it will treat everything
as file deletions and add, losing history in the process.
Aside from that though, it's just a good idea in general to
make small changes.

So this change only changes the names of the Stream related
source files, and applies necessary source fix ups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296211 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-25 00:33:34 +00:00
Adrian McCarthy
0ca20ba516 Fix unit tests after r296049.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296055 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-24 00:25:17 +00:00
Zachary Turner
980cadce13 Don't assume little endian in StreamReader / StreamWriter.
In an effort to generalize this so it can be used by more than
just PDB code, we shouldn't assume little endian.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295525 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-18 01:35:33 +00:00
Zachary Turner
3e9ce61e33 [pdb] Add the ability to resolve TypeServer PDBs.
Some PDBs or object files can contain references to other PDBs
where the real type information lives.  When this happens,
all type indices in the original PDB are meaningless because
their records are not there.

With this patch we add the ability to pull type info from those
secondary PDBs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295382 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-16 23:35:45 +00:00
Adrian McCarthy
60c9e9f95d Fix for r293104, which renamed a directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293105 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-25 22:48:57 +00:00
Zachary Turner
9c1e7a6062 [pdb] Write the Named Stream mapping to Yaml and binary.
Differential Revision: https://reviews.llvm.org/D28919

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292665 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-20 22:42:09 +00:00
Zachary Turner
f213f1173e [PDB] Rename some files to be more intuitive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292663 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-20 22:41:15 +00:00
Zachary Turner
1efbd52b3e [pdb] Add HashTable data structure.
This was being parsed / serialized ad-hoc inside the code
for a specific PDB stream.  But this data structure is used
in multiple ways / places within the PDB format.  To be able
to re-use it we need to raise this code out and make it more
generic.  In doing so, a number of bugs are fixed in the
original implementation, and support is added for growing
the hash table and deleting items from the hash table,
which had either been omitted or incorrect implemented in
the initial version.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292535 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-19 23:31:24 +00:00
Rui Ueyama
4b8b0ba562 PDB: Add a class to create the /names stream contents.
This patch adds a new class NameHashTableBuilder which creates /names streams.
This patch contains a test to confirm that a stream created by
NameHashTableBuilder can be read by NameHashTable reader class.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292040 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 00:36:02 +00:00
David Majnemer
9b671f3db3 [PDB] Validate superblock addresses
- Validate the address of the block map.
- Validate the address of the free block map.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290053 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-18 00:41:10 +00:00
Zachary Turner
f5898c18e7 [pdb] Fix unit test compilation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281560 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 23:17:08 +00:00
Zachary Turner
5e117855c3 [msf] Resubmit "Rename Msf -> MSF".
Previously this change was submitted from a Windows machine, so
changes made to the case of filenames and directory names did
not survive the commit, and as a result the CMake source file
names and the on-disk file names did not match on case-sensitive
file systems.

I'm resubmitting this patch from a Linux system, which hopefully
allows the case changes to make it through unfettered.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277213 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 20:56:36 +00:00
Zachary Turner
85c3e3ee9c Revert "[msf] Rename Msf to MSF."
This reverts commit 4d1557ffac.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277194 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 18:38:47 +00:00
Zachary Turner
4d1557ffac [msf] Rename Msf to MSF.
In a previous patch, it was suggested to use all caps instead of
rolling caps for initialisms, so this patch changes everything
to do this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 18:24:26 +00:00