summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix the ASan fuse-lld.cc test after LLD r280012Reid Kleckner2016-09-011-1/+1
| | | | | | | | | | | With that change, images built with 'lld-link /debug' always have a debug directory. If no PDB filename was passed on the command line, then the filename in the executable is empty. PDB information would never work anyway if the PDB file name is empty, so go ahead and try DWARF in that case. llvm-svn: 280410
* [codeview] Properly propagate the TypeLeafKind through the pipeline.Zachary Turner2016-09-011-3/+3
| | | | llvm-svn: 280388
* [codeview] Have visitTypeBegin return the record type.Zachary Turner2016-08-314-12/+20
| | | | | | | | | | | | | | | | | | | Previously we were assuming that any visitation of types would necessarily be against a type we had binary data for. Reasonable assumption when were just reading PDBs and dumping them, but once we start writing PDBs from Yaml this breaks down, because we have no binary data yet, only Yaml, and from that we need to read the record kind and perform the switch based on that. So this patch does that. Instead of having the visitor switch on the kind that is already in the CVType record, we change the visitTypeBegin() method to return the Kind, and switch on the returned value. This way, the default implementation can still return the value from the CVType, but the implementation which visits Yaml records and serializes binary PDB type records can use the field in the Yaml as the source of the switch. llvm-svn: 280307
* [codeview] Add TypeVisitorCallbackPipeline.Zachary Turner2016-08-313-12/+42
| | | | | | | | | | | | | | | | | We were kind of hacking this together before by embedding the ability to forward requests into the TypeDeserializer. When we want to start adding more different kinds of visitor callback interfaces though, this doesn't scale well and is very inflexible. So introduce the notion of a pipeline, which itself implements the TypeVisitorCallbacks interface, but which contains an internal list of other callbacks to invoke in sequence. Also update the existing uses of CVTypeVisitor to use this new pipeline class for deserializing records before visiting them with another visitor. llvm-svn: 280293
* [codeview] Emit vtable shape informationReid Kleckner2016-08-311-0/+1
| | | | | | | | | | | | | The shape of the vtable is passed down as the size of the __vtbl_ptr_type. This special pointer type appears both as the pointee type of the vptr type, and by itself in every dynamic class. For classes with multiple vtables, only the shape of the primary vftable is included, as the shape of all secondary vftables will be the same as in the base class. Fixes PR28150 llvm-svn: 280254
* Remove unused translation unit.Zachary Turner2016-08-232-14/+0
| | | | llvm-svn: 279561
* [LLVM] Fix some Clang-tidy modernize-use-using and Include What You Use warningsEugene Zelenko2016-08-181-8/+13
| | | | | | Differential revision: https://reviews.llvm.org/D23675 llvm-svn: 279102
* Fix -Wpessimizing-move error, NFCVedant Kumar2016-08-181-1/+1
| | | | llvm-svn: 279095
* Resubmit "Write the TPI stream from a PDB to Yaml."Zachary Turner2016-08-186-92/+144
| | | | | | | | 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-166-144/+92
| | | | | | | | | 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-166-92/+144
| | | | | | | Reviewed By: ruiu, rnk Differential Revision: https://reviews.llvm.org/D23226 llvm-svn: 278869
* CodeView: extract the OMF Directory HeaderSaleem Abdulrasool2016-08-091-3/+3
| | | | | | | | | | | | The DebugDirectory contains a pointer to the CodeView info structure which is a derivative of the OMF debug directory. The structure has evolved a bit over time, and PDB 2.0 used a slightly different definition from PDB 7.0. Both of these are specific to CodeView and not COFF. Reflect this by moving the structure definitions into the DebugInfo/CodeView headers. Define a generic DebugInfo union type that can be used to pass around a reference to the DebugInfo irrespective of the versioning. NFC. llvm-svn: 278075
* CodeView: Remove an unused variableJustin Bogner2016-08-051-1/+0
| | | | | | It was breaking the -Werror build. llvm-svn: 277878
* Fix non portable include path.Zachary Turner2016-08-051-1/+1
| | | | llvm-svn: 277876
* [CodeView] Decouple record deserialization from visitor dispatch.Zachary Turner2016-08-0511-171/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now, our use case for the visitor has been to take a stream of bytes representing a type stream, deserialize the records in sequence, and do something with them, where "something" is determined by how the user implements a particular set of callbacks on an abstract class. For actually writing PDBs, however, we want to do the reverse. We have some kind of description of the list of records in their in-memory format, and we want to process each one. Perhaps by serializing them to a byte stream, or perhaps by converting them from one description format (Yaml) to another (in-memory representation). This was difficult in the current model because deserialization and invoking the callbacks were tightly coupled. With this patch we change this so that TypeDeserializer is itself an implementation of the particular set of callbacks. This decouples deserialization from the iteration over a list of records and invocation of the callbacks. TypeDeserializer is initialized with another implementation of the callback interface, so that upon deserialization it can pass the deserialized record through to the next set of callbacks. In a sense this is like an implementation of the Decorator design pattern, where the Deserializer is a decorator. This will be useful for writing Pdbs from yaml, where we have a description of the type records in Yaml format. In this case, the visitor implementation would have each visitation callback method implemented in such a way as to extract the proper set of fields from the Yaml, and it could maintain state that builds up a list of these records. Finally at the end we can pass this information through to another set of callbacks which serializes them into a byte stream. Reviewed By: majnemer, ruiu, rnk Differential Revision: https://reviews.llvm.org/D23177 llvm-svn: 277871
* [CodeView] Use llvm::Error instead of std::error_code.Zachary Turner2016-08-043-103/+126
| | | | | | | This eliminates the remnants of std::error_code from the DebugInfo libraries. llvm-svn: 277758
* pdbdump: Fix crash bug.Rui Ueyama2016-08-031-1/+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
* [msf] Make FPM reader use MappedBlockStream.Zachary Turner2016-08-032-17/+42
| | | | | | | | | | | | | MappedBlockSTream can work with any sequence of block data where the ordering is specified by a list of block numbers. So rather than manually stitch them together in the case of the FPM, reuse this functionality so that we can treat the FPM as if it were contiguous. Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D23066 llvm-svn: 277609
* PDB: Mark extended file pages as free by default.Rui Ueyama2016-08-021-1/+1
| | | | | | | | | BitVector::extend initializes extended bits as true by default. That is not desirable because new pages should be initially free. Differential Revision: https://reviews.llvm.org/D23048 llvm-svn: 277529
* [msf] Teach LLVM to parse a split Fpm.Zachary Turner2016-08-011-8/+35
| | | | | | | | | | | | | | | | | | | | 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-0/+11
| | | | | | Differential Revision: https://reviews.llvm.org/D22974 llvm-svn: 277216
* [msf] Resubmit "Rename Msf -> MSF".Zachary Turner2016-07-2930-133/+133
| | | | | | | | | | | | | Previously this change was submitted from a Windows machine, so changes made to the case of filenames and directory names did not survive the commit, and as a result the CMake source file names and the on-disk file names did not match on case-sensitive file systems. I'm resubmitting this patch from a Linux system, which hopefully allows the case changes to make it through unfettered. llvm-svn: 277213
* Revert "[msf] Rename Msf to MSF."Zachary Turner2016-07-2930-133/+133
| | | | | | This reverts commit 4d1557ffac41e079bcb1abbcf04f512474dcd6fe. llvm-svn: 277194
* [msf] Rename Msf to MSF.Zachary Turner2016-07-2930-133/+133
| | | | | | | | In a previous patch, it was suggested to use all caps instead of rolling caps for initialisms, so this patch changes everything to do this. llvm-svn: 277190
* [pdb] Fix an ambiguity when writing size_t on x64 platforms.Zachary Turner2016-07-281-1/+2
| | | | llvm-svn: 277025
* [pdb] Fix some warnings that break -Werror builds.Zachary Turner2016-07-281-2/+2
| | | | llvm-svn: 277021
* [pdb] Refactor library to more clearly separate reading/writingZachary Turner2016-07-2821-524/+456
| | | | | | | Reviewed By: amccarth, ruiu Differential Revision: https://reviews.llvm.org/D22693 llvm-svn: 277019
* Get rid of IMsfStreamData class.Zachary Turner2016-07-2811-69/+38
| | | | | | | | | | | | | | | | | | | | This was a pure virtual base class whose purpose was to abstract away the notion of how you retrieve the layout of a discontiguous stream of blocks in an Msf file. This led to too many layers of abstraction making it difficult to figure out what was going on and extend things. Ultimately, a stream's layout is decided by its length and the array of block numbers that it lives on. So rather than have an abstract base class which can return this in any number of ways, it's more straightforward to simply store them as fields of a trivial struct, and also to give a more appropriate name. This patch does that. It renames IMsfStreamData to MsfStreamLayout, and deletes the 2 concrete implementations, DirectoryStreamData and IndexedStreamData. MsfStreamLayout is a trivial struct with the necessary data. llvm-svn: 277018
* [modules] Add missing includes.Vassil Vassilev2016-07-281-0/+2
| | | | llvm-svn: 276970
* Make PDBFile store an msf::Layout.Zachary Turner2016-07-223-55/+55
| | | | | | | | | | | Previously it was storing all the fields of an msf::Layout as separate members. This is a trivial cleanup to make it store an msf::Layout directly. This makes the code more readable since it becomes clear which fields of PDBFile are actually the msf specific layout information in a sea of other bookkeeping fields. llvm-svn: 276460
* [pdb] Have builders share a single BumpPtrAllocator.Zachary Turner2016-07-223-11/+17
| | | | | | | | | | | | | This makes it easier to have the writable and readable PDB interfaces share code since the read/write and write-only interfaces now share a single allocator, you don't have to worry about a builder building a read only interface and then having the read-only interface's data become corrupt when the builder goes out of scope. Now the allocator is specified explicitly to all constructors, so all interfaces can share a single allocator that is scoped appropriately. llvm-svn: 276459
* [msf] Create LLVMDebugInfoMsfZachary Turner2016-07-2235-177/+291
| | | | | | | | | | | | | | This provides a better layering of responsibilities among different aspects of PDB writing code. Some of the MSF related code was contained in CodeView, and some was in PDB prior to this. Further, we were often saying PDB when we meant MSF, and the two are actually independent of each other since in theory you can have other types of data besides PDB data in an MSF. So, this patch separates the MSF specific code into its own library, with no dependencies on anything else, and DebugInfoCodeView and DebugInfoPDB take dependencies on DebugInfoMsf. llvm-svn: 276458
* [pdb] Move file layout header structs to RawTypes.hZachary Turner2016-07-223-80/+26
| | | | | | | | This facilitates code reuse between the builder classes and the "frozen" read only versions of the classes used for parsing existing PDB files. llvm-svn: 276427
* [pdb] Round-trip module & file info to/from YAML.Zachary Turner2016-07-226-65/+228
| | | | | | | | | | This implements support for writing compiland and compiland source file info to a binary PDB. This is tested by adding support for dumping these fields from an existing PDB to yaml, reading them back in, and dumping them again and verifying the values are as expected. llvm-svn: 276426
* Avoid dsymutil calls to getFileNameByIndex.Pete Cooper2016-07-221-6/+11
| | | | | | | | | | | | This change adds a hasFileAtIndex method. getChildDeclContext can first call this method, and if it returns true it knows it can then lookup the resolved path cache for the given file index. If we hit that cache then we don't even have to call getFileNameByIndex. Running dsymutil against the swift executable built from github gives a 20% performance improvement without any change in the binary. Differential Revision: https://reviews.llvm.org/D22655 Reviewed by friss. llvm-svn: 276380
* [pdb] Teach MsfBuilder and other classes about the Free Page Map.Zachary Turner2016-07-153-8/+16
| | | | | | | | | | | | | | 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-153-7/+75
| | | | llvm-svn: 275628
* [pdb] Use MsfBuilder to handle the writing PDBs.Zachary Turner2016-07-159-135/+166
| | | | | | | | | | | | | | | 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
* DebugInfo: reorder some initializersSaleem Abdulrasool2016-07-151-2/+2
| | | | | | Fix a few initialization ordering warnings from gcc from `-Wreorder`. NFC. llvm-svn: 275615
* [pdb] Introduce MsfBuilder for laying out PDB files.Zachary Turner2016-07-153-0/+290
| | | | | | | Reviewed by: ruiu Differential Revision: https://reviews.llvm.org/D22308 llvm-svn: 275611
* Dump enum unique names.Rui Ueyama2016-07-121-0/+3
| | | | llvm-svn: 275152
* Re-enable TPI hash verification for enum records.Rui Ueyama2016-07-122-4/+6
| | | | | | | We didn't read unique names correctly. As a result, we computed hashes on (non-)unique names instead of unique names. llvm-svn: 275150
* Refactor the PDB writing to use a builder approachZachary Turner2016-07-117-121/+276
| | | | llvm-svn: 275110
* Give helper classes/functions internal linkage. NFC.Benjamin Kramer2016-07-101-2/+2
| | | | llvm-svn: 275014
* [pdb] Sanity check the stream mapDavid Majnemer2016-07-101-1/+7
| | | | | | | | Some abstractions in LLVM "know" that they are reading in-bounds, FixedStreamArray, and provide a simple result. This breaks down if the stream map is bogus. llvm-svn: 275010
* [llvm-pdbdump] Propagate errors a little more consistentlyDavid Majnemer2016-07-102-9/+18
| | | | | | | PDBFile::getBlockData didn't really return any indication that it failed. It merely returned an empty buffer. llvm-svn: 275009
* [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-068-11/+164
| | | | | | This gets writing of the PDB stream working. llvm-svn: 274647
* Disable hash verification of enums.Zachary Turner2016-07-062-1/+3
| | | | llvm-svn: 274639
* Prune RelocVisitor.h include to avoid including COFF.h from MCJIT.hReid Kleckner2016-07-063-0/+4
| | | | | | | This helps to mitigate the conflict between COFF.h and winnt.h, which is PR28399. llvm-svn: 274637
OpenPOWER on IntegriCloud