summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [DebugInfoPDB] Add DIA implementations of findSymbolByRVA and findSymbolByAddrAaron Smith2018-04-101-9/+30
| | | | llvm-svn: 329724
* [DebugInfoPDB] Add DIA implementation of findLineNumbersByRVAAaron Smith2018-03-261-0/+9
| | | | | | | This method is used to find line numbers for PDBSymbolData that have an invalid virtual address. llvm-svn: 328586
* [DebugInfoPDB] Add DIA implementation of addressForVA and addressForRVAAaron Smith2018-03-261-0/+22
| | | | | | These are used in finding line numbers for PDBSymbolData llvm-svn: 328585
* [DIA] Add IPDBSectionContrib interfaces and DIA implementationAaron Smith2018-03-221-0/+11
| | | | | | | | | | | | | | | | | | | | | To resolve symbol context at a particular address, we need to determine the compiland for the address. We are able to determine the parent compiland of PDBSymbolFunc, PDBSymbolTypeUDT, PDBSymbolTypeEnum symbols indirectly through line information. However no such information is availabile for PDBSymbolData, i.e. variables. The Section Contribution table from PDBs has information about each compiland's contribution to sections by address. For example, a piece of a contribution looks like, VA RelativeVA Sect No. Offset Length Compiland 14000087B0 000087B0 0001 000077B0 000000BB exe_main.obj So given an address, it's possible to determine its compiland with this information. llvm-svn: 328178
* [PDB] Get more DIA table enumeratorsAaron Smith2018-03-221-6/+8
| | | | | | Rename the original function and make it a static template. llvm-svn: 328177
* [DebugInfo] Add a new method IPDBSession::findLineNumbersBySectOffsetAaron Smith2018-03-151-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Some PDB symbols do not have a valid VA or RVA but have Addr by Section and Offset. For example, a variable in thread-local storage has the following properties: get_addressOffset: 0 get_addressSection: 5 get_lexicalParentId: 2 get_name: g_tls get_symIndexId: 12 get_typeId: 4 get_dataKind: 6 get_symTag: 7 get_locationType: 2 This change provides a new method to locate line numbers by Section and Offset from those symbols. Reviewers: zturner, rnk, llvm-commits Subscribers: asmith, JDevlieghere Differential Revision: https://reviews.llvm.org/D44407 llvm-svn: 327601
* [PDB] Support dumping injected sources via the DIA reader.Zachary Turner2018-03-131-0/+29
| | | | | | | | | | | | | | | | | | Injected sources are basically a way to add actual source file content to your PDB. Presumably you could use this for shipping your source code with your debug information, but in practice I can only find this being used for embedding natvis files inside of PDBs. In order to effectively test LLVM's natvis file injection, we need a way to dump the injected sources of a PDB in a way that is authoritative (i.e. based on Microsoft's understanding of the PDB format, and not LLVM's). To this end, I've added support for dumping injected sources via DIA. I made a PDB file that used the /natvis option to generate a test case. Differential Revision: https://reviews.llvm.org/D44405 llvm-svn: 327428
* [PDB] Check the result of setLoadAddress()Aaron Smith2018-02-231-2/+2
| | | | | | | | | | | | Summary: Change setLoadAddress() to return true or false on failure. Reviewers: zturner, llvm-commits Reviewed By: zturner Differential Revision: https://reviews.llvm.org/D43638 llvm-svn: 325843
* [DebugInfo/PDB] Adding getUndecoratedNameEx and IPDB interfaces for ↵Aaron Smith2017-11-161-0/+9
| | | | | | | | | | | IDiaEnumTables and IDiaTable. Initial changes to support debugging PE/COFF files with LLDB on Windows through DIA SDK. There is another set of changes required on the LLDB side before this does anything. Differential Revision: https://reviews.llvm.org/D39517 llvm-svn: 318403
* Make IPDBSession::getGlobalScope a non-const methodAdrian McCarthy2017-06-221-1/+1
| | | | | | | | | | | | There doesn't seem to be a compelling reason why this method should be const other than it was possible with the DIA implementation. The native session is going to act as a symbol factory and cache. This could be acheived with mutable (and the existing const_cast), but it seems cleaner to accept that this method affects the state of the session. This change eliminates an existing const_cast. llvm-svn: 306041
* [llvm-pdbdump] Re-write the record layout code to be more resilient.Zachary Turner2017-04-241-3/+14
| | | | | | | | This reworks the way virtual bases are handled, and also the way padding is detected across multiple levels of aggregates, producing a much more accurate result. llvm-svn: 301203
* [llvm-pdbdump] More advanced class definition dumping.Zachary Turner2017-04-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Implement some methods for NativeRawSymbolAdrian McCarthy2017-02-241-1/+1
| | | | | | | | | | | This allows the ability to call IPDBSession::getGlobalScope with a NativeSession and to then query it for some basic fields from the PDB's InfoStream. Note that the symbols now have non-const references back to the Session so that NativeRawSymbol can access the PDBFile through the Session. Differential Revision: https://reviews.llvm.org/D30314 llvm-svn: 296049
* [pdb] Improve error messages when DIA is not found.Zachary Turner2016-10-191-13/+20
| | | | llvm-svn: 284610
* Update _MSC_VER equality checks for msdiaNNN.dllReid Kleckner2016-10-121-10/+6
| | | | | | | | | Use inequality instead of equality to defend against minor version increases in _MSC_VER. An _MSC_VER value of 1901 should still use msdia140.dll, as described in this blog post: https://blogs.msdn.microsoft.com/vcblog/2016/10/05/visual-c-compiler-version/ llvm-svn: 284058
* Port DebugInfoPDB over to using llvm::Error.Zachary Turner2016-05-061-69/+56
| | | | | | | Differential Revision: http://reviews.llvm.org/D19940 Reviewed By: rnk llvm-svn: 268791
* Move pdb code into pdb namespace.Zachary Turner2016-05-041-0/+1
| | | | llvm-svn: 268544
* [llvm-pdbdump] Print a better error message when PDB loading fails.Zachary Turner2016-04-191-12/+17
| | | | | | Differential Revision: http://reviews.llvm.org/D19234 llvm-svn: 266772
* Make DIASession work if msdia*.dll isn't registered.Nico Weber2016-04-011-9/+34
| | | | | | | | | This fixes various symbolization test failures for me when I build with a hermetic VS2015 without having run the 2015 installer. http://reviews.llvm.org/D18707 llvm-svn: 265193
* [DebugInfoPDB] Add source / line number accessors for PDB.Zachary Turner2016-02-181-0/+66
| | | | | | | This patch adds a variety of different methods to query source and line number information from PDB files. llvm-svn: 261239
* [llvm-pdbdump] Support dynamic load address and external symbols.Zachary Turner2015-05-011-3/+11
| | | | | | | | | | | This patch adds the --load-address command line option to llvm-pdbdump, which dumps all addresses assuming the module has loaded at the specified address. Additionally, this patch adds an option to llvm-pdbdump to support dumping of public symbols (i.e. symbols with external linkage). llvm-svn: 236342
* [PDB] Support executables and source/line info.Zachary Turner2015-04-171-0/+63
| | | | | | | | | | | | Previously DebugInfoPDB could only load data for a PDB given a path to the PDB. It could not open an EXE and find the matching PDB and verify it matched, etc. This patch adds support for that so that we can simply load debug information for a PDB directly. Additionally, this patch extends DebugInfoPDB to support getting source and line information for symbols. llvm-svn: 235237
* [llvm-pdbdump] Better error handling.Zachary Turner2015-02-281-14/+31
| | | | | | | | | | | | | Previously it was impossible to distinguish between "There is no PDB implementation for this platform" and "I tried to load the PDB, but couldn't find the file", making it hard to figure out if you built llvm-pdbdump incorrectly or if you just mistyped a file name. This patch adds proper error handling so that we can know exactly what went wrong. llvm-svn: 230868
* Re-sort #include lines using my handy dandy ./utils/sort_includes.pyChandler Carruth2015-02-131-3/+2
| | | | | | script. This is in preparation for changes to lots of include lines. llvm-svn: 229088
* Convert std::make_unique<> to llvm::make_unique<>.Zachary Turner2015-02-101-7/+7
| | | | llvm-svn: 228768
* Rewrite llvm-pdbdump in terms of LLVMDebugInfoPDB.Zachary Turner2015-02-101-1/+25
| | | | | | | | | | | | | This makes llvm-pdbdump available on all platforms, although it will currently fail to create a dumper if there is no PDB reader implementation for the current platform. It implements dumping of compilands and children, which is less information than was previously available, but it has to be rewritten from scratch using the new set of interfaces, so the rest of the functionality will be added back in subsequent commits. llvm-svn: 228755
* Provide DIA implementation of DebugInfoPDB.Zachary Turner2015-02-101-0/+94
This implements DebugInfoPDB when the DIA SDK is present on the system. Specifically, this means that the following conditions are met: 1) You are building on Windows. 2) You are building with MSVC. 3) Visual Studio did not corrupt the installation of DIA due to a known issue with side-by-side installations of VS2012 and VS2013. If all of these conditions are true, you will be able to pass a value of PDB_Reader::DIA to PDB::createPdbReader(). There are no tests for this yet, as any test will be in the form of a lit test which tests the llvm-pdbdump.exe, which still needs to be rewritten in terms of this library. llvm-svn: 228747
OpenPOWER on IntegriCloud