summaryrefslogtreecommitdiffstats
path: root/llvm/test/DebugInfo/PDB/Inputs
Commit message (Collapse)AuthorAgeFilesLines
* Make pdbdump-objfilename test work againNico Weber2019-07-091-0/+6
| | | | | | | | | | | | - The test had extension .yaml, which lit doesn't execute in this directory. Rename to .test to make it run, and move the yaml bits into a dedicated file, like with all other tests in this dir. - llvm-pdbdump got renamed to llvm-pdbutil long ago, update test. - -dbi-module-info got renamed in r305032, update test for this too. llvm-svn: 365514
* [codeview] Finish support for reading and writing S_ANNOTATION recordsReid Kleckner2019-05-151-1/+1
| | | | | | Implement dumping via llvm-pdbutil and llvm-readobj. llvm-svn: 360813
* [PDB] Fix another bug in globals stream name lookup.Zachary Turner2018-10-092-0/+23
| | | | | | | | When we're on the last bucket the computation is tricky. We were failing when the last bucket contained multiple matches. Added a new test for this. llvm-svn: 344081
* [PDB] Add native support for dumping array types.Zachary Turner2018-09-302-0/+37
| | | | llvm-svn: 343412
* [NativePDB] Add support for reading function signatures.Zachary Turner2018-09-212-0/+80
| | | | | | | This adds support for parsing function signature records and returning them through the native DIA interface. llvm-svn: 342780
* [PDB] Add the ability to map forward references to full decls.Zachary Turner2018-09-202-0/+61
| | | | | | | | | | | | | | | | | | | | | Some records point to an LF_CLASS, LF_UNION, LF_STRUCTURE, or LF_ENUM which is a forward reference and doesn't contain complete debug information. In these cases, we'd like to be able to quickly locate the full record. The TPI stream stores an array of pre-computed record hash values, one for each type record. If we pre-process this on startup, we can build a mapping from hash value -> {list of possible matching type indices}. Since hashes of full records are only based on the name and or unique name and not the full record contents, we can then use forward ref record to compute the hash of what *would* be the full record by just hashing the name, use this to get the list of possible matches, and iterate those looking for a match on name or unique name. llvm-pdbutil is updated to resolve forward references for the purposes of testing (plus it's just useful). Differential Revision: https://reviews.llvm.org/D52283 llvm-svn: 342656
* [PDB] Better support for enumerating pointer types.Zachary Turner2018-09-182-0/+48
| | | | | | | | | | | | | | | | | | | There were several issues with the previous implementation. 1) There were no tests. 2) We didn't support creating PDBSymbolTypePointer records for builtin types since those aren't described by LF_POINTER records. 3) We didn't support a wide enough variety of builtin types even ignoring pointers. This patch fixes all of these issues. In order to add tests, it's helpful to be able to ignore the symbol index id hierarchy because it makes the golden output from the DIA version not match our output, so I've extended the dumper to disable dumping of id fields. llvm-svn: 342493
* [PDB] Make the native reader support enumerators.Zachary Turner2018-09-172-0/+110
| | | | | | | | | | | Previously we would dump the names of enum types, but not their enumerator values. This adds support for enumerator values. In doing so, we have to introduce a general purpose mechanism for caching symbol indices of field list members. Unlike global types, FieldList members do not have a TypeIndex. So instead, we identify them by the pair {TypeIndexOfFieldList, IndexInFieldList}. llvm-svn: 342415
* [PDB] Make the pretty dumper output modified types.Zachary Turner2018-09-143-1/+36
| | | | | | | | | | | Currently if we got something like `const Foo` we'd ignore it and just rely on printing the unmodified `Foo` later on. However, for testing the native reading code we really would like to be able to see these so that we can verify that the native reader can actually handle them. Instead of printing out the full type though, just print out the header. llvm-svn: 342295
* Teach llvm-pdbutil to dump types from object files.Zachary Turner2017-12-052-0/+105
| | | | llvm-svn: 319859
* [PDB] Handle an empty globals hash table with no bucketsReid Kleckner2017-10-271-0/+0
| | | | llvm-svn: 316722
* [PDB] Add a test that verifies every known type record.Zachary Turner2017-07-053-0/+335
| | | | | | | | | | | | | | 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
* Fix line endings.Zachary Turner2017-06-121-10/+10
| | | | llvm-svn: 305249
* [pdb] Don't choke on unknown symbol types.Zachary Turner2017-06-121-0/+10
| | | | | | | | | When we get an unknown symbol type, we might as well at least dump it. Same goes for round-tripping through YAML, we can dump the record contents as raw bytes even if we don't know how to interpret it semantically. llvm-svn: 305248
* [codeview] use 32-bit integer for RelocOffset in DebugLinesSubsectionBob Haarman2017-06-091-1/+1
| | | | | | | | | | | | | | | | | Summary: RelocOffset is a 32-bit value, but we previously truncated it to 16 bits. Fixes PR33335. Reviewers: zturner, hiraditya! Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D33968 llvm-svn: 305043
* [CodeView] Support remaining debug subsection typesZachary Turner2017-06-091-0/+27
| | | | | | | | | | | | | | | | 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-082-28/+24
| | | | | | | | | | | | | | | 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
* [CodeView] Handle Cross Module Imports and Exports.Zachary Turner2017-06-051-0/+24
| | | | | | | | | | | | | | | While it's not entirely clear why a compiler or linker might put this information into an object or PDB file, one has been spotted in the wild which was causing llvm-pdbdump to crash. This patch adds support for reading-writing these sections. Since I don't know how to get one of the native tools to generate this kind of debug info, the only test here is one in which we feed YAML into the tool to produce a PDB and then spit out YAML from the resulting PDB and make sure that it matches. llvm-svn: 304738
* [CodeView] Support CodeView subsections in any order.Zachary Turner2017-06-021-35/+36
| | | | | | | | | | | | | | | Previously we would expect certain subsections to appear in a certain order because some subsections would reference other subsections, but in practice we need to support arbitrary orderings since some object file and PDB file producers generate them this way. This also paves the way for supporting Yaml <-> Object File conversion of CodeView, since Object Files typically have quite a large number of subsections in their debug info. Differential Revision: https://reviews.llvm.org/D33807 llvm-svn: 304588
* [pdb] pad source file name buffer at the end instead of the beginningBob Haarman2017-05-252-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | Summary: DbiStreamBuilder calculated the offset of the source file names inside the file info substream as the size of the file info substream minus the size of the file names. Since the file info substream is padded to a multiple of 4 bytes, this caused the first file name to be aligned on a 4-byte boundary. By contrast, DbiModuleList would read the file names immediately after the file name offset table, without skipping to the next 4-byte boundary. This change makes it so that the file names are written to the location where DbiModuleList expects them, and puts any necessary padding for the file info substream after the file names instead of before it. Reviewers: amccarth, rnk, zturner Reviewed By: amccarth, zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D33475 llvm-svn: 303917
* Implement various flavors of type merging.Zachary Turner2017-05-226-0/+323
| | | | | | | | | | | | | | Previous algotirhm assumed that types and ids are in a single unified stream. For inputs that come from object files, this is the case. But if the input is already a PDB, or is the result of a previous merge, then the types and ids will already have been split up, in which case we need an algorithm that can accept operate on independent streams of types and ids that refer across stream boundaries to each other. Differential Revision: https://reviews.llvm.org/D33417 llvm-svn: 303577
* [llvm-pdbdump] Add the ability to merge PDBs.Zachary Turner2017-05-182-0/+104
| | | | | | | | | | | | | | | Merging PDBs is a feature that will be used heavily by the linker. The functionality already exists but does not have deep test coverage because it's not easily exposed through any tools. This patch aims to address that by adding the ability to merge PDBs via llvm-pdbdump. It takes arbitrarily many PDBs and outputs a single PDB. Using this new functionality, a test is added for merging type records. Future patches will add the ability to merge symbol records, module information, etc. llvm-svn: 303389
* [PDB/CodeView] Read/write codeview inlinee line information.Zachary Turner2017-05-021-4/+9
| | | | | | | | Previously we wrote line information and file checksum information, but we did not write information about inlinee lines and functions. This patch adds support for that. llvm-svn: 301936
* [CodeView] Write CodeView line information.Zachary Turner2017-05-011-0/+38
| | | | | | Differential Revision: https://reviews.llvm.org/D32716 llvm-svn: 301882
* [llvm-pdbdump] More advanced class definition dumping.Zachary Turner2017-04-121-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Improves pretty printing of variable types in llvm-pdbdumpAdrian McCarthy2017-04-102-0/+8
| | | | | | | | | | | | | | | | | * 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
* [pdb] Fix an uninitialized read, and add a test for it.Zachary Turner2017-03-171-0/+26
| | | | | | | | | | | | | | | | | | | 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
* [pdb] Write the module info and symbol record streams.Zachary Turner2017-03-151-0/+11
| | | | | | | | | | | 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
* [llvm-pdbdump] Restore error messages, handle bad block sizesDavid Majnemer2016-04-281-0/+2
| | | | | | | We lost the ability to report errors, bring it back. Also, correctly validate the block size. llvm-svn: 267955
* [llvm-pdbdump] Correctly read data larger than a blockDavid Majnemer2016-04-281-0/+0
| | | | | | | | | A bug was introduced when the code was refactored which resulted in a bad memory access. This fixes PR27565. llvm-svn: 267953
* [llvm-pdbdump] Add support for dumping global variables.Zachary Turner2015-02-272-0/+3
| | | | llvm-svn: 230744
* [llvm-pdbdump] Fix dumping of function pointers and basic types.Zachary Turner2015-02-262-2/+19
| | | | | | | | | | | | Function pointers were not correctly handled by the dumper, and they would print as "* name". They now print as "int (__cdecl *name)(int arg1, int arg2)" as they should. Also, doubles were being printed as floats. This fixes that bug as well, and adds tests for all builtin types. as well as a test for function pointers. llvm-svn: 230703
* [llvm-pdbdump] Add an option to dump full class definitions.Zachary Turner2015-02-232-1/+30
| | | | | | | | | | | This adds the --class-definitions flag. If specified, when dumping types, instead of "class Foo" you will see the full class definition, with member functions, constructors, access specifiers. NOTE: Using this option can be very slow, as generating a full class definition requires accessing many different parts of the PDB. llvm-svn: 230203
* [llvm-pdbdump] Resubmit "Add some tests for llvm-pdbdump".Zachary Turner2015-02-225-0/+37
| | | | | | | | | | | | | NOTE: This patch intentionally breaks the build. It attempts to resubmit r230083, but with some debug logging in the CMake and lit config files to determine why certain bots do not correctly disable the DIA tests when DIA is not available. After a sufficient number of bots fail, this patch will either be reverted or, if the cause of the failure becomes obvious, a fix submitted with the log statements removed. llvm-svn: 230161
* Revert "[llvm-pdbdump] Add some tests for llvm-pdbdump."Zachary Turner2015-02-205-37/+0
| | | | | | | It is not correctly detecting the situations where the test is unsupported. Reverting until we can figure it out. llvm-svn: 230085
* [llvm-pdbdump] Add some tests for llvm-pdbdump.Zachary Turner2015-02-205-0/+37
This adds only a very basic set of tests that dump a few functions and object files. Differential Revision: http://reviews.llvm.org/D7656 Reviewed By: David Blaikie llvm-svn: 230083
OpenPOWER on IntegriCloud