summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Raw
Commit message (Collapse)AuthorAgeFilesLines
...
* [pdbdump] Print out TPI hash key size.Rui Ueyama2016-06-071-0/+2
| | | | llvm-svn: 272073
* [pdb] Convert StringRefs to ArrayRef<uint8_t>s.Zachary Turner2016-06-072-9/+11
| | | | llvm-svn: 272058
* [pdb] Fix a potential overflow and remove unnecessary comments.Zachary Turner2016-06-071-3/+0
| | | | llvm-svn: 272043
* [pdb] Use MappedBlockStream to parse the PDB directory.Zachary Turner2016-06-0710-125/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to efficiently write PDBs, we need to be able to make a StreamWriter class similar to a StreamReader, which can transparently deal with writing to discontiguous streams, and we need to use this for all writing, similar to how we use StreamReader for all reading. Most discontiguous streams are the typical numbered streams that appear in a PDB file and are described by the directory, but the exception to this, that until now has been parsed by hand, is the directory itself. MappedBlockStream works by querying the directory to find out which blocks a stream occupies and various other things, so naturally the same logic could not possibly work to describe the blocks that the directory itself resided on. To solve this, I've introduced an abstraction IPDBStreamData, which allows the client to query for the list of blocks occupied by the stream, as well as the stream length. I provide two implementations of this: one which queries the directory (for indexed streams), and one which queries the super block (for the directory stream). This has the side benefit of vastly simplifying the code to parse the directory. Whereas before a mini state machine was rolled by hand, now we simply use FixedStreamArray to read out the stream sizes, then build a vector of FixedStreamArrays for the stream map, all in just a few lines of code. Reviewed By: ruiu Differential Revision: http://reviews.llvm.org/D21046 llvm-svn: 271982
* Add comments.Rui Ueyama2016-06-071-0/+2
| | | | llvm-svn: 271967
* [pdbdump] Verify the size of TPI hash records.Rui Ueyama2016-06-061-0/+5
| | | | llvm-svn: 271954
* [pdbdump] Print out New FPO stream contents.Rui Ueyama2016-06-061-1/+24
| | | | | | | | | | The data strucutre in the new FPO stream is described in the PE/COFF spec. There is one record per function if frame pointer is omitted. Differential Revision: http://reviews.llvm.org/D20999 llvm-svn: 271926
* [DebugInfo, PDB] Use sparse bitfields for the name mapDavid Majnemer2016-06-041-21/+12
| | | | | | | The name map might not be densely packed on disk. Using a sparse map will save memory in such situations. llvm-svn: 271811
* pdbdump: print out TPI hashes.Rui Ueyama2016-06-031-9/+29
| | | | | | Differential Revision: http://reviews.llvm.org/D20945 llvm-svn: 271736
* [pdb] Print out file names instead of file offsets.Zachary Turner2016-06-033-8/+44
| | | | | | | | | | | | When printing line information and file checksums, we were printing the file offset field from the struct header. This teaches llvm-pdbdump how to turn those numbers into the filename. In the case of file checksums, this is done by looking in the global string table. In the case of line contributions, this is done by indexing into the file names buffer of the DBI stream. Why they use a different technique I don't know. llvm-svn: 271630
* [codeview] Dump line number and column information.Zachary Turner2016-06-032-50/+1
| | | | | | | | | | | | | | | | | | | | | | | | | To facilitate this, a couple of changes had to be made: 1. `ModuleSubstream` got moved from `DebugInfo/PDB` to `DebugInfo/CodeView`, and various codeview related types are defined there. It turns out `DebugInfo/CodeView/Line.h` already defines many of these structures, but this is really old code that is not endian aware, doesn't interact well with `StreamInterface` and not very helpful for getting stuff out of a PDB. Eventually we should migrate the old readobj `COFFDumper` code to these new structures, or at least merge their functionality somehow. 2. A `ModuleSubstream` visitor is introduced. Depending on where your module substream array comes from, different subsets of record types can be expected. We are already hand parsing these substream arrays in many places especially in `COFFDumper.cpp`. In the future we can migrate these paths to the visitor as well, which should reduce a lot of code in `COFFDumper.cpp`. Differential Revision: http://reviews.llvm.org/D20936 Reviewed By: ruiu, majnemer llvm-svn: 271621
* Add comments.Rui Ueyama2016-06-021-0/+2
| | | | llvm-svn: 271597
* [llvm-pdbdump] Dump CodeView line information.Zachary Turner2016-06-022-3/+58
| | | | | | | | | This first pass only splits apart the records and dumps the line info kinds and binary data. Subsequent patches will parse out the binary data into more useful information and dump it in detail. llvm-svn: 271576
* pdbdump: print out COFF section headers.Rui Ueyama2016-06-021-1/+27
| | | | | | | | | | | | Unlike other sections that can grow to any size, the COFF section header stream has maximum length because each record is fixed size and the COFF file format limits the maximum number of sections. So I decided to not create a specific stream class for it. Instead, I added a member function to DbiStream class which returns a vector of COFF headers. Differential Revision: http://reviews.llvm.org/D20717 llvm-svn: 271557
* [pdb] Parse and dump section map and section contribsZachary Turner2016-06-023-10/+113
| | | | | | | Differential Revision: http://reviews.llvm.org/D20876 Reviewed By: rnk, ruiu llvm-svn: 271488
* [PDB] Make ModStream::symbols report errorsDavid Majnemer2016-06-011-1/+2
| | | | llvm-svn: 271417
* [pdb] Add unit tests for PDB MappedBlockStream and zero copyZachary Turner2016-05-315-1/+10
| | | | | | | Differential Revision: http://reviews.llvm.org/D20837 Reviewed By: ruiu llvm-svn: 271346
* Tighten some of the name map checks furtherDavid Majnemer2016-05-281-1/+5
| | | | llvm-svn: 271130
* Bounds check the number of bitmap blocks in the name mapDavid Majnemer2016-05-281-0/+10
| | | | llvm-svn: 271105
* Make sure the directory contains info for all streamsDavid Majnemer2016-05-281-3/+8
| | | | llvm-svn: 271103
* [pdb] Finish conversion to zero copy pdb access.Zachary Turner2016-05-285-38/+30
| | | | | | | | | | | | | | This converts remaining uses of ByteStream, which was still left in the symbol stream and type stream, to using the new StreamInterface zero-copy classes. RecordIterator is finally deleted, so this is the only way left now. Additionally, more error checking is added when iterating the various streams. With this, the transition to zero copy pdb access is complete. llvm-svn: 271101
* Don't discard errorsDavid Majnemer2016-05-271-2/+4
| | | | llvm-svn: 271056
* [pdb] Fix size check when reading stream bytes.Zachary Turner2016-05-271-2/+2
| | | | | | | We were accidentally bounds checking the read against the output ArrayRef instead of against the size of the read. llvm-svn: 271040
* Resubmit "[pdb] Allow zero-copy read support for symbol streams.""Zachary Turner2016-05-273-9/+16
| | | | | | | | | Due to differences in template instantiation rules, it is not portable to static_assert(false) inside of an invalid specialization of a template. Instead I just =delete the method so that it can't be used, and leave a comment that it must be explicitly specialized. llvm-svn: 271027
* Revert "[pdb] Allow zero-copy read support for symbol streams."Chad Rosier2016-05-273-16/+9
| | | | | | | | This reverts commit r271024 due to error: static_assert failed "You must either provide a specialization of VarStreamArrayExtractor or a custom extractor" llvm-svn: 271026
* [pdb] Allow zero-copy read support for symbol streams.Zachary Turner2016-05-273-9/+16
| | | | | | | | | | This reduces the amount of memory used by llvm-pdbdump by roughly 1/3 of the size of the PDB file. Differential Revision: http://reviews.llvm.org/D20724 Reviewed By: ruiu llvm-svn: 271025
* Make sure these error codes are marked as checkedDavid Majnemer2016-05-273-46/+65
| | | | llvm-svn: 271013
* Make sure there are enough blocks for the streamDavid Majnemer2016-05-271-0/+18
| | | | llvm-svn: 271012
* Make sure the directory block array fits in the fileDavid Majnemer2016-05-271-0/+4
| | | | llvm-svn: 271011
* Validate the blocksize before using itDavid Majnemer2016-05-271-5/+5
| | | | | | | The blocksize could be zero on disk causing later checks to divide by zero. llvm-svn: 271008
* [codeview] Remove StreamReader copying method.Zachary Turner2016-05-272-44/+15
| | | | | | | | | | | Since we want to move toward zero-copy access to stream data, we want to remove all instances of copying operations. So get rid of some of those here. Differential Revision: http://reviews.llvm.org/D20720 Reviewed By: ruiu llvm-svn: 270960
* [codeview,pdb] Try really hard to conserve memory when reading.Zachary Turner2016-05-2710-146/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | PDBs can be extremely large. We're already mapping the entire PDB into the process's address space, but to make matters worse the blocks of the PDB are not arranged contiguously. So, when we have something like an array or a string embedded into the stream, we have to make a copy. Since it's convenient to use traditional data structures to iterate and manipulate these records, we need the memory to be contiguous. As a result of this, we were using roughly twice as much memory as the file size of the PDB, because every stream was copied out and re-stitched together contiguously. This patch addresses this by improving the MappedBlockStream to allocate from a BumpPtrAllocator only when a read requires a discontiguous read. Furthermore, it introduces some data structures backed by a stream which can iterate over both fixed and variable length records of a PDB. Since everything is backed by a stream and not a buffer, we can read almost everything from the PDB with zero copies. Differential Revision: http://reviews.llvm.org/D20654 Reviewed By: ruiu llvm-svn: 270951
* [codeview] Move StreamInterface and StreamReader to libcodeview.Zachary Turner2016-05-2510-142/+19
| | | | | | | | | | We have need to reuse this functionality, including making additional generic stream types that are smarter about how and when they copy memory versus referencing the original memory. So all of these structures belong in the common library rather than being pdb specific. llvm-svn: 270751
* [llvm-pdbdump] Decipher the remaining PDB streams.Zachary Turner2016-05-251-0/+12
| | | | | | | We know at least know the meaning of every stream of the PDB file. Yay! llvm-svn: 270669
* [llvm-pdbdump] Dump the IPI stream and all records.Zachary Turner2016-05-252-3/+12
| | | | llvm-svn: 270661
* pdbdump: fix bug in name hash table.Rui Ueyama2016-05-251-3/+1
| | | | | | | | | | | name_ids() did not return all IDs but only the first NameCount items. The number of non-zero entries in IDs vector is NameCount, but it does not mean that all non-zero entries are at the beginning of IDs vector. Differential Revision: http://reviews.llvm.org/D20611 llvm-svn: 270656
* [llvm-pdbdump] Stream 0 isn't actually the MSF superblock.Zachary Turner2016-05-251-0/+1
| | | | | | | Oddly enough, I realized we don't actually know what stream 0 is (if anything). llvm-svn: 270655
* [llvm-pdbdump] Dump stream summary list.Zachary Turner2016-05-253-0/+18
| | | | | | | | | Try to figure out what each stream is, and dump its name. This gives us a better picture of what streams we still don't understand. llvm-svn: 270653
* [llvm-pdbdump] Rework command line options.Zachary Turner2016-05-242-3/+29
| | | | | | | | | When dumping huge PDB files, too many of the options were grouped together so you would get neverending spew of output. This patch introduces more granular display options so you can only dump the fields you actually care about. llvm-svn: 270607
* Add FIXMEs to all derived classes of std::error_category.Peter Collingbourne2016-05-241-0/+3
| | | | | | | | This helps make clear that we're moving away from std::error_code. Differential Revision: http://reviews.llvm.org/D20592 llvm-svn: 270604
* [codeview, pdb] Dump symbol records in publics streamZachary Turner2016-05-242-61/+22
| | | | | | | Differential Revision: http://reviews.llvm.org/D20580 Reviewed By: ruiu llvm-svn: 270597
* Make a symbol visitor and use it to dump CV symbols.Zachary Turner2016-05-231-1/+1
| | | | | | | Differential Revision: http://reviews.llvm.org/D20534 Reviewed By: rnk llvm-svn: 270511
* Fix struct member names and simplify. NFC.Rui Ueyama2016-05-201-6/+4
| | | | llvm-svn: 270289
* pdbdump: print out symbol names referred by publics stream.Rui Ueyama2016-05-203-9/+128
| | | | | | | | | | | | | | | | | | DBI stream contains a stream number of the symbol record stream. Symbol record streams is an array of length-type-value members. Each member represents one symbol. Publics stream contains offsets to the symbol record stream. This patch is to print out all symbols that are referenced by the publics stream. Note that even with this patch, llvm-pdbdump cannot dump all the information in a publics stream since it contains more information than symbol names. I'll improve it in followup patches. Differential Revision: http://reviews.llvm.org/D20480 llvm-svn: 270262
* Fix -Wmicrosoft-enum-value warningReid Kleckner2016-05-191-2/+2
| | | | llvm-svn: 270110
* pdbdump: Rename NumberOfSymbols -> SymbolRecordStreamIndex.Rui Ueyama2016-05-191-4/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D20441 llvm-svn: 270088
* pdbdump: Print out section offsets in the publics stream.Rui Ueyama2016-05-181-2/+6
| | | | llvm-svn: 269955
* Try again to fix pdbdump-headers.test on big-endian hosts after r269861.Daniel Sanders2016-05-181-5/+9
| | | | | | | r269898 fixed the problem with HashBuckets but the same issue occurred with AddressMap and ThunkMap too. llvm-svn: 269913
* Attempt to fix pdbdump-headers.test on big-endian hosts after r269861.Daniel Sanders2016-05-181-2/+6
| | | | llvm-svn: 269898
* pdbdump: Print out more strcutures.Rui Ueyama2016-05-171-3/+39
| | | | | | | | | | I don't yet fully understand the meaning of these data strcutures, but at least it seems that their sizes and types are correct. With this change, we can read publics streams till end. Differential Revision: http://reviews.llvm.org/D20343 llvm-svn: 269861
OpenPOWER on IntegriCloud