summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-pdbdump
Commit message (Collapse)AuthorAgeFilesLines
* Rename llvm/test/tools/llvm-pdbdump to llvm/test/tools/llvm-pdbutilNico Weber2019-07-0943-1544/+0
| | | | | | | llvm-pdbdump was renamed to llvm-pdbutil long ago. This updates the test to be where you'd expect them to be. llvm-svn: 365515
* [NativePDB] Fix access to both old & new fpo data entries from dbi streamAleksandr Urakov2019-01-302-0/+14
| | | | | | | | | | | | | | | | | | Summary: This patch fixes access to fpo streams in native pdb from DbiStream and makes code consistent with DbiStreamBuilder. Patch By: leonid.mashinskiy Reviewers: zturner, aleksandr.urakov Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D56725 llvm-svn: 352615
* Fix a few small issues in llvm-pdbutilLeonard Mosescu2018-11-0218-1/+140
| | | | | | | | | | | | | Running "llvm-pdbutil dump -all" on linux (using the native PDB reader), over a few PDBs pulled from the Microsoft public symbol store uncovered a few small issues: - stripped PDBs might not have the strings stream (/names) - stripped PDBs might not have the "module info" stream Differential Revision: https://reviews.llvm.org/D54006 llvm-svn: 346010
* [llvm-pdbutil] Add missing pdb for testAaron Smith2018-10-111-0/+0
| | | | llvm-svn: 344306
* [llvm-pdbutil] Pretty print PDBSymbolUsingNamespace symbolsAaron Smith2018-10-113-0/+17
| | | | | | | | Reviewers: rnk, zturner, llvm-commits Differential Revision: https://reviews.llvm.org/D52799 llvm-svn: 344298
* [PDB] Add support for dumping Typedef records.Zachary Turner2018-10-011-1/+1
| | | | | | | | | | These work a little differently because they are actually in the globals stream and are treated as symbol records, even though DIA presents them as types. So this also adds the necessary infrastructure to cache records that live somewhere other than the TPI stream as well. llvm-svn: 343507
* Fix some tests on Windows.Zachary Turner2018-09-301-5/+1
| | | | | | | I don't actually have a Windows machine at the present moment, so hopefully this fixes it. llvm-svn: 343397
* [PDB] Fix failing test.Zachary Turner2018-09-201-3/+3
| | | | | | | This test was missed on the last run since I only ran a subset of them before commiting. llvm-svn: 342659
* [llvm-pdbutil] Support PDBs without a DBI streamAlexandre Ganea2018-08-063-0/+52
| | | | | | Differential Revision: https://reviews.llvm.org/D50258 llvm-svn: 339045
* win: try to fix dia tests with newer msvc versionsNico Weber2018-05-211-1/+1
| | | | llvm-svn: 332827
* [pdbutil] Print the checksum hex string when using the '-lines' optionAaron Smith2018-04-101-0/+5
| | | | llvm-svn: 329707
* [llvm-pdbutil] Add an export subcommand.Zachary Turner2018-04-022-0/+2
| | | | | | | | | | | | | | | | | This command can dump the binary contents of a stream to a file. This is useful when you want to do side-by-side comparisons of a specific stream from two PDBs to examine the differences between them. You can export both of them to a file, then open them up side by side in a hex editor (for example), so as to eliminate any differences that might arise from the contents being on different blocks in the PDB. In subsequent patches I plan to improve the "explain" subcommand so that you can explain the contents of a binary file that isn't necessarily a full PDB, but one of these dumped streams, by telling the subcommand how to interpret the contents. llvm-svn: 329002
* [llvm-pdbutil] Dig deeper into the PDB and DBI streams when explaining.Zachary Turner2018-03-302-0/+253
| | | | | | | | | This will show more detail when using `llvm-pdbutil explain` on an offset in the DBI or PDB streams. Specifically, it will dig into individual header fields and substreams to give a more precise description of what the byte represents. llvm-svn: 328878
* [PDB] Print some more details when explaining MSF fields.Zachary Turner2018-03-291-0/+3
| | | | | | | | | | | When we determine that a field belongs to an MSF super block or the free page map, we wouldn't print any additional information. With this patch, we now print the value of the field (for super block fields) or the allocation status of the specified byte (in the case of offsets in the FPM). llvm-svn: 328808
* [PDB] Fix a bug in the explain subcommand.Zachary Turner2018-03-291-4/+4
| | | | | | | | We were trying to dig into the super block fields and print a description of the field at the specified offset, but we were printing the wrong field due to an off-by-one-field-error. llvm-svn: 328804
* [PDB] Add an explain subcommand.Zachary Turner2018-03-291-0/+83
| | | | | | | | | | | | | | | | | | | When investigating various things, we often have a file offset and what to know what's in the PDB at that address. For example we may be doing a binary comparison of two LLD-generated PDBs to look for sources of non-determinism, or we may wish to compare an LLD-generated PDB with a Microsoft generated PDB for sources of byte-for-byte incompatibility. In these cases, we can do a binary diff of the two files, and once we find a mismatched byte we can use explain to figure out what that byte is, immediately honining in on the problem. This patch implements this by trying to narrow the meaning of a particular file offset down as much as possible. Differential Revision: https://reviews.llvm.org/D44959 llvm-svn: 328799
* Fix PDB injected sources test.Zachary Turner2018-03-152-5/+15
| | | | | | | | | This test was originally disabled because it was failing on a bot. It turns out I had run dos2unix on the file, and that removed a necessary byte from the file. I'm just recomitting the proper file and updating the test to test a little bit more now. llvm-svn: 327679
* Disable PDB injected sources test temporarily.Zachary Turner2018-03-131-0/+4
| | | | llvm-svn: 327451
* [PDB] Support dumping injected sources via the DIA reader.Zachary Turner2018-03-132-0/+16
| | | | | | | | | | | | | | | | | | Injected sources are basically a way to add actual source file content to your PDB. Presumably you could use this for shipping your source code with your debug information, but in practice I can only find this being used for embedding natvis files inside of PDBs. In order to effectively test LLVM's natvis file injection, we need a way to dump the injected sources of a PDB in a way that is authoritative (i.e. based on Microsoft's understanding of the PDB format, and not LLVM's). To this end, I've added support for dumping injected sources via DIA. I made a PDB file that used the /natvis option to generate a test case. Differential Revision: https://reviews.llvm.org/D44405 llvm-svn: 327428
* [SymboleFilePDB] Put the test input back that my previous commit clobberedAaron Smith2018-03-061-0/+0
| | | | llvm-svn: 326831
* [llvm-pdbdump] Dump restrict type qualifierAaron Smith2018-03-053-0/+80
| | | | | | | | | | | | Reviewers: zturner, llvm-commits, rnk Reviewed By: zturner Subscribers: majnemer Differential Revision: https://reviews.llvm.org/D43639 llvm-svn: 326731
* [pdbutil] Replace 0 byte PDB input with correct version to fix failing unit testAaron Smith2018-01-171-0/+0
| | | | llvm-svn: 322614
* Fix pretty printing the unspecified param of a variadic functionAaron Smith2018-01-173-0/+74
| | | | | | | | | | | | | | | | | | | | | | | Summary: - Fix a bug in PrettyBuiltinDumper that returns "void" as the name for an unspecified builtin type. Since the unspecified param of a variadic function is considered a builtin of unspecified type in PDBs, we set "..." for its name. - Provide a method to determine if a PDBSymbolFunc is variadic in PrettyFunctionDumper since PDBSymbolFunc::getArgument() doesn't return the last unspecified-type param. - Add a pretty-func-dumper.test to test pretty dumping of variadic functions. Reviewers: zturner, llvm-commits Reviewed By: zturner Differential Revision: https://reviews.llvm.org/D41801 llvm-svn: 322608
* [PDB] Add a test that verifies every known type record.Zachary Turner2017-07-051-2/+1
| | | | | | | | | | | | | | We had a lot of one-off tests for this type and that type, or "every type that happens to be generated by this program I built". Eventually I got a bug report filed where we were crashing on a type that was not covered by any of these tests. So this test carefully constructs a minimal C++ program that will cause every type we support to be emitted. This ensures full coverage for type records. Differential Revision: https://reviews.llvm.org/D34915 llvm-svn: 307187
* [llvm-pdbutil] Add the ability to dump the dependency tree for a typeZachary Turner2017-06-301-0/+30
| | | | | | | | | | | | | | | Previously we had the -type-index option which would dump the record of a single, but we had no way to follow the dependency graph backwards and also dump all dependent types. Having this option makes test-writing better, because we can limit the test to only those records that are of importance for the thing we're trying to test, which allows us to use things like CHECK-NEXT to reduce fragility. Differential Revision: https://reviews.llvm.org/D34899 llvm-svn: 306852
* Resubmit "[llvm-pdbutil] rewrite the "raw" output style."Zachary Turner2017-06-151-47/+0
| | | | | | | | | This resubmits commit c0c249e9f2ef83e1d1e5f166b50673d92f3579d7. It was broken due to some weird template issues, which have since been fixed. llvm-svn: 305517
* Revert "[llvm-pdbutil] rewrite the "raw" output style."Zachary Turner2017-06-151-0/+47
| | | | | | | | | This reverts commit 83ea17ebf2106859a51fbc2a86031b44d33696ad. This is failing due to some strange template problems, so reverting until it can be straightened out. llvm-svn: 305505
* [llvm-pdbutil] rewrite the "raw" output style.Zachary Turner2017-06-151-47/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After some internal discussions, we agreed that the raw output style had outlived its usefulness. It was originally created before we had even thought of dumping to YAML, and it was intended to give us some insight into the internals of a PDB file. Now we have YAML mode which does almost exactly this but is more powerful in that it can round-trip back to a PDB, which the raw mode could not do. So the raw mode had become purely a maintenance burden. One option was to just delete it. However, its original goal was to be as readable as possible while staying close to the "metal" - i.e. presenting the output in a way that maps directly to the underlying file format. We don't actually need that last requirement anymore since it's covered by the yaml mode, so we could repurpose "raw" mode to actually just be as readable as possible. This patch implements about 80% of the functionality previously in raw mode, but in a completely different style that is more akin to what cvdump outputs. Records are very compressed, often times appearing on just one line. One nice thing about this is that it makes full record matching easier, because you can grep for indices, names, and leaf types on a single line often. See the tests for some examples of what the new output looks like. Note that this patch actually regresses the functionality of raw mode in a few areas, but only because the patch was already unreasonably large and going 100% would have been even worse. Specifically, this patch is missing: The ability to dump module debug subsections (checksums, lines, etc) The ability to dump section headers Aside from that everything is here. While goign through the tests fixing them all up, I found many duplicate tests. They've been deleted. In subsequent patches I will go through and re-add the missing functionality. Differential Revision: https://reviews.llvm.org/D34191 llvm-svn: 305495
* Rename llvm-pdbdump -> llvm-pdbutil.Zachary Turner2017-06-098-27/+27
| | | | | | | | | | 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
* [llvm-pdbdump] Add the option to sort functions and data.Zachary Turner2017-05-144-4/+96
| | | | llvm-svn: 302998
* [llvm-pdbdump] Allow printing only a portion of a stream.Zachary Turner2017-04-281-0/+47
| | | | | | | | | | | | 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] Merge functionality of graphical and text dumpers.Zachary Turner2017-04-245-4/+11
| | | | | | | | | | | | | | 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-246-102/+107
| | | | | | | | 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-134-1/+167
| | | | 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-125-12/+229
| | | | | | | | | | | | | | | | | | | | | | | | 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-6/+6
| | | | | | | | | | | | | | | 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-062-18/+16
| | | | | | | | | | | | | | 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
* Update llvm-pdbdump to use subcommands.Zachary Turner2016-06-304-12/+12
| | | | llvm-svn: 274247
* Fix several accidental DOS line endings in source filesDimitry Andric2016-01-036-186/+186
| | | | | | | | | | | | | | | Summary: There are a number of files in the tree which have been accidentally checked in with DOS line endings. Convert these to native line endings. There are also a few files which have DOS line endings on purpose, and I have set the svn:eol-style property to 'CRLF' on those. Reviewers: joerg, aaron.ballman Subscribers: aaron.ballman, sanjoy, dsanders, llvm-commits Differential Revision: http://reviews.llvm.org/D15848 llvm-svn: 256707
* [llvm-pdbdump] Add include-only filters.Zachary Turner2015-09-291-0/+20
| | | | | | | | | | | | | | | | 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] Support dynamic load address and external symbols.Zachary Turner2015-05-013-0/+16
| | | | | | | | | | | 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
* [llvm-pdbdump] Display full enum definitions.Zachary Turner2015-03-042-7/+26
| | | | | | | | | | | 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-024-1/+122
| | | | | | | | | | | | | | | | | 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] Add regex-based filtering.Zachary Turner2015-03-014-0/+106
llvm-svn: 230888
OpenPOWER on IntegriCloud