summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-pdbdump
Commit message (Collapse)AuthorAgeFilesLines
...
* [pdb] Don't error on missing FPO streamsReid Kleckner2016-06-171-35/+48
| | | | | | | | 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
* Resubmit "[pdb] Change type visitor pattern to be dynamic."Zachary Turner2016-06-161-4/+8
| | | | | | | 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-161-8/+4
| | | | | | | | This reverts commit fb0dd311e1ad945827b8ffd5354f4810e2be1579. This breaks some llvm-readobj tests. llvm-svn: 272927
* [pdb] Change type visitor pattern to be dynamic.Zachary Turner2016-06-161-4/+8
| | | | | | | | | | | | | | | 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
* Resubmit "[pdb] Actually write a PDB to disk from YAML.""Zachary Turner2016-06-144-66/+126
| | | | | | | 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-144-126/+66
| | | | | | | | | 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-144-66/+126
| | | | llvm-svn: 272692
* Make PDBFile take a StreamInterface instead of a MemBuffer.Zachary Turner2016-06-101-1/+19
| | | | | | | | | | | | | | | 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
* Search for llvm-symbolizer binary in the same directory as argv[0], beforeRichard Smith2016-06-091-1/+1
| | | | | | | looking for it along $PATH. This allows installs of LLVM tools outside of $PATH to find the symbolizer and produce pretty backtraces if they crash. llvm-svn: 272232
* [pdbdump-fuzzer] Try to fix build errors in fuzzer.Zachary Turner2016-06-091-1/+9
| | | | llvm-svn: 272230
* [pdb] Handle stream index errors better.Zachary Turner2016-06-081-130/+133
| | | | | | | Reviewed By: ruiu Differential Revision: http://reviews.llvm.org/D21128 llvm-svn: 272172
* [pdb] Try to fix use after free.Zachary Turner2016-06-082-2/+8
| | | | 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
* [pdbdump] Print out TPI hash key size.Rui Ueyama2016-06-071-0/+1
| | | | llvm-svn: 272073
* [pdb] Use MappedBlockStream to parse the PDB directory.Zachary Turner2016-06-071-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [pdbdump] Print section header flags.Rui Ueyama2016-06-061-1/+2
| | | | llvm-svn: 271943
* [llvm-pdbdump] Dump stream sizes and stream blocks to yaml.Zachary Turner2016-06-063-4/+51
| | | | llvm-svn: 271940
* [llvm-pdbdump] Dump MSF headers to YAML.Zachary Turner2016-06-069-0/+280
| | | | | | | | | | | This is the simplest possible patch to get some kind of YAML output. All it dumps is the MSF header fields so that in theory an empty MSF file could be reconstructed. Reviewed By: ruiu, majnemer Differential Revision: http://reviews.llvm.org/D20971 llvm-svn: 271939
* [pdbdump] Print out New FPO stream contents.Rui Ueyama2016-06-065-0/+36
| | | | | | | | | | 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
* pdbdump: print out TPI hashes.Rui Ueyama2016-06-033-1/+27
| | | | | | Differential Revision: http://reviews.llvm.org/D20945 llvm-svn: 271736
* [llvm-pdbdump] Introduce an abstraction for the output style.Zachary Turner2016-06-036-653/+788
| | | | | | | | | | | This opens the door to introducing a YAML outputter which can be used for machine consumption. Currently the yaml output style is unimplemented and returns an error if you try to use it. Reviewed By: rnk, ruiu Differential Revision: http://reviews.llvm.org/D20967 llvm-svn: 271712
* [pdb] Print out file names instead of file offsets.Zachary Turner2016-06-031-17/+37
| | | | | | | | | | | | 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
* [pdb] Dump file checksums from pdb codeview line info.Zachary Turner2016-06-031-5/+13
| | | | llvm-svn: 271622
* [codeview] Dump line number and column information.Zachary Turner2016-06-031-12/+64
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix indentation.Rui Ueyama2016-06-031-6/+6
| | | | llvm-svn: 271620
* [llvm-pdbdump] Dump CodeView line information.Zachary Turner2016-06-021-16/+42
| | | | | | | | | 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-0/+39
| | | | | | | | | | | | 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-021-13/+95
| | | | | | | Differential Revision: http://reviews.llvm.org/D20876 Reviewed By: rnk, ruiu llvm-svn: 271488
* llvm-pdbdump-fuzzer: fix the buildKostya Serebryany2016-05-311-8/+9
| | | | llvm-svn: 271352
* Speculative build fix for codeview type dumper API changeReid Kleckner2016-05-311-1/+1
| | | | llvm-svn: 271344
* [codeview] Improve readability of type record assemblyReid Kleckner2016-05-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the method MCStreamer::EmitBinaryData, which is usually an alias for EmitBytes. In the MCAsmStreamer case, it is overridden to emit hex dump output like this: .byte 0x0e, 0x00, 0x08, 0x10 .byte 0x03, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x10, 0x00, 0x00 Also, when verbose asm comments are enabled, this patch prints the dump output for each comment before its record, like this: # ArgList (0x1000) { # TypeLeafKind: LF_ARGLIST (0x1201) # NumArgs: 0 # Arguments [ # ] # } .byte 0x06, 0x00, 0x01, 0x12 .byte 0x00, 0x00, 0x00, 0x00 This should make debugging easier and testing more convenient. Reviewers: aaboud Subscribers: majnemer, zturner, amccarth, aaboud, llvm-commits Differential Revision: http://reviews.llvm.org/D20711 llvm-svn: 271313
* [llvm-pdbdump-fuzzer] Add a fuzzer for llvm-pdbdumpDavid Majnemer2016-05-313-0/+96
| | | | llvm-svn: 271243
* llvm-pdbdump should have a non-zero exit code on errorDavid Majnemer2016-05-281-19/+10
| | | | llvm-svn: 271132
* [pdb] Finish conversion to zero copy pdb access.Zachary Turner2016-05-281-4/+14
| | | | | | | | | | | | | | 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
* [codeview] Remove StreamReader copying method.Zachary Turner2016-05-271-1/+7
| | | | | | | | | | | 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-271-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* pdbdump: print out the name of the stream 0.Rui Ueyama2016-05-271-1/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D20712 llvm-svn: 270943
* pdbdump: Add -raw-all to enable all -raw-* flags.Rui Ueyama2016-05-261-0/+16
| | | | | | Differential Revision: http://reviews.llvm.org/D20707 llvm-svn: 270937
* Fix typo.Rui Ueyama2016-05-261-15/+15
| | | | llvm-svn: 270934
* [codeview] Move StreamInterface and StreamReader to libcodeview.Zachary Turner2016-05-251-3/+3
| | | | | | | | | | 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] Dump raw stream contents as binary block.Zachary Turner2016-05-251-2/+3
| | | | | | Dumping it as ASCII makes it fairly useless. llvm-svn: 270742
* [llvm-pdbdump] Decipher the remaining PDB streams.Zachary Turner2016-05-251-0/+22
| | | | | | | 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-251-20/+60
| | | | llvm-svn: 270661
* [llvm-pdbdump] Stream 0 isn't actually the MSF superblock.Zachary Turner2016-05-251-4/+9
| | | | | | | 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-251-13/+78
| | | | | | | | | 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
* [codeview] Add support for new type records.Zachary Turner2016-05-241-2/+2
| | | | | | | | | | | | | | | | | | | This adds support for parsing and dumping the following symbol types: S_LPROCREF S_ENVBLOCK S_COMPILE2 S_REGISTER S_COFFGROUP S_SECTION S_THUNK32 S_TRAMPOLINE As of this patch, the test PDB files no longer have any unknown symbol types. llvm-svn: 270628
* [llvm-pdbdump] Rework command line options.Zachary Turner2016-05-241-71/+110
| | | | | | | | | 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
* [codeview, pdb] Dump symbol records in publics streamZachary Turner2016-05-241-3/+12
| | | | | | | Differential Revision: http://reviews.llvm.org/D20580 Reviewed By: ruiu llvm-svn: 270597
* Dump symbol record details in llvm-pdbdumpZachary Turner2016-05-241-20/+48
| | | | | | | | | | | | | This makes use of the newly introduced `CVSymbolVisitor` to dump details of each type of symbol record in the symbol streams. Future patches will bring this visitor based dumping to the publics stream, as well as creating a `SymbolDumpDelegate` to print more information about relocations etc. Differential Revision: http://reviews.llvm.org/D20545 Reviewed By: ruiu llvm-svn: 270585
* pdbdump: print out symbol names referred by publics stream.Rui Ueyama2016-05-201-0/+1
| | | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud