summaryrefslogtreecommitdiffstats
path: root/llvm/test/DebugInfo/PDB
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r301487: Replace HashString algorithm with xxHash64Rui Ueyama2017-04-261-2/+2
| | | | | | This reverts commit r301487 to make buildbots green. llvm-svn: 301491
* Replace HashString algorithm with xxHash64Rui Ueyama2017-04-261-2/+2
| | | | | | | | | | | | The previous algorithm processed one character at a time, which is very painful on a modern CPU. Replace it with xxHash64, which both already exists in the codebase and is fairly fast. Patch from Scott Smith! Differential Revision: https://reviews.llvm.org/D32509 llvm-svn: 301487
* [llvm-pdbdump] Dump File / Line Info to YAML.Zachary Turner2017-04-251-0/+59
| | | | | | | | | 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] More advanced class definition dumping.Zachary Turner2017-04-122-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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
* [PDB] Emit index/offset pairs for TPI and IPI streamsReid Kleckner2017-04-111-0/+74
| | | | | | | | | | | | | | | | | | | Summary: This lets PDB readers lookup type record data by type index in O(log n) time. It also enables makes `cvdump -t` work on PDBs produced by LLD. cvdump will not dump a PDB that doesn't have an index-to-offset table. The table is sorted by type index, and has an entry every 8KB. Looking up a type record by index is a binary search of this table, followed by a scan of at most 8KB. Reviewers: ruiu, zturner, inglorion Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31636 llvm-svn: 299958
* [llvm-pdbdump] Display padding bytes on record layoutZachary Turner2017-04-101-22/+24
| | | | | | | | | | | | | | | 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
* Improves pretty printing of variable types in llvm-pdbdumpAdrian McCarthy2017-04-104-9/+28
| | | | | | | | | | | | | | | | | * Adds support for pointers to arrays, which was missing * Adds some tests * Improves consistency of const and volatile qualifiers * Eliminates non-composable special case code for arrays and function by using a more general recursive approach * Has a hack for getting the calling convention into the right spot for pointer-to-functions Given the rapid changes happenning in llvm-pdbdump, this may be difficult to merge. Differential Revision: https://reviews.llvm.org/D31832 llvm-svn: 299848
* Allow specification of what kinds of class members to dump.Zachary Turner2017-04-061-1/+0
| | | | | | | | | | | | | | 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
* Re-land: "Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]"Adrian McCarthy2017-03-291-0/+11
| | | | | | | | | | | | | | This should work on all platforms now that r299006 has landed. Tested locally on Windows and Linux. This moves exe symbol-specific method implementations out of NativeRawSymbol into a concrete subclass. Also adds implementations for hasCTypes and hasPrivateSymbols and a simple test to ensure the native reader can access the summary information for the executable from the PDB. Original Differential Revision: https://reviews.llvm.org/D31059 llvm-svn: 299019
* [PDB] Use two DBs when dumping the IPI streamReid Kleckner2017-03-231-29/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When dumping these records from an object file section, we should use only one type database. However, when dumping from a PDB, we should use two: one for the type stream and one for the IPI stream. Certain type records that normally live in the .debug$T object file section get moved over to the IPI stream of the PDB file and they get new indices. So far, I've noticed that the MSVC linker always moves these records into IPI: - LF_FUNC_ID - LF_MFUNC_ID - LF_STRING_ID - LF_SUBSTR_LIST - LF_BUILDINFO - LF_UDT_MOD_SRC_LINE These records have index fields that can point into TPI or IPI. In particular, LF_SUBSTR_LIST and LF_BUILDINFO point to LF_STRING_ID records to describe compilation command lines. I've modified the dumper to have an optional pointer to the item DB, and to do type name lookup of these fields in that DB. See printItemIndex. The result is that our pdbdump-headers.test is more faithful to the PDB contents and the output is less confusing. Reviewers: ruiu Subscribers: amccarth, zturner, llvm-commits Differential Revision: https://reviews.llvm.org/D31309 llvm-svn: 298649
* Somehow this still breaks because of ANSI color codes in test output on Linux.Adrian McCarthy2017-03-231-11/+0
| | | | | | | | | | Reverting until I can figure out the root cause. Revert "Re-land: Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]" This reverts commit f461a70cc376f0f91c8b4917be79479cc86330a5. llvm-svn: 298626
* Fix build break after r298623Adrian McCarthy2017-03-231-1/+1
| | | | | | | Use the -color-output option explicitly to eliminate the ANSI color codes in pdb-native-summary.test. (The default should have done this.) llvm-svn: 298625
* Re-land: Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]Adrian McCarthy2017-03-231-0/+11
| | | | | | | | | | | | | | The new test should pass on all platforms now that llvm-pdbdump has the `-color-output` option. This moves exe symbol-specific method implementations out of NativeRawSymbol into a concrete subclass. Also adds implementations for hasCTypes and hasPrivateSymbols and a simple test to ensure the native reader can access the summary information for the executable from the PDB. Original Differential Revision: https://reviews.llvm.org/D31059 llvm-svn: 298623
* [codeview] Use separate records for LF_SUBSTR_LIST and LF_ARGLISTReid Kleckner2017-03-221-3/+3
| | | | | | | They are structurally the same, but now we need to distinguish them because one record lives in the IPI stream and the other lives in TPI. llvm-svn: 298474
* Revert "Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]"Zachary Turner2017-03-171-11/+0
| | | | | | | For some reason this is causing ANSI color codes to be printed even when run through FileCheck. llvm-svn: 298026
* [pdb] Fix an uninitialized read, and add a test for it.Zachary Turner2017-03-172-0/+29
| | | | | | | | | | | | | | | | | | | This was originally reported in pr32249, uncovered by PTVS-Studio. There was no code coverage for this path because it was difficult to construct odd-case PDB files that were not generated by cl. Now that we can write construct minimal PDB files from YAML, it's easy to construct fragments that generate whatever we want. In this patch I add a test that creates 2 type records. One with a unique name, and one without. I verify that we can go from PDB to Yaml with no errors. In a future patch I'd like to add something like llvm-pdbdump raw -lookup-type that will just dump one record and nothing else, which should make it a bit cleaner to find this kind of thing. llvm-svn: 298017
* Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]Adrian McCarthy2017-03-161-0/+11
| | | | | | | | | | | This moves exe symbol-specific method implementations out of NativeRawSymbol into a concrete subclass. Also adds implementations for hasCTypes and hasPrivateSymbols and a simple test to ensure the native reader can access the summary information for the executable from the PDB. Differential Revision: https://reviews.llvm.org/D31059 llvm-svn: 298005
* [PDB] Add support for parsing Flags from PDB Stream.Zachary Turner2017-03-163-0/+5
| | | | | | | | | | | | | | | | | | | This was discovered when running `llvm-pdbdump diff` against two files, the second of which was generated by running the first one through pdb2yaml and then yaml2pdb. The second one was missing some bytes from the PDB Stream, and tracking this down showed that at the end of the PDB Stream were some additional bytes that we were ignoring. Looking back to the reference code, these seem to specify some additional flags that indicate whether the PDB supports various optional features. This patch adds support for reading, writing, and round-tripping these flags through YAML and the raw dumper, and updates the tests accordingly. llvm-svn: 297984
* [pdb] Write the module info and symbol record streams.Zachary Turner2017-03-153-4/+22
| | | | | | | | | | | 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
* Introduce NativeEnumModules and NativeCompilandSymbolAdrian McCarthy2017-03-151-0/+65
| | | | | | | | | | | Together, these allow lldb-pdbdump to list all the modules from a PDB using a native reader (rather than DIA). Note that I'll probably be specializing NativeRawSymbol in a subsequent patch. Differential Revision: https://reviews.llvm.org/D30956 llvm-svn: 297883
* [pdb] Fix failing testZachary Turner2017-01-251-1/+2
| | | | llvm-svn: 293091
* [pdb] Correctly parse the hash adjusters table from TPI stream.Zachary Turner2017-01-251-8/+6
| | | | | | | | | | | | | This is not a list of pairs, it is a hash table data structure. We now correctly parse this out and dump it from llvm-pdbdump. We still need to understand the conditions that lead to a type getting an entry in the hash adjuster table. That will be done in a followup investigation / patch. Differential Revision: https://reviews.llvm.org/D29090 llvm-svn: 293090
* [pdb] Write the Named Stream mapping to Yaml and binary.Zachary Turner2017-01-204-16/+39
| | | | | | Differential Revision: https://reviews.llvm.org/D28919 llvm-svn: 292665
* Resubmit "[CodeView] Hook CodeViewRecordIO for reading/writing symbols."Zachary Turner2016-12-162-22/+7
| | | | | | | The original patch was broken due to some undefined behavior as well as warnings that were triggering -Werror. llvm-svn: 290000
* Revert "[CodeView] Hook CodeViewRecordIO for reading/writing symbols."Zachary Turner2016-12-162-7/+22
| | | | | | | This reverts commit r289978, which is failing due to some rebase/merge issues. llvm-svn: 289981
* [CodeView] Hook CodeViewRecordIO for reading/writing symbols.Zachary Turner2016-12-162-22/+7
| | | | | | | | | This is the 3rd of 3 patches to get reading and writing of CodeView symbol and type records to use a single codepath. Differential Revision: https://reviews.llvm.org/D26427 llvm-svn: 289978
* Add CodeViewRecordIO for reading and writing.Zachary Turner2016-11-021-179/+99
| | | | | | | | | | | | | | | Using a pattern similar to that of YamlIO, this allows us to have a single codepath for translating codeview records to and from serialized byte streams. The current patch only hooks this up to the reading of CodeView type records. A subsequent patch will hook it up for writing of CodeView type records, and then a third patch will hook up the reading and writing of CodeView symbols. Differential Revision: https://reviews.llvm.org/D26040 llvm-svn: 285836
* Do not print out Flags field twice.Rui Ueyama2016-10-281-10/+26
| | | | llvm-svn: 285481
* [pdb] added support for dumping globals streamBob Haarman2016-10-211-2/+12
| | | | | | | | | | | | 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/+186
| | | | | | | | | | | | | | 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
* Do not pass a superblock to PDBFileBuilder.Rui Ueyama2016-09-301-2/+2
| | | | | | | | | | | | | | | | | | | | | When we create a PDB file using PDBFileBuilder, the information in the superblock, such as the size of the resulting file, is not available. Previously, PDBFileBuilder::initialize took a superblock assuming that all the members of the struct are correct. That is useful when you want to restore the exact information from a YAML file, but that's probably the only use case in which that is useful. When we are creating a PDB file on the fly, we have to backfill the members. This patch redefines PDBFileBuilder::initialize to take only a block size. Now all the other members are left as default values, so that they'll be updated when commit() is called. Differential Revision: https://reviews.llvm.org/D25108 llvm-svn: 282944
* [pdb] Write TPI hash values to the TPI stream.Zachary Turner2016-09-142-6/+6
| | | | | | | | | | This completes being able to write all the interesting values of a PDB TPI stream. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D24370 llvm-svn: 281555
* [pdb] Print out some more info when dumping a raw stream.Zachary Turner2016-09-091-10/+16
| | | | | | | | | | | | | | | We have various command line options that print the type of a stream, the size of a stream, etc but nowhere that it can all be viewed together. Since a previous patch introduced the ability to dump the bytes of a stream, this seems like a good place to present a full view of the stream's properties including its size, what kind of data it represents, and the blocks it occupies. So I added the ability to print that information to the -stream-data command line option. llvm-svn: 281077
* [pdb] Add command line options for dumping individual streams and blocksZachary Turner2016-09-093-112/+54
| | | | | | | | | | | | | 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
* [pdb] Write PDB TPI Stream from Yaml.Zachary Turner2016-09-092-9/+12
| | | | | | | | | | This writes the full sequence of type records described in Yaml to the TPI stream of the PDB file. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D24316 llvm-svn: 281063
* Re-add "Make FieldList records print as a YAML sequence"Zachary Turner2016-09-061-1087/+1087
| | | | | | | | | | | | This was originally submitted in r280549, and reverted in r280577 due to breaking one MSVC buildbot. The issue is that MSVC 2013 doesn't synthesize move constructors. So even though i was writing std::move(A) it was copying it, leading to a bogus ArrayRef. The solution here is to simply remove the std::vector<> from the type, since it is unused and unnecessary. This way the ArrayRef continues to point into the original memory backing the CVType. llvm-svn: 280769
* Revert r280549.Nico Weber2016-09-031-482/+482
| | | | | | | | | | | | | | | | | | | The test it added doesn't pass: http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/15318/steps/ninja%20check%201/logs/FAIL%3A%20LLVM%3A%3Apdbdump-yaml-types.test Command Output (stdout): -- $ "D:/buildslave/clang-x64-ninja-win7/stage1/./bin\llvm-pdbdump.EXE" "pdb2yaml" "-tpi-stream" "D:\buildslave\clang-x64-ninja-win7\llvm\test\DebugInfo\PDB/Inputs/empty.pdb" $ "D:/buildslave/clang-x64-ninja-win7/stage1/./bin\FileCheck.EXE" "-check-prefix=YAML" "D:\buildslave\clang-x64-ninja-win7\llvm\test\DebugInfo\PDB\pdbdump-yaml-types.test" # command stderr: D:\buildslave\clang-x64-ninja-win7\llvm\test\DebugInfo\PDB\pdbdump-yaml-types.test:36:7: error: expected string not found in input YAML: Name: apartment ^ <stdin>:153:10: note: scanning from here Value: 161 ^ llvm-svn: 280577
* [codeview] Make FieldList records print as a yaml sequence.Zachary Turner2016-09-021-482/+482
| | | | | | | | | | | Before we were kind of imitating the behavior of a Yaml sequence by outputting each record one after the other. This makes it a little cumbersome when we want to go the other direction -- from Yaml to Pdb. So this treats FieldList records as no different than any other list of records, by printing them as a Yaml sequence with the exact same format. llvm-svn: 280549
* Resubmit "Write the TPI stream from a PDB to Yaml."Zachary Turner2016-08-182-0/+1092
| | | | | | | | 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-162-1092/+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-162-0/+1092
| | | | | | | Reviewed By: ruiu, rnk Differential Revision: https://reviews.llvm.org/D23226 llvm-svn: 278869
* pdbdump: Add a test to verify the result of PDB -> YAML -> PDB conversions.Rui Ueyama2016-08-031-4/+38
| | | | | | | Currently not all information can be restored from YAML. This test verifies only the PDB header. llvm-svn: 277682
* pdbdump: Fix crash bug.Rui Ueyama2016-08-031-0/+4
| | | | | | | | | | pdbdump calls DbiStreamBuilder::commit through PDBFileBuilder::commit without calling DbiStreamBuilder::finalize. Because `finalize` initializes `Header` member, `Header` remained nullptr which caused a crash bug. Differential Revision: https://reviews.llvm.org/D23143 llvm-svn: 277681
* Fix a test for r277545.Rui Ueyama2016-08-021-2/+2
| | | | | | This change should have been submitted with that commit. llvm-svn: 277548
* [msf] Teach LLVM to parse a split Fpm.Zachary Turner2016-08-011-3/+9
| | | | | | | | | | | | | | | | | | | | 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-1/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D22974 llvm-svn: 277216
* [pdbdump] Use the "flow" style to print out a sequence of uint32_t.Rui Ueyama2016-07-201-53/+20
| | | | | | | | Summary: Lists can be written either with "-" or "[]" in YAML. Differential Revision: https://reviews.llvm.org/D22579 llvm-svn: 276168
* [pdb] Teach MsfBuilder and other classes about the Free Page Map.Zachary Turner2016-07-152-4/+4
| | | | | | | | | | | | | | Block 1 and 2 of an MSF file are bit vectors that represent the list of blocks allocated and free in the file. We had been using these blocks to write stream data and other data, so we mark them as the free page map now. We don't yet serialize these pages to the disk, but at least we make a note of what it is, and avoid writing random data to them. Doing this also necessitated cleaning up some of the tests to be more general and hardcode fewer values, which is nice. llvm-svn: 275629
* [pdb] Round trip the NameMap data structure to YAML.Zachary Turner2016-07-151-0/+7
| | | | llvm-svn: 275628
* [pdb] Use MsfBuilder to handle the writing PDBs.Zachary Turner2016-07-153-7/+7
| | | | | | | | | | | | | | | Previously we would read a PDB, then write some of it back out, but write the directory, super block, and other pertinent metadata back out unchanged. This generates incorrect PDBs since the amount of data written was not always the same as the amount of data read. This patch changes things to use the newly introduced `MsfBuilder` class to write out a correct and accurate set of Msf metadata for the data *actually* written, which opens up the door for adding and removing type records, symbol records, and other types of data to an existing PDB. llvm-svn: 275627
OpenPOWER on IntegriCloud