summaryrefslogtreecommitdiffstats
path: root/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [lldb] Fix windows build after getASTContext() changeRaphael Isemann2019-12-211-3/+2
|
* [lldb] Fix windows build for 38870afPavel Labath2019-11-291-1/+1
|
* Adapt Windows test to API change.Adrian Prantl2019-10-171-3/+2
| | | | llvm-svn: 375170
* Make yet another attempt in restoring SymbolFilePDBTestsAdrian Prantl2019-10-021-13/+13
| | | | | | | | The original test was passing false to the append argument of FindTypes (the only use of this feature!). This patch now replicates that by passing a fresh TypeMap into the function where applicable. llvm-svn: 373409
* Make another attempt at fixing SymbolFilePDBTests.Adrian Prantl2019-10-011-0/+1
| | | | llvm-svn: 373373
* Fix a syntax error.Adrian Prantl2019-10-011-1/+1
| | | | llvm-svn: 373355
* Remove size_t return parameter from FindTypesAdrian Prantl2019-10-011-15/+12
| | | | | | | | | | | | | | | In r368345 I accidentally introduced a regression that would over-report the number of matches found by FindTypes if the DeclContext Filter was hit. This patch simply removes the size_t return parameter altogether — it's not that useful. rdar://problem/55500457 Differential Revision: https://reviews.llvm.org/D68169 llvm-svn: 373344
* Try to update Windows unit test for API change.Adrian Prantl2019-09-301-21/+18
| | | | llvm-svn: 373250
* [LLDB] Check for _WIN32 instead of _MSC_VER for code specific to windows in ↵Martin Storsjo2019-09-231-3/+3
| | | | | | | | | | | general These ifdefs contain code that isn't specific to MSVC but useful for any windows target, like MinGW. Differential Revision: https://reviews.llvm.org/D67893 llvm-svn: 372592
* Add a missing include to SymbolFilePDBTests.cppPavel Labath2019-08-081-0/+1
| | | | | | This should _really_ fix the pdb unit tests. llvm-svn: 368271
* Fix PDB unit tests for the GetSymbolVendor deletionPavel Labath2019-08-081-36/+15
| | | | llvm-svn: 368265
* Add missing includes to SymbolFilePDBTestsPavel Labath2019-07-311-0/+1
| | | | | | These became needed after r367368. llvm-svn: 367410
* [SymbolFilePDB] Fix windows bots after rL367360Alex Langford2019-07-301-4/+12
| | | | | | | | SymbolFilePDB tests were using GetTypeSystemForLanguage but weren't changed to accomodate the use of an llvm::Expected. I adjusted them accordingly. llvm-svn: 367368
* 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
* [SymbolFile] Remove SymbolContext parameter from FindTypes.Zachary Turner2019-01-141-20/+13
| | | | | | | | | | | | | | This parameter was only ever used with the Module set, and since a SymbolFile is tied to a module, the parameter turns out to be entirely unnecessary. Furthermore, it doesn't make a lot of sense to ask a caller to ask SymbolFile which is tied to Module X to find types for Module Y, but that possibility was open with the previous interface. By removing this parameter from the API, it makes it harder to use incorrectly as well as easier for an implementor to understand what it needs to do. llvm-svn: 351133
* [SymbolFile] Remove the SymbolContext parameter from FindNamespace.Zachary Turner2019-01-141-2/+2
| | | | | | | | | | | Every callsite was passing an empty SymbolContext, so this parameter had no effect. Inside the DWARF implementation of this function, however, there was one codepath that checked members of the SymbolContext. Since no call-sites actually ever used this functionality, it was essentially dead code, so I've deleted this code path as well. llvm-svn: 351132
* [Symbol] Search symbols with name and type in a symbol fileAleksandr Urakov2018-11-301-0/+17
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds possibility of searching a public symbol with name and type in a symbol file, not only in a symtab. It is helpful when working with PE, because PE's symtabs contain only imported / exported symbols only. Such a search is required for e.g. evaluation of an expression that calls some function of the debuggee. Reviewers: zturner, asmith, labath, clayborg, espindola Reviewed By: clayborg Subscribers: davide, emaste, arichardson, aleksandr.urakov, jingham, lldb-commits, stella.stamenova Tags: #lldb Differential Revision: https://reviews.llvm.org/D53368 llvm-svn: 347960
* Fix some windows-specific fallout from the FileSpec change.Zachary Turner2018-11-031-30/+29
| | | | llvm-svn: 346058
* Revert "[Symbol] Search symbols with name and type in a symbol file"Davide Italiano2018-11-021-17/+0
| | | | | | It broke MacOS buildbots. llvm-svn: 346045
* [Symbol] Search symbols with name and type in a symbol fileAleksandr Urakov2018-11-021-0/+17
| | | | | | | | | | | | | | | | | | | | Summary: This patch adds possibility of searching a public symbol with name and type in a symbol file. It is helpful when working with PE, because PE's symtabs contain only imported / exported symbols only. Such a search is required for e.g. evaluation of an expression that calls some function of the debuggee. Reviewers: zturner, asmith, labath, clayborg, espindola Reviewed By: clayborg Subscribers: emaste, arichardson, aleksandr.urakov, jingham, lldb-commits, stella.stamenova Tags: #lldb Differential Revision: https://reviews.llvm.org/D53368 llvm-svn: 345957
* [FileSystem] Extend file system and have it use the VFS.Jonas Devlieghere2018-10-311-0/+3
| | | | | | | | | | | | | | | | This patch extends the FileSystem class with a bunch of functions that are currently implemented as methods of the FileSpec class. These methods will be removed in future commits and replaced by calls to the file system. The new functions are operated in terms of the virtual file system which was recently moved from clang into LLVM so it could be reused in lldb. Because the VFS is stateful, we turned the FileSystem class into a singleton. Differential revision: https://reviews.llvm.org/D53532 llvm-svn: 345783
* [PDB] Fix `SymbolFilePDBTests` after r345313Aleksandr Urakov2018-10-261-2/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D53749 llvm-svn: 345374
* [PDB] Test variadic function type in PDBAaron Smith2018-10-191-6/+7
| | | | | | This adds back the test case reverted in commit: d260a269200824c5c1c8c6de531fd5aa63db9c35 llvm-svn: 344809
* [PDB] Fix problems after rL341782Aleksandr Urakov2018-09-111-5/+53
| | | | | | | | | | | | | Summary: This commit fixes following problems after rL341782: - Broken SymbolFilePDBTests - Warning on comparison of integers of different signs Tags: #lldb Differential Revision: https://reviews.llvm.org/D51162 llvm-svn: 341942
* Revert "PDB support of function-level linking and splitted functions"Pavel Labath2018-06-061-56/+0
| | | | | | This reverts commit r334030 because it adds a broken test. llvm-svn: 334076
* PDB support of function-level linking and splitted functionsAaron Smith2018-06-051-0/+56
| | | | | | | | | | | | | | | | | | | Summary: The patch adds support of splitted functions (when MSVC is used with PGO) and function-level linking feature. SymbolFilePDB::ParseCompileUnitLineTable function relies on fact that ranges of compiled source files in the binary are continuous and don't intersect each other. The function creates LineSequence for each file and inserts it into LineTable, and implementation of last one relies on continuity of the sequence. But it's not always true when function-level linking enabled, e.g. in added input test file test-pdb-function-level-linking.exe there is xstring's std__basic_string_char_std__char_traits_char__std__allocator_char_____max_size (.00454820) between test-pdb-function-level-linking.cpp's foo (.00454770) and main (.004548F0). To fix the problem this patch renews the sequence on each address gap. Reviewers: asmith, zturner Reviewed By: asmith Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D47708 llvm-svn: 334030
* Revert "[SymbolFilePDB] Fix null array access when parsing the type of a ↵Pavel Labath2018-01-221-4/+1
| | | | | | | | | | function without any arguments, i.e. 'int main()' and add support to test it" This reverts commit r322995, as it breaks lldb-Unit::SymbolFilePDBTests.TestTypedefs <http://lab.llvm.org:8011/builders/lldb-windows7-android/builds/7715>. llvm-svn: 323102
* [SymbolFilePDB] Fix null array access when parsing the type of a function ↵Aaron Smith2018-01-191-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | without any arguments, i.e. 'int main()' and add support to test it Summary: - Fix a null array access bug. This happens when creating the lldb type for a function that has no argument. - Implement SymbolFilePDB::ParseTypes method. Using `lldb-test symbols` will show all supported types in the target. - Create lldb types for variadic function, PDBSymbolTypePointer, PDBSymbolTypeBuiltin - The underlying builtin type for PDBSymbolTypeEnum is always `Int`, correct it with the very first enumerator's encoding if any. This is more accurate when the underlying type is not signed or another integer type. - Fix a bug when the compiler type is not created based on PDB_BuiltinType. For example, basic type `long` is of same width as `int` in a 32-bit target, and the compiler type of former one will be represented by the one generated for latter if using the default method. Introduce a static function GetBuiltinTypeForPDBEncodingAndBitSize to correct this issue. - Basic type `long double` and `double` have the same bit size in MSVC and there is no information in a PDB to distinguish them. The compiler type of the former one is represented by the latter's. - There is no line informaton about typedef, enum etc in a PDB and the source and line information for them are not shown. - There is no information about scoped enumeration. The compiler type is represented as an unscoped one. Reviewers: zturner, lldb-commits, davide, asmith Reviewed By: zturner, asmith Subscribers: llvm-commits, davide Differential Revision: https://reviews.llvm.org/D41427 llvm-svn: 322995
* Update failing PDB unit tests that are searching for symbols by regexAaron Smith2017-12-281-12/+8
| | | | | | | | | | | | Summary: D41086 fixed an exception in FindTypes()/FindTypesByRegex() and caused two lldb unit test to fail. This change updates the unit tests to pass again. Reviewers: zturner, lldb-commits, labath, clayborg, asmith Reviewed By: asmith Differential Revision: https://reviews.llvm.org/D41550 llvm-svn: 321511
* [lldb] Stop searching for a symbol in a pdb by regexAaron Smith2017-12-221-0/+7
| | | | | | | | | | | | | | | | | Summary: It was possible when searching for a symbol by regex in a pdb that an invalid regex would cause an exception on Windows. This updates the code to avoid throwing an exception. When fixing the exception it was decided there is no reason to search for a symbol in a pdb by regex. To support this, SymbolFilePDB::FindTypes() now only searches for types by name and no longer calls FindTypesByRegEx(). Reviewers: zturner, lldb-commits Reviewed By: zturner Subscribers: clayborg Differential Revision: https://reviews.llvm.org/D41086 llvm-svn: 321344
* Enable more abilities in SymbolFilePDBAaron Smith2017-12-221-2/+1
| | | | | | | | | | | | | | | | Summary: 1) Finding symbols through --symfile 2) More abilities: Functions, Blocks, GlobalVariables, LocalVariables, VariableTypes Reviewers: zturner, lldb-commits Reviewed By: zturner Subscribers: clayborg Differential Revision: https://reviews.llvm.org/D41092 llvm-svn: 321327
* Fix netbsd, freebsd and osx builds for ArchSpec movePavel Labath2017-11-131-2/+2
| | | | llvm-svn: 318052
* cmake + xcode: prevent gtests from using includes from project rootTim Hammerquist2017-10-031-1/+1
| | | | | | | | | | | | | | | | | | | | | Summary: At present, several gtests in the lldb open source codebase are using #include statements rooted at $(SOURCE_ROOT)/${LLDB_PROJECT_ROOT}. This patch cleans up this directory/include structure for both CMake and Xcode build systems. rdar://problem/33835795 Reviewers: zturner, jingham, beanz Reviewed By: beanz Subscribers: emaste, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D36598 llvm-svn: 314849
* Speculative fix for windows build broken by r306668Pavel Labath2017-06-291-6/+2
| | | | llvm-svn: 306693
* [unittests] Add a helper function for getting an input filePavel Labath2017-06-291-12/+8
| | | | | | | | | | | | | | | | | Summary: Fetching an input file required about five lines of code, and this was repeated in multiple unit tests, with slight variations. Add a helper function for doing that into the lldbUtilityMocks module (which I rename to lldbUtilityHelpers to commemorate the fact it includes more than mocks) Reviewers: zturner, eugene Subscribers: emaste, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D34683 llvm-svn: 306668
* Move FileSpec from Host -> Utility.Zachary Turner2017-03-221-1/+1
| | | | llvm-svn: 298536
* Attempt to fix windows unit testsPavel Labath2017-02-241-6/+6
| | | | | | | In LLVM r296049, IPDBSession::getGlobalScope lost its constness. Adjust the unittest to account for that. llvm-svn: 296107
* [unittests] Split DWARF tests out of PDB, fix standalone buildMichal Gorny2017-01-021-44/+17
| | | | | | | | | | | | Split the PDB tests into DWARF test and actual PDB tests, the latter requiring DIA SDK. Use the new LLVMConfig.cmake LLVM_ENABLE_DIA_SDK symbol to enable the PDB tests rather than relying on llvm/Config/config.h private include file that is not available when building standalone. Differential Revision: https://reviews.llvm.org/D26249 llvm-svn: 290819
* Fix Clang-tidy readability-redundant-string-cstr warningsMalcolm Parsons2016-11-021-2/+2
| | | | | | | | | | Reviewers: zturner, labath Subscribers: tberghammer, danalbert, lldb-commits Differential Revision: https://reviews.llvm.org/D26233 llvm-svn: 285855
* unittests: Specify types in a bunch of unittest EXPECT'sJustin Bogner2016-10-171-4/+4
| | | | | | | The EXPECT and ASSERT macros in gtest don't do the usual arithmetic conversions. Specify types in several of them to fix -Werror. llvm-svn: 284405
* Fix PDB unittests on non-windows platformsPavel Labath2016-09-301-1/+1
| | | | | | | llvm r282788 changed how the presence of windows DIA SDK is signalled. Adjust to that. llvm-svn: 282848
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-478/+497
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* Fix SymbolFilePDBTests.cppPavel Labath2016-05-101-14/+15
| | | | llvm-svn: 269057
* Fix compiler warnings in SymbolFilePDBTestsPavel Labath2016-04-271-20/+20
| | | | llvm-svn: 267688
* Initial support for reading type information from PDBs.Zachary Turner2016-04-151-4/+242
| | | | | | | | | | | | | | | | This implements a PDBASTParser and corresponding logic in SymbolFilePDB to do type lookup by name. This is just a first pass and leaves many aspects of type lookup unimplemented, and just focuses on laying the framework. With this patch, you should be able to lookup basic types by name from a PDB. Full class definitions are not completed yet, we will instead just return a forward declaration of the class. Differential Revision: http://reviews.llvm.org/D18848 Reviewed by: Greg Clayton llvm-svn: 266392
* Fix a bunch of signedness warnings in unittestsPavel Labath2016-03-111-13/+13
| | | | llvm-svn: 263209
* Add support for reading line tables from PDB files.Zachary Turner2016-03-021-0/+344
PDB is Microsoft's debug information format, and although we cannot yet generate it, we still must be able to consume it. Reason for this is that debug information for system libraries (e.g. kernel32, C Runtime Library, etc) only have debug info in PDB format, so in order to be able to support debugging of system code, we must support it. Currently this code should compile on every platform, but on non-Windows platforms the PDB plugin will return 0 capabilities, meaning that for now PDB is only supported on Windows. This may change in the future, but the API is designed in such a way that this will require few (if any) changes on the LLDB side. In the future we can just flip a switch and everything will work. This patch only adds support for line tables. It does not return information about functions, types, global variables, or anything else. This functionality will be added in a followup patch. Differential Revision: http://reviews.llvm.org/D17363 Reviewed by: Greg Clayton llvm-svn: 262528
OpenPOWER on IntegriCloud