summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Raw
Commit message (Collapse)AuthorAgeFilesLines
...
* [pdb] Refactor library to more clearly separate reading/writingZachary Turner2016-07-2812-314/+254
| | | | | | | Reviewed By: amccarth, ruiu Differential Revision: https://reviews.llvm.org/D22693 llvm-svn: 277019
* Get rid of IMsfStreamData class.Zachary Turner2016-07-288-11/+7
| | | | | | | | | | | | | | | | | | | | 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
* Make PDBFile store an msf::Layout.Zachary Turner2016-07-222-44/+43
| | | | | | | | | | | Previously it was storing all the fields of an msf::Layout as separate members. This is a trivial cleanup to make it store an msf::Layout directly. This makes the code more readable since it becomes clear which fields of PDBFile are actually the msf specific layout information in a sea of other bookkeeping fields. llvm-svn: 276460
* [pdb] Have builders share a single BumpPtrAllocator.Zachary Turner2016-07-223-11/+17
| | | | | | | | | | | | | This makes it easier to have the writable and readable PDB interfaces share code since the read/write and write-only interfaces now share a single allocator, you don't have to worry about a builder building a read only interface and then having the read-only interface's data become corrupt when the builder goes out of scope. Now the allocator is specified explicitly to all constructors, so all interfaces can share a single allocator that is scoped appropriately. llvm-svn: 276459
* [msf] Create LLVMDebugInfoMsfZachary Turner2016-07-2218-724/+75
| | | | | | | | | | | | | | 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] Move file layout header structs to RawTypes.hZachary Turner2016-07-223-80/+26
| | | | | | | | This facilitates code reuse between the builder classes and the "frozen" read only versions of the classes used for parsing existing PDB files. llvm-svn: 276427
* [pdb] Round-trip module & file info to/from YAML.Zachary Turner2016-07-225-64/+226
| | | | | | | | | | This implements support for writing compiland and compiland source file info to a binary PDB. This is tested by adding support for dumping these fields from an existing PDB to yaml, reading them back in, and dumping them again and verifying the values are as expected. llvm-svn: 276426
* [pdb] Teach MsfBuilder and other classes about the Free Page Map.Zachary Turner2016-07-153-8/+16
| | | | | | | | | | | | | | 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] Round trip the NameMap data structure to YAML.Zachary Turner2016-07-153-7/+75
| | | | llvm-svn: 275628
* [pdb] Use MsfBuilder to handle the writing PDBs.Zachary Turner2016-07-158-135/+165
| | | | | | | | | | | | | | | 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
* DebugInfo: reorder some initializersSaleem Abdulrasool2016-07-151-2/+2
| | | | | | Fix a few initialization ordering warnings from gcc from `-Wreorder`. NFC. llvm-svn: 275615
* [pdb] Introduce MsfBuilder for laying out PDB files.Zachary Turner2016-07-152-0/+288
| | | | | | | Reviewed by: ruiu Differential Revision: https://reviews.llvm.org/D22308 llvm-svn: 275611
* Re-enable TPI hash verification for enum records.Rui Ueyama2016-07-121-1/+1
| | | | | | | We didn't read unique names correctly. As a result, we computed hashes on (non-)unique names instead of unique names. llvm-svn: 275150
* Refactor the PDB writing to use a builder approachZachary Turner2016-07-116-121/+273
| | | | llvm-svn: 275110
* Give helper classes/functions internal linkage. NFC.Benjamin Kramer2016-07-101-2/+2
| | | | llvm-svn: 275014
* [pdb] Sanity check the stream mapDavid Majnemer2016-07-101-1/+7
| | | | | | | | Some abstractions in LLVM "know" that they are reading in-bounds, FixedStreamArray, and provide a simple result. This breaks down if the stream map is bogus. llvm-svn: 275010
* [llvm-pdbdump] Propagate errors a little more consistentlyDavid Majnemer2016-07-102-9/+18
| | | | | | | PDBFile::getBlockData didn't really return any indication that it failed. It merely returned an empty buffer. llvm-svn: 275009
* [pdb] Round trip the PDB stream between YAML and binary PDB.Zachary Turner2016-07-068-11/+164
| | | | | | This gets writing of the PDB stream working. llvm-svn: 274647
* Disable hash verification of enums.Zachary Turner2016-07-062-1/+3
| | | | llvm-svn: 274639
* [pdb] Check the display name for <unnamed-tag>, not the linkage nameReid Kleckner2016-07-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This issue was encountered on libcmt.pdb, which has a type record that looks like this: Struct (0x1094) { TypeLeafKind: LF_STRUCTURE (0x1505) MemberCount: 3 Properties [ (0x200) HasUniqueName (0x200) ] FieldList: <field list> (0x1093) DerivedFrom: 0x0 VShape: 0x0 SizeOf: 4 Name: <unnamed-tag> LinkageName: .?AU<unnamed-tag>@@ } The checks for startswith/endswith "<unnamed-tag>" should look at the display name, not the linkage name. llvm-svn: 274376
* [pdb] Avoid reporting an error when the module symbol stream is emptyReid Kleckner2016-07-011-0/+3
| | | | llvm-svn: 274309
* [PDB] Indicate which type record failed hash validationReid Kleckner2016-07-011-2/+8
| | | | llvm-svn: 274308
* [pdb] Re-add code to write PDB files.Zachary Turner2016-06-302-47/+88
| | | | | | | | | Somehow all the functionality to write PDB files got removed, probably accidentally when uploading the patch perhaps the wrong one got uploaded. This re-adds all the code, as well as the corresponding test. llvm-svn: 274248
* [pdb] Treat a stream size of ~0U as 0Reid Kleckner2016-06-221-2/+4
| | | | | | My PDBs always have this size for stream 11. Not sure why. llvm-svn: 273504
* [codeview] Add an extra check for TPI hash values.Rui Ueyama2016-06-201-2/+10
| | | | | | | This patch adds a function that corresponds to `fUDTAnon` and use that to compute TPI hash values as the reference does. llvm-svn: 273139
* [pdb] Don't error on missing FPO streamsReid Kleckner2016-06-171-0/+5
| | | | | | | | 64-bit PDBs never have FPO data. They have xdata instead. Also improve error recovery of stream summary dumping while I'm here. llvm-svn: 273046
* [codeview] Use hashBufferV8 to verify all type records.Rui Ueyama2016-06-161-15/+15
| | | | | | Differential Revision: http://reviews.llvm.org/D21393 llvm-svn: 272930
* Resubmit "[pdb] Change type visitor pattern to be dynamic."Zachary Turner2016-06-162-19/+23
| | | | | | | There was a regression introduced during type stream merging when visiting a field list record. This has been fixed in this patch. llvm-svn: 272929
* Revert "[pdb] Change type visitor pattern to be dynamic."Zachary Turner2016-06-162-23/+19
| | | | | | | | This reverts commit fb0dd311e1ad945827b8ffd5354f4810e2be1579. This breaks some llvm-readobj tests. llvm-svn: 272927
* [pdb] Change type visitor pattern to be dynamic.Zachary Turner2016-06-162-19/+23
| | | | | | | | | | | | | | | This allows better catching of compiler errors since we can use the override keyword to verify that methods are actually overridden. Also in this patch I've changed from storing a boolean Error code everywhere to returning an llvm::Error, to propagate richer error information up the call stack. Reviewed By: ruiu, rnk Differential Revision: http://reviews.llvm.org/D21410 llvm-svn: 272926
* [codeview] Pass CVRecord to visitTypeBegin callback.Rui Ueyama2016-06-161-3/+1
| | | | | | | | | Both parameters to visitTypeBegin are actually members of CVRecord, so we can just pass CVRecord instead of destructuring it. Differential Revision: http://reviews.llvm.org/D21435 llvm-svn: 272899
* [codeview] Remove unused parameter.Rui Ueyama2016-06-161-9/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D21433 llvm-svn: 272898
* Implement pdb::hashBufferV8 hash function.Rui Ueyama2016-06-162-10/+55
| | | | llvm-svn: 272894
* Remove redundant namespace specifiers.Rui Ueyama2016-06-161-9/+9
| | | | llvm-svn: 272889
* [codeview] Use CVTypeVisitor instead of a hand-written switch-cases.Rui Ueyama2016-06-161-68/+64
| | | | | | Differential Revision: http://reviews.llvm.org/D21418 llvm-svn: 272888
* [pdbdump] Verify LF_{CLASS,ENUM,INTERFACE,STRUCTURE,UNION} records.Rui Ueyama2016-06-151-8/+53
| | | | | | Differential Revision: http://reviews.llvm.org/D21361 llvm-svn: 272815
* [pdbdump] Verify TPI hash for LF_ENUM type records.Rui Ueyama2016-06-141-5/+21
| | | | llvm-svn: 272728
* Resubmit "[pdb] Actually write a PDB to disk from YAML.""Zachary Turner2016-06-141-0/+15
| | | | | | | Reviewed By: ruiu Differential Revision: http://reviews.llvm.org/D21220 llvm-svn: 272708
* Revert "[pdb] Actually write a PDB to disk from YAML."Zachary Turner2016-06-141-15/+0
| | | | | | | | | This reverts commit 879139e1c6577b09df52de56a6bab856a19ed185. This was committed accidentally when I blindly typed git svn dcommit instead of the command to generate a patch. llvm-svn: 272693
* [pdb] Actually write a PDB to disk from YAML.Zachary Turner2016-06-141-0/+15
| | | | llvm-svn: 272692
* [pdb] Fix issues with pdb writing.Zachary Turner2016-06-101-1/+1
| | | | | | | | | 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
* Make PDBFile take a StreamInterface instead of a MemBuffer.Zachary Turner2016-06-102-118/+79
| | | | | | | | | | | | | | | This is the next step towards being able to write PDBs. MemoryBuffer is immutable, and StreamInterface is our replacement which can be any combination of read-only, read-write, or write-only depending on the particular implementation. The one place where we were creating a PDBFile (in RawSession) is updated to subclass ByteStream with a simple adapter that holds a MemoryBuffer, and initializes the superclass with the buffer's array, so that all the functionality of ByteStream works transparently. llvm-svn: 272370
* Add support for writing through StreamInterface.Zachary Turner2016-06-103-9/+169
| | | | | | | | | | | 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
* [pdbdump] Verify part of TPI hash streams.Rui Ueyama2016-06-091-0/+28
| | | | | | | | | | | | | | | | | TPI hash table contains a parallel array for the type records. For each type record R, a hash value is calculated by `H(R) % NumBuckets` where H is a hash function, and the result is stored to a bucket element. H is TPI1::hashPrec function in microsoft-pdb repository. Our hash function does not support all type record types yet. Currently it supports only records for line number. I'll extend it in a follow up patch. The aim of verify the hash table is not only detect corrupted files. It ensures that our understanding of how the hash values are calculated is correct. llvm-svn: 272229
* Function names should start with lowercase letters.Rui Ueyama2016-06-082-3/+3
| | | | llvm-svn: 272225
* [PDB] Move PDB functions to a separate file.Rui Ueyama2016-06-082-59/+78
| | | | | | | | We are going to use the hash functions from TPI streams. Differential Revision: http://reviews.llvm.org/D21142 llvm-svn: 272223
* [pdb] Handle stream index errors better.Zachary Turner2016-06-088-89/+143
| | | | | | | Reviewed By: ruiu Differential Revision: http://reviews.llvm.org/D21128 llvm-svn: 272172
* Remove a patch .rej file.Rui Ueyama2016-06-081-11/+0
| | | | llvm-svn: 272171
* [pdb] Try to fix use after free.Zachary Turner2016-06-083-0/+13
| | | | llvm-svn: 272078
* [pdbdump] Print out # of hash buckets.Rui Ueyama2016-06-071-0/+1
| | | | | | In the reference code, the field name is `cHashBuckets`. llvm-svn: 272075
OpenPOWER on IntegriCloud