summaryrefslogtreecommitdiff
path: root/tools/llvm-pdbutil/MinimalTypeDumper.cpp
AgeCommit message (Collapse)Author
2018-05-17[llvm-pdbutil] Dump struct/class/union sizes in the minimal dump formatReid Kleckner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332645 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-10Fix line endings (CR/LF -> LF) introduced by rL329613Alexandre Ganea
reviewer: zturner git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329646 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-09[Debuginfo][COFF] Minimal serialization support for precompiled types recordsAlexandre Ganea
This change adds support for the LF_PRECOMP and LF_ENDPRECOMP records required to read/write Microsoft precompiled types .objs. See https://en.wikipedia.org/wiki/Precompiled_header#Microsoft_Visual_C_and_C++ This also adds handling for the .debug$P section, which is actually a .debug$T section in disguise, found only in precompiled .objs. Differential Revision: https://reviews.llvm.org/D45283 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329613 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-31[llvm-pdbutil] Print detailed S_UDT stats.Zachary Turner
This adds a new command line option, -udt-stats, which breaks down the stats of S_UDT records. These are one of the biggest contributors to the size of /DEBUG:FASTLINK PDBs, so they need some additional tools to be able to analyze their usage. This option will dig into each S_UDT record and determine what kind of record it points to, and then break down the statistics by the target type. The goal here is to identify how our object files differ from MSVC object files in S_UDT records, so that we can output fewer of them and reach size parity. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312276 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-18[PDB] Finish and simplify TPI hashingReid Kleckner
Summary: This removes the CVTypeVisitor updater and verifier classes. They were made dead by the minimal type dumping refactoring. Replace them with a single function that takes a type record and produces a hash. Call this from the minimal type dumper and compare the hash. I also noticed that the microsoft-pdb reference repository uses a basic CRC32 for records that aren't special. We already have an implementation of that CRC ready to use, because it's used in COFF for ICF. I'll make LLD call this hashing utility in a follow-up change. We might also consider using this same hash in type stream merging, so that we don't have to hash our records twice. Reviewers: inglorion, ruiu Subscribers: llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D35515 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308240 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-17[codeview] Fix YAML for LF_TYPESERVER2 by hoisting PDB_UniqueIdReid Kleckner
Summary: We were treating the GUIDs in TypeServer2Record as strings, and the non-ASCII bytes in the GUID would not round-trip through YAML. We already had the PDB_UniqueId type portably represent a Windows GUID, but we need to hoist that up to the DebugInfo/CodeView library so that we can use it in the TypeServer2Record as well as in PDB parsing code. Reviewers: inglorion, amccarth Subscribers: llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D35495 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308234 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-05[PDB] Add a test that verifies every known type record.Zachary Turner
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307187 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30[llvm-pdbutil] Add the ability to dump the dependency tree for a typeZachary Turner
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306852 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15[llvm-pdbutil] Add back the ability to dump hashes and index offsets.Zachary Turner
This was regressed in a previous patch that re-wrote the dumper, and I'm incrementally adding back the pieces that are missing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305524 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15Resubmit "[llvm-pdbutil] rewrite the "raw" output style."Zachary Turner
This resubmits commit c0c249e9f2ef83e1d1e5f166b50673d92f3579d7. It was broken due to some weird template issues, which have since been fixed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305517 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15Revert "[llvm-pdbutil] rewrite the "raw" output style."Zachary Turner
This reverts commit 83ea17ebf2106859a51fbc2a86031b44d33696ad. This is failing due to some strange template problems, so reverting until it can be straightened out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305505 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15Fix some more warnings.Zachary Turner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305499 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15[llvm-pdbutil] rewrite the "raw" output style.Zachary Turner
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305495 91177308-0d34-0410-b5e6-96231b3b80d8