summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-pdbdump/llvm-pdbdump.h
Commit message (Collapse)AuthorAgeFilesLines
* Rename llvm-pdbdump -> llvm-pdbutil.Zachary Turner2017-06-091-156/+0
| | | | | | | | | | This is to reflect the evolving nature of the tool as being useful for more than just dumping PDBs, as it can do many other things. Differential Revision: https://reviews.llvm.org/D34062 llvm-svn: 305106
* [CodeView] Support remaining debug subsection typesZachary Turner2017-06-091-0/+3
| | | | | | | | | | | | | | | | This adds support for Symbols, StringTable, and FrameData subsection types. Even though these subsections rarely if ever appear in a PDB file (they are usually in object files), there's no theoretical reason why they *couldn't* appear in a PDB. The real issue though is that in order to add support for dumping and writing them (which will be useful for object files), we need a way to test them. And since there is no support for reading and writing them to / from object files yet, making PDB support them is the best way to both add support for the underlying format and add support for tests at the same time. Later, when we go to add support for reading / writing them from object files, we'll need only minimal changes in the underlying read/write code. llvm-svn: 305037
* [llvm-pdbdump] Improve consistency among subcommands.Zachary Turner2017-06-081-9/+26
| | | | | | | | | | | | | | | The pdb2yaml and raw subcommands did something very similar but with a different output format, and they used a lot of the same command line options, but each one re-implemented the command line option with slightly different spellings / options. This patch merges them together into a single definition which is shared by both subcommands. This new syntax also allows for more flexibility in the way debug subsections are dumped. Differential Revision: https://reviews.llvm.org/D33996 llvm-svn: 305032
* [llvm-pdbdump] pdb2yaml: add an -all option to dump everything we canBob Haarman2017-05-261-0/+1
| | | | | | | | | | | | Reviewers: amccarth, rnk, zturner Reviewed By: zturner Subscribers: fhahn, llvm-commits Differential Revision: https://reviews.llvm.org/D33613 llvm-svn: 304047
* [llvm-pdbdump] Add the option to sort functions and data.Zachary Turner2017-05-141-0/+23
| | | | llvm-svn: 302998
* [llvm-pdbdump] Allow printing only a portion of a stream.Zachary Turner2017-04-281-1/+1
| | | | | | | | | | | | When dumping raw data from a stream, you might know the offset of a certain record you're interested in, as well as how long that record is. Previously, you had to dump the entire stream and wade through the bytes to find the interesting record. This patch allows you to specify an offset and length on the command line, and it will only dump the requested range. llvm-svn: 301607
* [llvm-pdbdump] Allow sorting / filtering by immediate paddingZachary Turner2017-04-251-1/+10
| | | | llvm-svn: 301358
* [llvm-pdbdump] Dump File / Line Info to YAML.Zachary Turner2017-04-251-0/+2
| | | | | | | | | We were already parsing and dumping this to the human readable format, but not to the YAML format. This does so, in preparation for reading it in and reconstructing the line information from YAML. llvm-svn: 301357
* [llvm-pdbdump] Merge functionality of graphical and text dumpers.Zachary Turner2017-04-241-1/+2
| | | | | | | | | | | | | | The *real* difference between these two was that a) The "graphical" dumper could recurse, while the text one could not. b) The "text" dumper could display nested types and functions, while the graphical one could not. Merge these two so that there is only one dumper that can recurse arbitrarily deep and optionally display nested types or not. llvm-svn: 301204
* [llvm-pdbdump] Re-write the record layout code to be more resilient.Zachary Turner2017-04-241-1/+1
| | | | | | | | This reworks the way virtual bases are handled, and also the way padding is detected across multiple levels of aggregates, producing a much more accurate result. llvm-svn: 301203
* [llvm-pdbdump] Recursively dump class layout.Zachary Turner2017-04-131-1/+4
| | | | llvm-svn: 300258
* [llvm-pdbdump] Minor prepatory refactor of Class Def Dumper.Zachary Turner2017-04-121-1/+1
| | | | | | | | | | | | | | | | | In a followup patch I intend to introduce an additional dumping mode which dumps a graphical representation of a class's layout. In preparation for this, the text-based layout printer needs to be split out from the graphical layout printer, and both need to be able to use the same code for printing the intro and outro of a class's definition (e.g. base class list, etc). This patch does so, and in the process introduces a skeleton definition for the graphical printer, while currently making the graphical printer just print nothing. NFC llvm-svn: 300134
* [llvm-pdbdump] More advanced class definition dumping.Zachary Turner2017-04-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Previously the dumping of class definitions was very primitive, and it made it hard to do more than the most trivial of output formats when dumping. As such, we would only dump one line for each field, and then dump non-layout items like nested types and enums. With this patch, we do a complete analysis of the object hierarchy including aggregate types, bases, virtual bases, vftable analysis, etc. The only immediately visible effects of this are that a) we can now dump a line for the vfptr where before we would treat that as padding, and b) we now don't treat virtual bases that come at the end of a class as padding since we have a more detailed analysis of the class's storage usage. In subsequent patches, we should be able to use this analysis to display a complete graphical view of a class's layout including recursing arbitrarily deep into an object's base class / aggregate member hierarchy. llvm-svn: 300133
* [llvm-pdbdump] Display padding bytes on record layoutZachary Turner2017-04-101-2/+4
| | | | | | | | | | | | | | | When dumping classes, show where padding occurs, and at the end of the class print statistics about how many bytes total of padding exist in a class. Since PDB doesn't specifically contain information about padding, we have to mimic this by sort of reversing a small portion of the record layout algorithm (e.g. looking at offsets and sizes and trying to determine whether something is part of the same field or a new field). Differential Revision: https://reviews.llvm.org/D31800 llvm-svn: 299869
* Allow specification of what kinds of class members to dump.Zachary Turner2017-04-061-1/+3
| | | | | | | | | | | | | | Previously when dumping class definitions, there were only two modes - on or off. But it's useful to sometimes get a little more fine-grained. For example, you might only want to see the record layout (for example to look for extraneous padding). This patch adds a third mode, layout mode, which does exactly that. Only this-relative data members are displayed in this mode. Differential Revision: https://reviews.llvm.org/D31794 llvm-svn: 299733
* [llvm-pdbdump] Allow pretty to only dump specific types of types.Zachary Turner2017-04-061-1/+3
| | | | | | | | | | | | | Previously we just had the -types option, which would dump all classes, typedefs, and enums. But this produces a lot of output if you only want to view classes, for example. This patch breaks this down into 3 additional options, -classes, -enums, and -typedefs, and keeps the -types option around which implies all 3 more specific options. Differential Revision: https://reviews.llvm.org/D31791 llvm-svn: 299732
* [pdb] Write the module info and symbol record streams.Zachary Turner2017-03-151-0/+1
| | | | | | | | | | | Previously we did not have support for writing detailed module information for each module, as well as the symbol records. This patch adds support for this, and in doing so enables the ability to construct minimal PDBs from just a few lines of YAML. A test is added to illustrate this functionality. llvm-svn: 297900
* Add the beginning of PDB diffing support.Zachary Turner2017-03-131-0/+4
| | | | | | | | | | For now this only diffs the stream directory and the MSF Superblock. Future patches will drill down into individual streams to find out where the differences lie. Differential Revision: https://reviews.llvm.org/D30908 llvm-svn: 297689
* [pdb] Write the Named Stream mapping to Yaml and binary.Zachary Turner2017-01-201-0/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D28919 llvm-svn: 292665
* [llvm-pdbdump] Add a compact dump mode.Zachary Turner2017-01-121-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D28545 llvm-svn: 291849
* [pdb] added support for dumping globals streamBob Haarman2016-10-211-0/+1
| | | | | | | | | | | | Summary: This adds support for dumping the globals stream from PDB files using llvm-pdbdump, similar to the support we have for the publics stream. Reviewers: ruiu, zturner Subscribers: beanz, mgorny, modocache Differential Revision: https://reviews.llvm.org/D25801 llvm-svn: 284861
* [pdb] Dump Module Symbols to Yaml.Zachary Turner2016-10-081-0/+1
| | | | | | | | | | | | | | This is the first step towards round-tripping symbol information, and thusly being able to write symbol information to a PDB. This patch writes the symbol information for each compiland to the Yaml when running in pdb2yaml mode. There's still some loose ends, such as what to do about relocations (necessary in order to print linkage names), how to print enums with friendly names, and how to give the dumper access to the StringTable, but this is a good first start. llvm-svn: 283641
* [pdb] Write the IPI stream.Zachary Turner2016-09-151-0/+1
| | | | | | | | The IPI stream is structurally identical to the TPI stream, but it contains different record types. So we just re-use the TPI writing code. llvm-svn: 281638
* [pdb] Add command line options for dumping individual streams and blocksZachary Turner2016-09-091-2/+9
| | | | | | | | | | | | | I ran into a situation where I wanted to print out the contents of page 6 of a PDB as a binary blob, and there was no straightforward way to do that. In addition to adding that, this patch also adds the ability to dump a stream by index as a binary blob, and it will stitch together all the blocks and dump the whole thing as one seemingly contiguous sequence of bytes. llvm-svn: 281070
* Resubmit "Write the TPI stream from a PDB to Yaml."Zachary Turner2016-08-181-0/+1
| | | | | | | | The original patch was breaking some buildbots due to an incorrect ordering of function definitions which caused some compilers to recognize a definition but others to not. llvm-svn: 279089
* Revert "Write the TPI stream from a PDB to Yaml."Justin Bogner2016-08-161-1/+0
| | | | | | | | | This is hitting a "use of undeclared identifier 'skipPadding' error locally and on some bots. This reverts r278869. llvm-svn: 278871
* Write the TPI stream from a PDB to Yaml.Zachary Turner2016-08-161-0/+1
| | | | | | | Reviewed By: ruiu, rnk Differential Revision: https://reviews.llvm.org/D23226 llvm-svn: 278869
* [msf] Teach LLVM to parse a split Fpm.Zachary Turner2016-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | The FPM is split at regular intervals across the MSF file, as the MS code suggests. It turns out that the value of the interval is precisely the block size. If the block size is 4096, then there are two Fpm pages every 4096 blocks. So here we teach the PDBFile class to parse a split FPM, and also add more options when dumping the FPM to display some additional information such as orphaned pages (pages which the FPM says are allocated, but which nothing appears to use), use after free pages (pages which the FPM says are not allocated, but which are referenced by a stream), and multiple use pages (pages which the FPM says are allocated but are used more than once). Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D23022 llvm-svn: 277388
* pdbdump: Dump Free Page Map contents.Rui Ueyama2016-07-291-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D22974 llvm-svn: 277216
* [pdb] Round-trip module & file info to/from YAML.Zachary Turner2016-07-221-0/+2
| | | | | | | | | | 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
* Refactor the PDB writing to use a builder approachZachary Turner2016-07-111-0/+1
| | | | llvm-svn: 275110
* [pdb] Add a pdb2yaml option to not dump file headers.Zachary Turner2016-07-111-0/+1
| | | | | | | | | This will be useful once we start adding the ability to dump type records and symbol records, since it will allow us to generate mergeable information instead of information that specifies an entire file. llvm-svn: 275109
* [pdb] Round trip the PDB stream between YAML and binary PDB.Zachary Turner2016-07-061-0/+1
| | | | | | This gets writing of the PDB stream working. llvm-svn: 274647
* Update llvm-pdbdump to use subcommands.Zachary Turner2016-06-301-13/+19
| | | | llvm-svn: 274247
* [pdbdump] Print out New FPO stream contents.Rui Ueyama2016-06-061-0/+1
| | | | | | | | | | 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-031-1/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D20945 llvm-svn: 271736
* [llvm-pdbdump] Introduce an abstraction for the output style.Zachary Turner2016-06-031-0/+23
| | | | | | | | | | | 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
* pdbdump: Print "Publics" stream.Rui Ueyama2016-05-131-1/+1
| | | | | | | | | | | | | | | | 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
* [llvm-pdbdump] Add include-only filters.Zachary Turner2015-09-291-0/+3
| | | | | | | | | | | | | | | | 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
* [llvm-pdbdump] Display full enum definitions.Zachary Turner2015-03-041-1/+2
| | | | | | | | | | | 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
* [llvm-pdbdump] Many minor fixes and improvementsZachary Turner2015-03-021-10/+13
| | | | | | | | | | | | | | | | | A short list of some of the improvements: 1) Now supports -all command line argument, which implies many other command line arguments to simplify usage. 2) Now supports -no-compiler-generated command line argument to exclude compiler generated types. 3) Prints base class list. 4) -class-definitions implies -types. 5) Proper display of bitfields. 6) Can now distinguish between struct/class/interface/union. And a few other minor tweaks. llvm-svn: 230933
* [llvm-pdbdump] Rewrite dumper using visitor pattern.Zachary Turner2015-02-221-0/+28
| | | | | | | | | | This increases the flexibility of how to dump different symbol types -- necessary for context-sensitive formatting of symbol types -- and also improves the modularity by allowing the dumping to be implemented in the actual dumper, as opposed to in the PDB library. llvm-svn: 230184
* Rewrite llvm-pdbdump in terms of LLVMDebugInfoPDB.Zachary Turner2015-02-101-32/+0
| | | | | | | | | | | | | This makes llvm-pdbdump available on all platforms, although it will currently fail to create a dumper if there is no PDB reader implementation for the current platform. It implements dumping of compilands and children, which is less information than was previously available, but it has to be rewritten from scratch using the new set of interfaces, so the rest of the functionality will be added back in subsequent commits. llvm-svn: 228755
* Run dos2unix against llvm-pdbdump.Zachary Turner2015-01-271-31/+31
| | | | llvm-svn: 227262
* Add support for dumping debug tables to llvm-pdbdump.Zachary Turner2015-01-271-0/+32
PDB stores some of its data in streams and some in tables. This patch teaches llvm-pdbdump to dump basic summary data for the debug tables. In support of this, this patch also adds some DIA helper classes, such as a wrapper around an IDiaSymbol interface, as well as helpers for outputting various enumerations to a raw_ostream. llvm-svn: 227257
OpenPOWER on IntegriCloud