summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Native/NativeExeSymbol.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [PDB] Add support for dumping Typedef records.Zachary Turner2018-10-011-0/+2
| | | | | | | | | | These work a little differently because they are actually in the globals stream and are treated as symbol records, even though DIA presents them as types. So this also adds the necessary infrastructure to cache records that live somewhere other than the TPI stream as well. llvm-svn: 343507
* [PDB] Add support for parsing VFTable Shape records.Zachary Turner2018-10-011-0/+2
| | | | | | This allows them to be returned from the native API. llvm-svn: 343506
* [PDB] Add native support for dumping array types.Zachary Turner2018-09-301-0/+2
| | | | llvm-svn: 343412
* [NativePDB] Add support for reading function signatures.Zachary Turner2018-09-211-0/+4
| | | | | | | This adds support for parsing function signature records and returning them through the native DIA interface. llvm-svn: 342780
* [PDB] Add native reading support for UDT / class types.Zachary Turner2018-09-211-0/+4
| | | | | | | | | | | | This allows the native reader to find records of class/struct/ union type and dump them. This behavior is tested by using the diadump subcommand against golden output produced by actual DIA SDK on the same PDB file, and again using pretty -native to confirm that we actually dump the classes. We don't find class members or anything like that yet, for now it's just the class itself. llvm-svn: 342779
* [PDB] Remove all clone() methods.Zachary Turner2018-09-121-4/+0
| | | | | | | These are dead code and encourage poor usage patterns, so I'm removing them. They weren't called anywhere anyway. llvm-svn: 342093
* [PDB] Support pointer types in the native reader.Zachary Turner2018-09-071-0/+2
| | | | | | | | | | In order to start testing this, I've added a new mode to llvm-pdbutil which is only really useful for writing tests. It just dumps the value of raw fields in record format. This isn't really ideal and it won't allow us to test some important cases, but it's better than nothing for now. llvm-svn: 341729
* [PDB] Create a SymbolCache class.Zachary Turner2018-09-071-39/+17
| | | | | | | | | | | | | Part of the responsibility of the native PDB reader is to cache symbols the first time they are accessed, so they can then be looked up by an ID. Furthermore, we need to resolve type indices to records that we vend to the user, and other things. Previously this code was all thrown together a bit haphazardly in the native session class, but it makes sense to collect all of this into a single class whose sole responsibility is to manage the collection of known symbols. llvm-svn: 341608
* [PDB] Refactor the PDB symbol classes to fix a reuse bug.Zachary Turner2018-09-051-12/+38
| | | | | | | | | | | | | | | | | | | | The way DIA SDK works is that when you request a symbol, it gets assigned an internal identifier that is unique for the life of the session. You can then use this identifier to get back the same symbol, with all of the same internal state that it had before, even if you "destroyed" the original copy of the object you had. This didn't work properly in our native implementation, and if you destroyed an object for a particular symbol, then requested the same symbol again, it would get assigned a new ID and you'd get a fresh copy of the object. In order to fix this some refactoring had to happen to properly reuse cached objects. Some unittests are added to verify that symbol reuse is taking place, making use of the new unittest input feature. llvm-svn: 341503
* Remove redundant includes from lib/DebugInfo.Michael Zolotukhin2017-12-131-2/+0
| | | | llvm-svn: 320620
* Enable llvm-pdbutil to list enumerations using native PDB readerAdrian McCarthy2017-08-041-0/+4
| | | | | | | | | | | | | | | This extends the native reader to enable llvm-pdbutil to list the enums in a PDB and it includes a simple test. It does not yet list the values in the enumerations, which requires an actual implementation of NativeEnumSymbol::FindChildren. To exercise this code, use a command like: llvm-pdbutil pretty -native -enums foo.pdb Differential Revision: https://reviews.llvm.org/D35738 llvm-svn: 310144
* [codeview] Fix YAML for LF_TYPESERVER2 by hoisting PDB_UniqueIdReid Kleckner2017-07-171-2/+2
| | | | | | | | | | | | | | | | | | 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 llvm-svn: 308234
* [PDB] Enable NativeSession to create symbols for built-in types on demandAdrian McCarthy2017-07-121-1/+1
| | | | | | | | | | | | | | | | Summary: There is a reserved range of type indexes for built-in types (like integers). This will create a symbol for a built-in type if the caller askes for one by type index. This is also plumbing for being able to recall symbols by type index in general, but user-defined types will come in subsequent patches. Reviewers: rnk, zturner Subscribers: mgorny, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D35163 llvm-svn: 307834
* Fix build break by using llvm::make_unique instead of std::make_unique.Adrian McCarthy2017-06-221-1/+2
| | | | llvm-svn: 306043
* Add IDs and clone methods to NativeRawSymbolAdrian McCarthy2017-06-221-2/+6
| | | | | | | | | | | | All NativeRawSymbols will have a unique symbol ID (retrievable via getSymIndexId). For now, these are initialized to 0, but soon the NativeSession will be responsible for creating the raw symbols, and it will assign unique IDs. The symbol cache in the NativeSession will also require the ability to clone raw symbols, so I've provided implementations for that as well. llvm-svn: 306042
* [PDB] Don't build the entire source file list up front.Zachary Turner2017-05-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | I tried to run llvm-pdbdump on a very large (~1.5GB) PDB to try and identify show-stopping performance problems. This patch addresses the first such problem. When loading the DBI stream, before anyone has even tried to access a single record, we build an in memory map of every source file for every module. In the particular PDB I was using, this was over 85 million files. Specifically, the complexity is O(m*n) where m is the number of modules and n is the average number of source files (including headers) per module. The whole reason for doing this was so that we could have constant time access to any module and any of its source file lists. However, we can still get O(1) access to the source file list for a given module with a simple O(m) precomputation, and access to the list of modules is already O(1) anyway. So this patches reduces the O(m*n) up-front precomputation to an O(m) one, where n is ~6,500 and n*m is about 85 million in my pathological test case. Differential Revision: https://reviews.llvm.org/D32870 llvm-svn: 302205
* Re-land: "Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]"Adrian McCarthy2017-03-291-0/+79
| | | | | | | | | | | | | | 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
* Somehow this still breaks because of ANSI color codes in test output on Linux.Adrian McCarthy2017-03-231-79/+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
* Re-land: Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]Adrian McCarthy2017-03-231-0/+79
| | | | | | | | | | | | | | 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
* Revert "Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]"Zachary Turner2017-03-171-79/+0
| | | | | | | For some reason this is causing ANSI color codes to be printed even when run through FileCheck. llvm-svn: 298026
* Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]Adrian McCarthy2017-03-161-0/+79
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
OpenPOWER on IntegriCloud