summaryrefslogtreecommitdiffstats
path: root/llvm/test/DebugInfo/PDB
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Refactor the PDB writing to use a builder approachZachary Turner2016-07-111-1/+1
| | | | llvm-svn: 275110
* [pdb] Add a pdb2yaml option to not dump file headers.Zachary Turner2016-07-111-0/+7
| | | | | | | | | 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
* [CodeView] Emit an appropriate symbol kind for globalsDavid Majnemer2016-07-061-0/+2
| | | | | | | We emitted debug info for globals/functions as if they all had external linkage. Instead, emit local symbol records when appropriate. llvm-svn: 274676
* [pdb] Round trip the PDB stream between YAML and binary PDB.Zachary Turner2016-07-062-6/+64
| | | | | | This gets writing of the PDB stream working. llvm-svn: 274647
* [pdb] Re-add code to write PDB files.Zachary Turner2016-06-301-0/+13
| | | | | | | | | Somehow all the functionality to write PDB files got removed, probably accidentally when uploading the patch perhaps the wrong one got uploaded. This re-adds all the code, as well as the corresponding test. llvm-svn: 274248
* Update llvm-pdbdump to use subcommands.Zachary Turner2016-06-305-20/+19
| | | | llvm-svn: 274247
* [codeview] Add support for splitting field list records over 64KBReid Kleckner2016-06-211-3/+3
| | | | | | | | | | | | | | | | | The basic structure is that once a list record goes over 64K, the last subrecord of the list is an LF_INDEX record that refers to the next record. Because the type record graph must be toplogically sorted, this means we have to emit them in reverse order. We build the type record in order of declaration, so this means that if we don't want extra copies, we need to detect when we were about to split a record, and leave space for a continuation subrecord that will point to the eventual split top-level record. Also adds dumping support for these records. Next we should make sure that large method overload lists work properly. llvm-svn: 273294
* [Codeview] Add a class for LF_UDT_MOD_SRC_LINE.Rui Ueyama2016-06-151-65/+65
| | | | | | Differential Revision: http://reviews.llvm.org/D21406 llvm-svn: 272843
* Resubmit "[pdb] Actually write a PDB to disk from YAML.""Zachary Turner2016-06-141-8/+10
| | | | | | | Reviewed By: ruiu Differential Revision: http://reviews.llvm.org/D21220 llvm-svn: 272708
* Revert "[pdb] Actually write a PDB to disk from YAML."Zachary Turner2016-06-141-10/+8
| | | | | | | | | This reverts commit 879139e1c6577b09df52de56a6bab856a19ed185. This was committed accidentally when I blindly typed git svn dcommit instead of the command to generate a patch. llvm-svn: 272693
* [pdb] Actually write a PDB to disk from YAML.Zachary Turner2016-06-141-8/+10
| | | | llvm-svn: 272692
* [pdbdump] Print out # of hash buckets.Rui Ueyama2016-06-071-0/+2
| | | | | | In the reference code, the field name is `cHashBuckets`. llvm-svn: 272075
* [pdbdump] Print out TPI hash key size.Rui Ueyama2016-06-071-0/+2
| | | | llvm-svn: 272073
* Fix CRLF -> LF.Rui Ueyama2016-06-061-17/+17
| | | | llvm-svn: 271960
* [pdbdump] Print section header flags.Rui Ueyama2016-06-061-8/+38
| | | | llvm-svn: 271943
* [llvm-pdbdump] Dump MSF headers to YAML.Zachary Turner2016-06-061-0/+17
| | | | | | | | | | | This is the simplest possible patch to get some kind of YAML output. All it dumps is the MSF header fields so that in theory an empty MSF file could be reconstructed. Reviewed By: ruiu, majnemer Differential Revision: http://reviews.llvm.org/D20971 llvm-svn: 271939
* [pdbdump] Print out New FPO stream contents.Rui Ueyama2016-06-061-1/+25
| | | | | | | | | | 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/+11
| | | | | | Differential Revision: http://reviews.llvm.org/D20945 llvm-svn: 271736
* [pdb] Add string table offsets to check output.Zachary Turner2016-06-031-91/+91
| | | | llvm-svn: 271674
* [pdb] Print out file names instead of file offsets.Zachary Turner2016-06-031-2/+2
| | | | | | | | | | | | When printing line information and file checksums, we were printing the file offset field from the struct header. This teaches llvm-pdbdump how to turn those numbers into the filename. In the case of file checksums, this is done by looking in the global string table. In the case of line contributions, this is done by indexing into the file names buffer of the DBI stream. Why they use a different technique I don't know. llvm-svn: 271630
* [pdb] Dump file checksums from pdb codeview line info.Zachary Turner2016-06-031-12/+10
| | | | llvm-svn: 271622
* [codeview] Dump line number and column information.Zachary Turner2016-06-031-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | To facilitate this, a couple of changes had to be made: 1. `ModuleSubstream` got moved from `DebugInfo/PDB` to `DebugInfo/CodeView`, and various codeview related types are defined there. It turns out `DebugInfo/CodeView/Line.h` already defines many of these structures, but this is really old code that is not endian aware, doesn't interact well with `StreamInterface` and not very helpful for getting stuff out of a PDB. Eventually we should migrate the old readobj `COFFDumper` code to these new structures, or at least merge their functionality somehow. 2. A `ModuleSubstream` visitor is introduced. Depending on where your module substream array comes from, different subsets of record types can be expected. We are already hand parsing these substream arrays in many places especially in `COFFDumper.cpp`. In the future we can migrate these paths to the visitor as well, which should reduce a lot of code in `COFFDumper.cpp`. Differential Revision: http://reviews.llvm.org/D20936 Reviewed By: ruiu, majnemer llvm-svn: 271621
* [llvm-pdbdump] Dump CodeView line information.Zachary Turner2016-06-021-2/+21
| | | | | | | | | This first pass only splits apart the records and dumps the line info kinds and binary data. Subsequent patches will parse out the binary data into more useful information and dump it in detail. llvm-svn: 271576
* pdbdump: print out COFF section headers.Rui Ueyama2016-06-021-2/+102
| | | | | | | | | | | | Unlike other sections that can grow to any size, the COFF section header stream has maximum length because each record is fixed size and the COFF file format limits the maximum number of sections. So I decided to not create a specific stream class for it. Instead, I added a member function to DbiStream class which returns a vector of COFF headers. Differential Revision: http://reviews.llvm.org/D20717 llvm-svn: 271557
* [pdb] Parse and dump section map and section contribsZachary Turner2016-06-021-19/+411
| | | | | | | Differential Revision: http://reviews.llvm.org/D20876 Reviewed By: rnk, ruiu llvm-svn: 271488
* Update test to deal with non-zero exit codesDavid Majnemer2016-05-281-1/+1
| | | | llvm-svn: 271135
* pdbdump: print out the name of the stream 0.Rui Ueyama2016-05-271-2/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D20712 llvm-svn: 270943
OpenPOWER on IntegriCloud