summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/DebugInfo/PDB
Commit message (Collapse)AuthorAgeFilesLines
...
* Disable BinaryStreamTest.StreamReaderObject.Zachary Turner2017-03-011-1/+1
| | | | llvm-svn: 296672
* [PDB] Fix and re-enable BinaryStreamArray test.Zachary Turner2017-03-011-36/+38
| | | | | | | | | | | 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. llvm-svn: 296661
* [PDB] Re-add BinaryStreamTest.Zachary Turner2017-03-012-0/+701
| | | | | | | | 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. llvm-svn: 296643
* Remove unittests/DebugInfo/PDB/BinaryStreamTest.cpp (from r296555)Vedant Kumar2017-03-012-701/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 296641
* [PDB] Remove use of std error codes.Zachary Turner2017-03-011-7/+6
| | | | | | | | | | 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. llvm-svn: 296640
* (Rewroking r296581) PDB/BinaryStreamTest.cpp: Appease mingw to avoid ↵NAKAMURA Takumi2017-03-011-3/+4
| | | | | | | | | | | | 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 llvm-svn: 296583
* Revert r296581, "PDB/BinaryStreamTest.cpp: Appease mingw to avoid ↵NAKAMURA Takumi2017-03-011-3/+3
| | | | | | | | std::errc::no_buffer_space." Wrong commit -- I have unstaged changes. llvm-svn: 296582
* PDB/BinaryStreamTest.cpp: Appease mingw to avoid std::errc::no_buffer_space.NAKAMURA Takumi2017-03-011-3/+3
| | | | | | | | | | 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 llvm-svn: 296581
* Move constexpr arrays out of class definition.Zachary Turner2017-03-011-3/+4
| | | | | | GCC Linker doesn't seem to like this. llvm-svn: 296560
* Fix signed / unsigned comparison warning.Zachary Turner2017-03-011-1/+1
| | | | llvm-svn: 296557
* [PDB] Add an additional test for BinaryStreamRef.Zachary Turner2017-03-011-2/+58
| | | | | | | | | | | 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. llvm-svn: 296556
* [PDB] Add tests for BinaryStream.Zachary Turner2017-03-012-0/+644
| | | | llvm-svn: 296555
* [PDB] Add BinaryStreamError.Zachary Turner2017-02-281-6/+6
| | | | | | | This migrates the stream code away from MSFError to using its own custom Error class. llvm-svn: 296494
* [PDB] Make streams carry their own endianness.Zachary Turner2017-02-283-10/+15
| | | | | | | | | | | | | 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. llvm-svn: 296415
* [PDB] Partial resubmit of r296215, which improved PDB Stream Library.Zachary Turner2017-02-273-39/+40
| | | | | | | | | | | | | | | | | 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`. llvm-svn: 296394
* Revert r296215, "[PDB] General improvements to Stream library." and followings.NAKAMURA Takumi2017-02-255-812/+48
| | | | | | | | | | | | | | | | | 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? llvm-svn: 296258
* Add static_cast to silence -Wc++11-narrowing.Daniel Jasper2017-02-251-1/+1
| | | | llvm-svn: 296249
* [PDB] Disable some tests that are breaking bots.Zachary Turner2017-02-251-3/+3
| | | | | | | | 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. llvm-svn: 296244
* Re-enable BinaryStreamTest.StreamReaderObject.Zachary Turner2017-02-252-34/+28
| | | | | | | I had an invalid pointer / size calculation that was causing a stack smash. Should be fixed now. llvm-svn: 296220
* Disable BinaryStreamTest.StreamReaderObject temporarily.Zachary Turner2017-02-251-33/+33
| | | | | | This is crashing on some bots, so I need some time to investigate. llvm-svn: 296217
* [PDB] General improvements to Stream library.Zachary Turner2017-02-255-48/+818
| | | | | | | | | | | | | | | 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. llvm-svn: 296215
* [PDB] Rename Stream related source files.Zachary Turner2017-02-253-11/+11
| | | | | | | | | | | | | | 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. llvm-svn: 296211
* Fix unit tests after r296049.Adrian McCarthy2017-02-241-1/+1
| | | | llvm-svn: 296055
* Don't assume little endian in StreamReader / StreamWriter.Zachary Turner2017-02-181-6/+6
| | | | | | | In an effort to generalize this so it can be used by more than just PDB code, we shouldn't assume little endian. llvm-svn: 295525
* [pdb] Add the ability to resolve TypeServer PDBs.Zachary Turner2017-02-162-0/+176
| | | | | | | | | | | | | | 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 llvm-svn: 295382
* Fix for r293104, which renamed a directory.Adrian McCarthy2017-01-252-3/+3
| | | | llvm-svn: 293105
* [pdb] Write the Named Stream mapping to Yaml and binary.Zachary Turner2017-01-201-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D28919 llvm-svn: 292665
* [PDB] Rename some files to be more intuitive.Zachary Turner2017-01-202-8/+8
| | | | llvm-svn: 292663
* [pdb] Add HashTable data structure.Zachary Turner2017-01-192-0/+168
| | | | | | | | | | | | | | | | 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 llvm-svn: 292535
* PDB: Add a class to create the /names stream contents.Rui Ueyama2017-01-152-0/+55
| | | | | | | | | | 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 llvm-svn: 292040
* [PDB] Validate superblock addressesDavid Majnemer2016-12-181-0/+1
| | | | | | | - Validate the address of the block map. - Validate the address of the free block map. llvm-svn: 290053
* [pdb] Fix unit test compilation.Zachary Turner2016-09-142-15/+23
| | | | llvm-svn: 281560
* [msf] Resubmit "Rename Msf -> MSF".Zachary Turner2016-07-293-57/+57
| | | | | | | | | | | | | 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. llvm-svn: 277213
* Revert "[msf] Rename Msf to MSF."Zachary Turner2016-07-293-57/+57
| | | | | | This reverts commit 4d1557ffac41e079bcb1abbcf04f512474dcd6fe. llvm-svn: 277194
* [msf] Rename Msf to MSF.Zachary Turner2016-07-293-57/+57
| | | | | | | | 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. llvm-svn: 277190
* [pdb] Fix another narrowing conversion on x64 builds.Zachary Turner2016-07-281-1/+1
| | | | llvm-svn: 277026
* [pdb] Refactor library to more clearly separate reading/writingZachary Turner2016-07-282-104/+94
| | | | | | | Reviewed By: amccarth, ruiu Differential Revision: https://reviews.llvm.org/D22693 llvm-svn: 277019
* Get rid of IMsfStreamData class.Zachary Turner2016-07-281-75/+99
| | | | | | | | | | | | | | | | | | | | This was a pure virtual base class whose purpose was to abstract away the notion of how you retrieve the layout of a discontiguous stream of blocks in an Msf file. This led to too many layers of abstraction making it difficult to figure out what was going on and extend things. Ultimately, a stream's layout is decided by its length and the array of block numbers that it lives on. So rather than have an abstract base class which can return this in any number of ways, it's more straightforward to simply store them as fields of a trivial struct, and also to give a more appropriate name. This patch does that. It renames IMsfStreamData to MsfStreamLayout, and deletes the 2 concrete implementations, DirectoryStreamData and IndexedStreamData. MsfStreamLayout is a trivial struct with the necessary data. llvm-svn: 277018
* Fix dangling reference to temporary in use of ArrayRefReid Kleckner2016-07-281-1/+3
| | | | | | Fixes tests locally for me with MSVC 2015. llvm-svn: 277015
* Make DebugInfoMsf a dependency of DebugInfoPDBTests.Zachary Turner2016-07-221-0/+1
| | | | | | | For some reason this doesn't cause linker errors with MSVC or clang-cl, but the bots seem to be failing with other compilers. llvm-svn: 276463
* [msf] Create LLVMDebugInfoMsfZachary Turner2016-07-222-19/+17
| | | | | | | | | | | | | | 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
* [pdb] Teach MsfBuilder and other classes about the Free Page Map.Zachary Turner2016-07-151-20/+26
| | | | | | | | | | | | | | 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
* [pdb] Use MsfBuilder to handle the writing PDBs.Zachary Turner2016-07-151-2/+56
| | | | | | | | | | | | | | | 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
* [pdb] Introduce MsfBuilder for laying out PDB files.Zachary Turner2016-07-154-17/+345
| | | | | | | Reviewed by: ruiu Differential Revision: https://reviews.llvm.org/D22308 llvm-svn: 275611
* [llvm-pdbdump] Propagate errors a little more consistentlyDavid Majnemer2016-07-101-2/+2
| | | | | | | PDBFile::getBlockData didn't really return any indication that it failed. It merely returned an empty buffer. llvm-svn: 275009
* Try to fix compilation error in DebugInfoPDBTests.Zachary Turner2016-07-081-1/+3
| | | | llvm-svn: 274881
* DebugInfoPDBTests:MappedBlockStreamTest.TestWriteThenRead: Avoid assigning ↵NAKAMURA Takumi2016-06-111-1/+3
| | | | | | temporary object to ArrayRef. llvm-svn: 272457
* Try again to fix this endianness issue.Zachary Turner2016-06-101-17/+15
| | | | llvm-svn: 272440
* [pdb] Fix issues with pdb writing.Zachary Turner2016-06-101-1/+4
| | | | | | | | | 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
* Add support for writing through StreamInterface.Zachary Turner2016-06-101-22/+285
| | | | | | | | | | | 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
OpenPOWER on IntegriCloud