summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-pdbdump
Commit message (Collapse)AuthorAgeFilesLines
...
* pdbdump: Rename NumberOfSymbols -> SymbolRecordStreamIndex.Rui Ueyama2016-05-191-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D20441 llvm-svn: 270088
* pdbdump: Print out section offsets in the publics stream.Rui Ueyama2016-05-181-0/+1
| | | | llvm-svn: 269955
* pdbdump: Print out more strcutures.Rui Ueyama2016-05-171-0/+3
| | | | | | | | | | 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
* pdbdump: Print "Publics" stream.Rui Ueyama2016-05-132-2/+25
| | | | | | | | | | | | | | | | Publics stream seems to contain information as to public symbols. It actually contains a serialized hash table along with fixed-sized headers. This patch is not complete. It scans only till the end of the stream and dump the header information. I'll write code to de-serialize the hash table later. Reviewers: zturner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D20256 llvm-svn: 269484
* [codeview] Try to handle errors better in record iteratorReid Kleckner2016-05-121-1/+6
| | | | llvm-svn: 269381
* Fix build error with ambiguity of size_t.Zachary Turner2016-05-091-1/+1
| | | | llvm-svn: 268948
* [pdb] Parse the module info stream for each module.Zachary Turner2016-05-091-11/+31
| | | | | | | Differential Revision: http://reviews.llvm.org/D20026 Reviewed By: rnk llvm-svn: 268942
* Make TypeIterator generic so it can iterate symbols too.Zachary Turner2016-05-091-1/+1
| | | | | | | Reviewed By: amccarth Differential Revision: http://reviews.llvm.org/D20038 llvm-svn: 268941
* Make llvm-pdbdump print CV type recordsZachary Turner2016-05-062-10/+17
| | | | | | | | | | This reuses the CVTypeDumper from libcodeview to dump full information about type records within a PDB file. Differential Revision: http://reviews.llvm.org/D20022 Reviewed By: rnk llvm-svn: 268808
* Port DebugInfoPDB over to using llvm::Error.Zachary Turner2016-05-061-65/+75
| | | | | | | Differential Revision: http://reviews.llvm.org/D19940 Reviewed By: rnk llvm-svn: 268791
* Move pdb code into pdb namespace.Zachary Turner2016-05-0420-8/+37
| | | | llvm-svn: 268544
* Reland "Use ScopedPrinter in llvm-pdbdump"Reid Kleckner2016-05-041-139/+169
| | | | | | | This reverts r268508 and reinstates r268506 with an additional cast from TypeLeafKind to unsigned to allow conversion to HexNumber. llvm-svn: 268517
* Revert "Use ScopedPrinter in llvm-pdbdump"Chad Rosier2016-05-041-169/+139
| | | | | | This reverts commit r268506 due to build breakage. llvm-svn: 268508
* Use ScopedPrinter in llvm-pdbdumpZachary Turner2016-05-041-139/+169
| | | | | | | | | | | | | | | | When printing raw PDB file fields, streams, and records, use the ScopedPrinter class so we have consistency with llvm-readobj's output format. For the most part this is pretty mechanical, but I had to fix up the test file to conform to the new YAMLesque output format. i added a few additional helper functions to the ScopedPrinter such as one to print a dotted version, etc. Differential Revision: http://reviews.llvm.org/D19897 Reviewed By: rnk llvm-svn: 268506
* llvm-pdbdump: Update libdeps.NAKAMURA Takumi2016-05-031-1/+2
| | | | llvm-svn: 268464
* Fix template type deduction error on some compilers.Zachary Turner2016-05-031-1/+1
| | | | llvm-svn: 268458
* Move CodeViewTypeStream to DebugInfo/CodeViewZachary Turner2016-05-031-16/+13
| | | | | | | | | | | | | Ability to parse codeview type streams is also needed by DebugInfoPDB for parsing PDBs, so moving this into a library gives us this option. Since DebugInfoPDB had already hand rolled some code to do this, that code is now convereted over to using this common abstraction. Differential Revision: http://reviews.llvm.org/D19887 Reviewed By: dblaikie, amccarth llvm-svn: 268454
* Parse the TPI (type information) stream of PDB files.Zachary Turner2016-05-031-0/+34
| | | | | | | | | | | | | | | This parses the TPI stream (stream 2) from the PDB file. This stream contains some header information followed by a series of codeview records. There is some additional complexity here in that alongside this stream of codeview records is a serialized hash table in order to efficiently query the types. We parse the necessary bookkeeping information to allow us to reconstruct the hash table, but we do not actually construct it yet as there are still a few things that need to be understood first. Differential Revision: http://reviews.llvm.org/D19840 Reviewed By: ruiu, rnk llvm-svn: 268343
* Parse PDB Name Hash TableZachary Turner2016-05-021-25/+9
| | | | | | | | | | | | | PDB has a lot of similar data structures. We already have code for parsing a Name Map, but PDB seems to have a different but very similar structure that is a hash table. This is the beginning of code needed in order to parse the name hash table, but it is not yet complete. It parses the basic metadata of the hash table, the bucket array, and the names buffer, but doesn't use any of these fields yet as the data structure requires a non-trivial amount of work to understand. llvm-svn: 268268
* Put PDB parsing code into a pdb namespace.Zachary Turner2016-04-291-22/+22
| | | | llvm-svn: 268072
* Refactor the PDB Stream reading interface.Zachary Turner2016-04-291-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | The motivation for this change is that PDB has the notion of streams and substreams. Substreams often consist of variable length structures that are convenient to be able to treat as guaranteed, contiguous byte arrays, whereas the streams they are contained in are not necessarily so, as a single stream could be spread across many discontiguous blocks. So, when processing data from a substream, we want to be able to assume that we have a contiguous byte array so that we can cast pointers to variable length arrays and such. This leads to the question of how to be able to read the same data structure from either a stream or a substream using the same interface, which is where this patch comes in. We separate out the stream's read state from the underlying representation, and introduce a `StreamReader` class. Then we change the name of `PDBStream` to `MappedBlockStream`, and introduce a second kind of stream called a `ByteStream` which is simply a sequence of contiguous bytes. Finally, we update all of the std::vectors in `PDBDbiStream` to use `ByteStream` instead as a proof of concept. llvm-svn: 268071
* [llvm-pdbdump] Restore error messages, handle bad block sizesDavid Majnemer2016-04-281-14/+23
| | | | | | | We lost the ability to report errors, bring it back. Also, correctly validate the block size. llvm-svn: 267955
* Read the rest of the DBI substreams, and parse source info.Zachary Turner2016-04-281-15/+20
| | | | | | | | | | | | | We now read out the rest of the substreams from the DBI streams. One of these substreams, the FileInfo substream, contains information about which source files contribute to each module (aka compiland). This patch additionally parses out the file information from that substream, and dumps it in llvm-pdbdump. Differential Revision: http://reviews.llvm.org/D19634 Reviewed by: ruiu llvm-svn: 267928
* Parse module information from DBI stream.Zachary Turner2016-04-271-0/+23
| | | | | | | | | | | | This gets more data out of the DBI strema of the PDB. In particular it extracts the metadata for the list of modules (compilands) that this PDB contains info about, and adds support for dumping these fields to llvm-pdbdump. Differential Revision: http://reviews.llvm.org/D19570 Reviewed By: ruiu llvm-svn: 267818
* Parse and dump PDB DBI Stream Header InformationZachary Turner2016-04-261-4/+18
| | | | | | | | | | | | | | | | | | The DBI stream contains a lot of bookkeeping information for other streams. In particular it contains information about section contributions and linked modules. This patch is a first attempt at parsing some of the information out of the DBI stream. It currently only parses and dumps the headers of the DBI stream, so none of the module data or section contribution data is pulled out. This is just a proof of concept that we understand the basic properties of the DBI stream's metadata, and followup patches will try to extract more detailed information out. Differential Revision: http://reviews.llvm.org/D19500 Reviewed By: majnemer, ruiu llvm-svn: 267585
* Refactor some more PDB reading code into DebugInfoPDB.Zachary Turner2016-04-261-126/+13
| | | | | | | Differential Revision: http://reviews.llvm.org/D19445 Reviewed By: David Majnemer llvm-svn: 267564
* Resubmit "Refactor raw pdb dumper into library"Zachary Turner2016-04-252-312/+85
| | | | | | | This fixes a number of endianness issues as well as an ODR violation that hopefully causes everything to be happy. llvm-svn: 267431
* Revert r267049, r26706[16789], r267071 - Refactor raw pdb dumper into libraryDaniel Sanders2016-04-222-85/+312
| | | | | | r267049 broke multiple buildbots (e.g. clang-cmake-mips, and clang-x86_64-linux-selfhost-modules) which the follow-ups have not yet resolved and this is preventing subsequent committers from being notified about additional failures on the affected buildbots. llvm-svn: 267148
* Fix PDB warnings and testReid Kleckner2016-04-211-1/+1
| | | | llvm-svn: 267071
* Refactor raw pdb dumper into libraryZachary Turner2016-04-212-312/+85
| | | | | | | | | | | | | | | | | | PDB parsing code was hand-rolled into llvm-pdbdump. This patch moves the parsing of this code into DebugInfoPDB and makes the dumper use this. This is achieved by implementing the skeleton of RawPdbSession, the non-DIA counterpart to the existing PDB read interface. None of the type / source file / etc information is accessible yet, so this implementation is not yet close to achieving parity with the DIA counterpart, but the RawSession class simply holds a reference to a PDBFile class which handles parsing the file format. Additionally a PDBStream class is introduced which allows accessing the bytes of a particular stream in a PDB file. Differential Revision: http://reviews.llvm.org/D19343 Reviewed By: majnemer llvm-svn: 267049
* [llvm-pdbdump] Print a better error message when PDB loading fails.Zachary Turner2016-04-191-2/+8
| | | | | | Differential Revision: http://reviews.llvm.org/D19234 llvm-svn: 266772
* [NFC] Header cleanupMehdi Amini2016-04-182-2/+1
| | | | | | | | | | | | | | Removed some unused headers, replaced some headers with forward class declarations. Found using simple scripts like this one: clear && ack --cpp -l '#include "llvm/ADT/IndexedMap.h"' | xargs grep -L 'IndexedMap[<]' | xargs grep -n --color=auto 'IndexedMap' Patch by Eugene Kosov <claprix@yandex.ru> Differential Revision: http://reviews.llvm.org/D19219 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266595
* Fix some display bugs in llvm-pdbdump.Zachary Turner2016-04-112-5/+23
| | | | | | | | | | | | | | | | | | We were incorrectly reporting all non-64 bit integers as int64s. This is most evident when trying to print the "short" type, but in theory could happen with chars too (although usually chars use a different builtin type). Additionally, we were using the wrong check when deciding whether to print an enum definition as a global enum. We were checking whether or not the enum was "nested", and if so saving it until we print the class definition that it was nested in. But this is not correct in rare situations where the enum is nested, but the class that it's nested in does not have type information in the PDB. So instead we check if there is a class definition for the parent in the PDB. If so we save it for later, otherwise we print it. llvm-svn: 265993
* [llvm-pdbdump] Dump line table information.Zachary Turner2016-03-083-12/+80
| | | | | | | This patch adds the -lines command line option which will dump source/line information for each compiland and source file. llvm-svn: 262962
* [llvm-pdbdump] Start to decode some streamsDavid Majnemer2016-02-121-29/+253
| | | | | | We can decode a little bit of the first stream now. llvm-svn: 260754
* Remove autoconf supportChris Bieneman2016-01-261-17/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened." - Obi Wan Kenobi Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16471 llvm-svn: 258861
* Update to use new name alignTo().Rui Ueyama2016-01-141-1/+1
| | | | llvm-svn: 257804
* [readobj] Expand CodeView dumping functionalityReid Kleckner2016-01-131-6/+7
| | | | | | | | | | | | | | | | This rewrites and expands the existing codeview dumping functionality in llvm-readobj using techniques similar to those in lib/Object. This defines a number of new records and enums useful for reading memory mapped codeview sections in COFF objects. The dumper is intended as a testing tool for LLVM as it grows more codeview output capabilities. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D16104 llvm-svn: 257658
* Introduce a range version of std::any_of, and use it in SCEVSanjoy Das2015-12-011-6/+3
| | | | | | | | | | Reviewers: dblaikie, pcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15063 llvm-svn: 254390
* llmv-pdbdump: Make BuiltinDumper shorter. NFC.Rui Ueyama2015-11-032-41/+27
| | | | llvm-svn: 251974
* llvm-pdbdump: Simplify. NFC.Rui Ueyama2015-11-032-29/+14
| | | | llvm-svn: 251873
* Make windows.h less evil.Benjamin Kramer2015-10-151-0/+3
| | | | llvm-svn: 250386
* [llvm-pdbdump] Remove oddly placed parens that MSVC doesn't likeBenjamin Kramer2015-10-151-1/+1
| | | | llvm-svn: 250385
* Speculatively unbreak Windows buildDavid Majnemer2015-10-151-2/+2
| | | | | | | | <windows.h> defines macros named min and max in conflict with <algorithm>. Prevent macro expansion by wrapping std::min in parenthesis. llvm-svn: 250383
* [llvm-pdbdump] Provide a mechanism to dump the raw contents of a PDBDavid Majnemer2015-10-151-7/+275
| | | | | | | | | A PDB can be thought of as a very simple file system. It is occasionally illuminating to see the contents of the underlying files. Differential Revision: http://reviews.llvm.org/D13674 llvm-svn: 250356
* [llvm-pdbdump] Add include-only filters.Zachary Turner2015-09-294-30/+64
| | | | | | | | | | | | | | | | PDB files have a lot of noise in them, with hundreds (or thousands) of symbols from system libraries and compiler generated types. If you're only looking for a specific type, this can be problematic. This CL allows you to display *only* types, variables, or compilands matching a particular pattern. These filters can even be combined with exclude filters. Include-only filters are given priority, so that first the set of items to display is limited only to those that match the include filters, and then the set of exclude filters is applied to those. If there are no include filters specified, then it means "display everything". llvm-svn: 248822
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-291-1/+1
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238602
* [llvm-pdbdump] Support dynamic load address and external symbols.Zachary Turner2015-05-017-12/+104
| | | | | | | | | | | This patch adds the --load-address command line option to llvm-pdbdump, which dumps all addresses assuming the module has loaded at the specified address. Additionally, this patch adds an option to llvm-pdbdump to support dumping of public symbols (i.e. symbols with external linkage). llvm-svn: 236342
* [PDB] Support executables and source/line info.Zachary Turner2015-04-171-1/+1
| | | | | | | | | | | | Previously DebugInfoPDB could only load data for a PDB given a path to the PDB. It could not open an EXE and find the matching PDB and verify it matched, etc. This patch adds support for that so that we can simply load debug information for a PDB directly. Additionally, this patch extends DebugInfoPDB to support getting source and line information for symbols. llvm-svn: 235237
* [llvm-pdbdump] Display full enum definitions.Zachary Turner2015-03-049-26/+123
| | | | | | | | | | | This will now display enum definitions both at the global scope as well as nested inside of classes. Additionally, it will no longer display enums at the global scope if the enum is nested. Instead, it will omit the definition of the enum globally and instead emit it in the corresponding class definition. llvm-svn: 231215
OpenPOWER on IntegriCloud