summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* Change llvm-objdump, llvm-nm and llvm-size when reporting an object file errorKevin Enderby2016-05-311-2/+3
| | | | | | | | | | | | | | | | | | | when the object is from a slice of a Mach-O Universal Binary use something like "foo.o (for architecture i386)" as part of the error message when expected. Also fixed places in these tools that were ignoring object file errors from MachOUniversalBinary::getAsObjectFile() when the code moved on to see if the slice was an archive. To do this MachOUniversalBinary::getAsObjectFile() and MachOUniversalBinary::getObjectForArch() were changed from returning ErrorOr<...> to Expected<...> then that was threaded up to its users. Converting these interfaces to Expected<> from ErrorOr<> does involve touching a number of places. To contain the changes for now the use of errorToErrorCode() is still used in two places yet to be fully converted. llvm-svn: 271332
* [codeview] Improve readability of type record assemblyReid Kleckner2016-05-311-8/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [codeview] Add a CVTypeDumper::dump(ArrayRef<uint8_t>) overloadReid Kleckner2016-05-311-0/+13
| | | | | | | This is a convenient wrapper when the type record is already laid out as bytes in memory. llvm-svn: 271309
* Make sure we don't add an empty string to the stringmapDavid Majnemer2016-05-291-1/+2
| | | | llvm-svn: 271172
* [SymbolDumper] Validate the string table offset before using itDavid Majnemer2016-05-281-6/+6
| | | | llvm-svn: 271145
* [SymbolDumper] Validate the string table offset before using itDavid Majnemer2016-05-281-5/+6
| | | | llvm-svn: 271142
* 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-2810-89/+45
| | | | | | | | | | | | | | 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
* Make sure data is available before dereferencing itDavid Majnemer2016-05-271-0/+14
| | | | llvm-svn: 271032
* Resubmit "[pdb] Allow zero-copy read support for symbol streams.""Zachary Turner2016-05-275-11/+18
| | | | | | | | | 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-275-18/+11
| | | | | | | | 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-275-11/+18
| | | | | | | | | | 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
* Apply clang-tidy's misc-move-constructor-init throughout LLVM.Benjamin Kramer2016-05-271-4/+4
| | | | | | No functionality change intended, maybe a tiny performance improvement. llvm-svn: 270997
* [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-2713-175/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2513-31/+97
| | | | | | | | | | 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
* [codeview] Add support for new types and symbols.Zachary Turner2016-05-252-0/+19
| | | | | | | | | | | | This patch adds support for: S_EXPORT LF_BITFIELD With this patch, I have run through a couple of gigabytes of PDB files and cannot find a type or symbol that we do not understand. llvm-svn: 270637
* [codeview] Add support for S_EXPORT symbol.Zachary Turner2016-05-251-0/+16
| | | | llvm-svn: 270636
* [codeview] Add support for new type records.Zachary Turner2016-05-243-64/+246
| | | | | | | | | | | | | | | | | | | 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-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-243-0/+9
| | | | | | | | 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-243-61/+39
| | | | | | | Differential Revision: http://reviews.llvm.org/D20580 Reviewed By: ruiu llvm-svn: 270597
* Fix build errorsZachary Turner2016-05-241-2/+2
| | | | llvm-svn: 270587
* Dump symbol record details in llvm-pdbdumpZachary Turner2016-05-242-8/+15
| | | | | | | | | | | | | 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
* Recommit r270547 ([llvm-dwarfdump] - Teach dwarfdump to decompress debug ↵George Rimar2016-05-241-15/+53
| | | | | | | | | | | | | | | | | | | | | | | sections in zlib style.) Fix was: 1) Had to regenerate dwarfdump-test-zlib.elf-x86-64, dwarfdump-test-zlib-gnu.elf-x86-64 (because llvm-symbolizer-zlib.test uses that inputs for its purposes and failed). 2) Updated llvm-symbolizer-zlib.test (updated used call function address to match new files + added one more check for newly created dwarfdump-test-zlib-gnu.elf-x86-64 binary input). 3) Updated comment in dwarfdump-test-zlib.cc. Original commit message: [llvm-dwarfdump] - Teach dwarfdump to decompress debug sections in zlib style. Before this llvm-dwarfdump only recognized zlib-gnu compression style of headers, this patch adds support for zlib style. It looks reasonable to support both styles for dumping, even if we are not going to suport generating of deprecated gnu one. Differential revision: http://reviews.llvm.org/D20470 llvm-svn: 270557
* Revert r270543 ("Recommit r270540")George Rimar2016-05-241-53/+15
| | | | | | | | Failed build bot in another test. I am sorry for noise. http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/23679/testReport/junit/LLVM/DebugInfo/llvm_symbolizer_zlib_test/ llvm-svn: 270547
* Recommit r270540George Rimar2016-05-241-15/+53
| | | | | | | | | | | | | | | | fix: forgot to commit the updated dwarfdump-test-zlib.elf-x86-64 Original commit message: [llvm-dwarfdump] - Teach dwarfdump to decompress debug sections in zlib style. Before this llvm-dwarfdump only recognized zlib-gnu compression style of headers, this patch adds support for zlib style. It looks reasonable to support both styles for dumping, even if we are not going to suport generating of deprecated gnu one. Differential revision: http://reviews.llvm.org/D20470 llvm-svn: 270543
* Revert r270540 "[llvm-dwarfdump] - Teach dwarfdump to decompress debug ↵George Rimar2016-05-241-53/+15
| | | | | | | | | sections in zlib style." it broked bot: http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/5036 llvm-svn: 270541
* [llvm-dwarfdump] - Teach dwarfdump to decompress debug sections in zlib style.George Rimar2016-05-241-15/+53
| | | | | | | | | | | Before this llvm-dwarfdump only recognized zlib-gnu compression style of headers, this patch adds support for zlib style. It looks reasonable to support both styles for dumping, even if we are not going to suport generating of deprecated gnu one. Differential revision: http://reviews.llvm.org/D20470 llvm-svn: 270540
* Remove unused variable.Zachary Turner2016-05-241-11/+6
| | | | llvm-svn: 270516
* Make a symbol visitor and use it to dump CV symbols.Zachary Turner2016-05-233-1/+672
| | | | | | | 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-204-9/+129
| | | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud