summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [llvm] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-151-14/+14
| | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. llvm-svn: 369013
* 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] Simplify the code by replacing a few string conversions with calls to ↵Aaron Smith2018-09-281-10/+2
| | | | | | | | | | | | invokeBstrMethod() Reviewers: aleksandr.urakov, zturner, llvm-commits Reviewed By: zturner Differential Revision: https://reviews.llvm.org/D52624 llvm-svn: 343291
* [NativePDB] Add support for reading function signatures.Zachary Turner2018-09-211-1/+1
| | | | | | | This adds support for parsing function signature records and returning them through the native DIA interface. llvm-svn: 342780
* [PDB] Better printing of builtin types when using DIA dumper.Zachary Turner2018-09-201-2/+2
| | | | llvm-svn: 342658
* [PDB] Better support for enumerating pointer types.Zachary Turner2018-09-181-7/+33
| | | | | | | | | | | | | | | | | | | 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-171-2/+15
| | | | | | | | | | | 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
* Re-run clang-format on one file.Zachary Turner2018-09-101-133/+184
| | | | | | | | | clang-format was getting confused due to the presence of a macro invocation that was not terminated by a semicolon. Fixed this by terminating the macro lines with semicolons and re-ran clang-format on the file. llvm-svn: 341864
* [PDB] Change uint32_t to SymIndex wherever it makes sense.Zachary Turner2018-09-101-12/+12
| | | | | | Although it's just a typedef, it helps for readability. NFC. llvm-svn: 341863
* [PDB] Support pointer types in the native reader.Zachary Turner2018-09-071-184/+124
| | | | | | | | | | 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] Refactor the PDB symbol classes to fix a reuse bug.Zachary Turner2018-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | 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
* [DebugInfoPDB] Print the method name along with the variant valueAaron Smith2018-03-261-1/+1
| | | | | | | | | | | | | | | Before this change, using dumpProperties() with PDBSymbolData would look like this: get_locationType: 3 1 After this change: get_locationType: 3 get_value: 1 llvm-svn: 328590
* [DebugInfoPDB] Add DIA implementation for getSrcLineOnTypeDefnAaron Smith2018-03-071-0/+10
| | | | | | | | | | | | | | Summary: This helps to determine the line number for a PDB type with definition Reviewers: zturner, llvm-commits, rnk Reviewed By: zturner Subscribers: rengolin, JDevlieghere Differential Revision: https://reviews.llvm.org/D44119 llvm-svn: 326857
* [PDB] Fix buildbot failure from missing include for DIAEnumLineNumbersAaron Smith2018-02-221-0/+1
| | | | llvm-svn: 325826
* [PDB] Implement more find methods for PDB symbolsAaron Smith2018-02-221-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add additional find methods on PDB raw symbols. findChildrenByAddr() findChildrenByVA() findInlineFramesByAddr() findInlineFramesByVA() findInlineLines() findInlineLinesByAddr() findInlineLinesByRVA() findInlineLinesByVA() Reviewers: zturner, llvm-commits Reviewed By: zturner Differential Revision: https://reviews.llvm.org/D43637 llvm-svn: 325824
* [DebugInfo/PDB] Adding getUndecoratedNameEx and IPDB interfaces for ↵Aaron Smith2017-11-161-0/+14
| | | | | | | | | | | 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
* [codeview] Fix YAML for LF_TYPESERVER2 by hoisting PDB_UniqueIdReid Kleckner2017-07-171-6/+6
| | | | | | | | | | | | | | | | | | 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] Don't crash on /debug:fastlink PDBs.Zachary Turner2017-06-081-2/+5
| | | | | | | | | | Apparently support for /debug:fastlink PDBs isn't part of the DIA SDK (!), and it was causing llvm-pdbdump to crash because we weren't checking for a null pointer return value. This manifests when calling findChildren on the IDiaSymbol, and it returns E_NOTIMPL. llvm-svn: 304982
* [llvm-pdbdump] Re-write the record layout code to be more resilient.Zachary Turner2017-04-241-2/+3
| | | | | | | | 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-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Properly parse the TypeServer2 record.Zachary Turner2017-02-031-3/+5
| | | | llvm-svn: 294046
* [codeview] Add support for new type records.Zachary Turner2016-05-241-7/+7
| | | | | | | | | | | | | | | | | | | This adds support for parsing and dumping the following symbol types: S_LPROCREF S_ENVBLOCK S_COMPILE2 S_REGISTER S_COFFGROUP S_SECTION S_THUNK32 S_TRAMPOLINE As of this patch, the test PDB files no longer have any unknown symbol types. llvm-svn: 270628
* Move pdb code into pdb namespace.Zachary Turner2016-05-041-0/+1
| | | | llvm-svn: 268544
* Unbreak building llvm-pdbdump on Windows after r266595.Nico Weber2016-04-181-1/+2
| | | | llvm-svn: 266612
* [DebugInfoPDB] Teach Variant to support string types.Zachary Turner2016-02-171-11/+22
| | | | | | | | | | The IDiaSymbol::getValue() method returns a variant. Until now, I had never encountered a string value, so the Variant wrapper did not support VT_BSTR. Now we have need to support string values, so this patch just adds support for one extra type to Variant. llvm-svn: 261152
* [llvm-pdbdump] Very minor code cleanup.Zachary Turner2015-02-231-2/+1
| | | | | | | This just removes some dead enums as well as some debug flushes of stdout. llvm-svn: 230204
* [llvm-pdbdump] Add an option to dump full class definitions.Zachary Turner2015-02-231-4/+6
| | | | | | | | | | | 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: Add flags controlling the type of values to dump.Zachary Turner2015-02-151-2/+2
| | | | llvm-svn: 229330
* Re-sort #include lines using my handy dandy ./utils/sort_includes.pyChandler Carruth2015-02-131-1/+1
| | | | | | script. This is in preparation for changes to lots of include lines. llvm-svn: 229088
* llvm-pdbdump: Add more comprehensive dumping of symbol types.Zachary Turner2015-02-131-3/+3
| | | | | | | | | In particular this patch adds the ability to dump complete function signature information including argument types as correctly formatted strings. A side effect of this is that almost all symbol and meta types are now formatted. llvm-svn: 229076
* Improve llvm-pdbdump output display.Zachary Turner2015-02-131-0/+86
| | | | | | | | | | | | This patch adds a number of improvements to llvm-pdbdump. 1) Dumping of the entire global scope, and not only those symbols that live in individual compilands. 2) Prepend class name to member functions and data 3) Improved display of bitfields. 4) Support for dumping more kinds of data symbols. llvm-svn: 229012
* Temporary workaround to fix MSVC 2012 build problemsAndrew Kaylor2015-02-111-1/+11
| | | | llvm-svn: 228788
* Convert std::make_unique<> to llvm::make_unique<>.Zachary Turner2015-02-101-4/+5
| | | | llvm-svn: 228768
* Rewrite llvm-pdbdump in terms of LLVMDebugInfoPDB.Zachary Turner2015-02-101-8/+229
| | | | | | | | | | | | | 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/+776
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