summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/DebugInfo/PDB
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* [pdb] Fix build errors in PDB unit tests.Zachary Turner2016-06-081-8/+15
| | | | llvm-svn: 272174
* [pdb] Fix broken unit test compilation.Zachary Turner2016-06-071-4/+4
| | | | llvm-svn: 272059
* [pdb] Fix broken unit tests after r271982.Zachary Turner2016-06-071-11/+13
| | | | llvm-svn: 271983
* [CodeView] Take the StreamRef::readBytes offset into account when validatingDavid Majnemer2016-06-021-0/+2
| | | | | | | | 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
* Rework r271439. I forgot to save the buffer for editing.NAKAMURA Takumi2016-06-011-1/+1
| | | | llvm-svn: 271441
* MappedBlockStreamTest.cpp: Simplify array initializers.NAKAMURA Takumi2016-06-011-2/+2
| | | | llvm-svn: 271439
* [pdb] silence warnings about moving from a temporary.Zachary Turner2016-06-011-2/+2
| | | | llvm-svn: 271420
* [CodeView] Make sure StreamRef::readBytes doesn't read too muchDavid Majnemer2016-06-011-5/+17
| | | | llvm-svn: 271418
* [PDB] Silence sign comparison warnings in MappedBlockStreamTestDavid Majnemer2016-06-011-8/+8
| | | | llvm-svn: 271416
* MappedBlockStreamTest.cpp: Appease msc18 to avoid initializer for std::vector.NAKAMURA Takumi2016-06-011-2/+6
| | | | llvm-svn: 271397
* DebugInfoPDBTests: Update libdeps for r271346.NAKAMURA Takumi2016-06-011-0/+1
| | | | llvm-svn: 271355
* [pdb] Add unit tests for PDB MappedBlockStream and zero copyZachary Turner2016-05-312-0/+162
| | | | | | | Differential Revision: http://reviews.llvm.org/D20837 Reviewed By: ruiu llvm-svn: 271346
* Fix build of DebugInfoPDBTests.Zachary Turner2016-05-041-0/+1
| | | | | | Missing a using statement. llvm-svn: 268552
OpenPOWER on IntegriCloud