summaryrefslogtreecommitdiffstats
path: root/lldb/lit/SymbolFile/PDB/Inputs
Commit message (Collapse)AuthorAgeFilesLines
* Re-land "[test] Split LLDB tests into API, Shell & Unit"Jonas Devlieghere2019-10-0924-637/+0
| | | | | | | The original patch got reverted because it broke `check-lldb` on a clean build. This fixes that. llvm-svn: 374201
* Revert [test] Split LLDB tests into API, Shell & UnitAdrian Prantl2019-10-0924-0/+637
| | | | | | | | as it appears to have broken check-lldb. This reverts r374184 (git commit 22314179f0660c172514b397060fd8f34b586e82) llvm-svn: 374187
* [test] Split LLDB tests into API, Shell & UnitJonas Devlieghere2019-10-0924-637/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LLDB has three major testing strategies: unit tests, tests that exercise the SB API though dotest.py and what we currently call lit tests. The later is rather confusing as we're now using lit as the driver for all three types of tests. As most of this grew organically, the directory structure in the LLDB repository doesn't really make this clear. The 'lit' tests are part of the root and among these tests there's a Unit and Suite folder for the unit and dotest-tests. This layout makes it impossible to run just the lit tests. This patch changes the directory layout to match the 3 testing strategies, each with their own directory and their own configuration file. This means there are now 3 directories under lit with 3 corresponding targets: - API (check-lldb-api): Test exercising the SB API. - Shell (check-lldb-shell): Test exercising command line utilities. - Unit (check-lldb-unit): Unit tests. Finally, there's still the `check-lldb` target that runs all three test suites. Finally, this also renames the lit folder to `test` to match the LLVM repository layout. Differential revision: https://reviews.llvm.org/D68606 llvm-svn: 374184
* [PDB] Fix location retrieval for function local variables and arguments that areAleksandr Urakov2019-02-012-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | stored relative to VFRAME Summary: This patch makes LLDB able to retrieve proper values for function arguments and local variables stored in PDB relative to VFRAME register. Patch contains retrieval of corresponding FPO table entries from PDB and a generic translator from FPO programs to DWARF expressions to get correct VFRAME value. Patch also improves variables-locations.test and makes this test passable on x86. Patch By: leonid.mashinsky Reviewers: zturner, asmith, stella.stamenova, aleksandr.urakov Reviewed By: zturner Subscribers: arphaman, labath, mgorny, aprantl, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D55122 llvm-svn: 352845
* [PDB] Support PDB-backed expressions evaluation (+ fix stuck test)Aleksandr Urakov2018-12-034-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch contains several small fixes, which makes it possible to evaluate expressions on Windows using information from PDB. The changes are: - several sanitize checks; - make IRExecutionUnit::MemoryManager::getSymbolAddress to not return a magic value on a failure, because callers wait 0 in this case; - entry point required to be a file address, not RVA, in the ObjectFilePECOFF; - do not crash on a debuggee second chance exception - it may be an expression evaluation crash. Also fix detection of "crushed" threads in tests; - create parameter declarations for functions in AST to make it possible to call debugee functions from expressions; - relax name searching rules for variables, functions, namespaces and types. Now it works just like in the DWARF plugin; - fix endless recursion in SymbolFilePDB::ParseCompileUnitFunctionForPDBFunc. Reviewers: zturner, asmith, stella.stamenova Reviewed By: stella.stamenova, asmith Tags: #lldb Differential Revision: https://reviews.llvm.org/D53759 llvm-svn: 348136
* Revert "[PDB] Support PDB-backed expressions evaluation"Stella Stamenova2018-11-304-30/+0
| | | | | | | | | This reverts commit dec87759523b2f22fcff3325bc2cd543e4cda0e7. This commit caused the tests on Windows to run forever rather than complete. Reverting until the commit can be fixed to not stall. llvm-svn: 348009
* [PDB] Support PDB-backed expressions evaluationAleksandr Urakov2018-11-304-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch contains several small fixes, which makes it possible to evaluate expressions on Windows using information from PDB. The changes are: - several sanitize checks; - make IRExecutionUnit::MemoryManager::getSymbolAddress to not return a magic value on a failure, because callers wait 0 in this case; - entry point required to be a file address, not RVA, in the ObjectFilePECOFF; - do not crash on a debuggee second chance exception - it may be an expression evaluation crash; - create parameter declarations for functions in AST to make it possible to call debugee functions from expressions; - relax name searching rules for variables, functions, namespaces and types. Now it works just like in the DWARF plugin; - fix endless recursion in SymbolFilePDB::ParseCompileUnitFunctionForPDBFunc. Reviewers: zturner, asmith, stella.stamenova Reviewed By: stella.stamenova, asmith Tags: #lldb Differential Revision: https://reviews.llvm.org/D53759 llvm-svn: 347962
* [ClangASTContext] Extract VTable pointers from C++ objectsAleksandr Urakov2018-11-122-0/+23
| | | | | | | | | | | | | | | | | | This patch processes the case of retrieving a virtual base when the object is already read from the debuggee memory. To achieve that ValueObject::GetCPPVTableAddress was removed and was reimplemented in ClangASTContext (because access to the process is needed to retrieve the VTable pointer in general, and because this is the only place that used old version of ValueObject::GetCPPVTableAddress). This patch allows to use real object's VTable instead of searching virtual bases by offsets restored by MicrosoftRecordLayoutBuilder. PDB has no enough info to restore VBase offsets properly, so we have to read real VTable instead. Differential revision: https://reviews.llvm.org/D53506 llvm-svn: 346669
* [PDB] Introduce `MSVCUndecoratedNameParser`Aleksandr Urakov2018-11-061-1/+9
| | | | | | | | | | | | This patch introduces the simple MSVCUndecoratedNameParser. It is needed for parsing names of PDB symbols corresponding to template instantiations. For example, for the name `operator<<A>'::`2'::B::operator> we can't just split the name with :: (as it is implemented for now) to retrieve its scopes. This parser processes such names in a more correct way. Differential Revision: https://reviews.llvm.org/D52461 llvm-svn: 346213
* [PDB] Handle `char` as a builtin typeAleksandr Urakov2018-09-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: `char`, `signed char` and `unsigned char` are three different types, and they are mangled differently: ``` void __declspec(dllexport) /* ?foo@@YAXD@Z */ foo(char c) { } void __declspec(dllexport) /* ?foo@@YAXE@Z */ foo(unsigned char c) { } void __declspec(dllexport) /* ?foo@@YAXC@Z */ foo(signed char c) { } ``` This commit separates `char` from `signed char` and `unsigned char`. Reviewers: asmith, zturner, labath Reviewed By: asmith, zturner Subscribers: teemperor, lldb-commits, stella.stamenova Tags: #lldb Differential Revision: https://reviews.llvm.org/D52468 llvm-svn: 343298
* [PDB] Restore the calling convention from PDBAleksandr Urakov2018-09-261-0/+20
| | | | | | | | | | | | | | | | | | | Summary: This patch implements restoring of the calling convention from PDB. It is necessary for expressions evaluation, if we want to call a function of the debuggee process with a calling convention other than ccall. Reviewers: clayborg, zturner, labath, asmith Reviewed By: clayborg Subscribers: teemperor, lldb-commits, stella.stamenova Tags: #lldb Differential Revision: https://reviews.llvm.org/D52501 llvm-svn: 343084
* [PDB] Restore AST from PDB symbolsAleksandr Urakov2018-09-101-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds an implementation of retrieving of declarations and declaration contexts based on PDB symbols. PDB has different type symbols for const-qualified types, and this implementation ensures that only one declaration was created for both const and non-const types, but creates different compiler types for them. The implementation also processes the case when there are two symbols corresponding to a variable. It's possible e.g. for class static variables, they has one global symbol and one symbol belonging to a class. PDB has no info about namespaces, so this implementation parses the full symbol name and tries to figure out if the symbol belongs to namespace or not, and then creates nested namespaces if necessary. Reviewers: asmith, zturner, labath Reviewed By: asmith Subscribers: aleksandr.urakov, teemperor, lldb-commits, stella.stamenova Tags: #lldb Differential Revision: https://reviews.llvm.org/D51162 llvm-svn: 341782
* [PDB] Parse UDT symbols and pointers to members (combined patch)Aleksandr Urakov2018-08-144-0/+199
| | | | | | | | | | | | | | | | | | | | | | Summary: In this patch I've tried to combine the best ideas from D49368 and D49410, so it implements following: - Completion of UDTs from a PDB with a filling of a layout info; - Pointers to members; - Fixes the bug relating to a virtual base offset reading from `vbtable`. The offset was treated as an unsigned, but it can be a negative sometimes. - Support of MSInheritance attribute Reviewers: asmith, zturner, rnk, labath, clayborg, lldb-commits Reviewed By: zturner Subscribers: aleksandr.urakov, stella.stamenova, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D49980 llvm-svn: 339649
* Convert a location information from PDB to a DWARF expressionJonas Devlieghere2018-07-132-0/+31
| | | | | | | | | | | | | | | | | | The current version of SymbolFilePDB::ParseVariableForPDBData function always initializes variables with an empty location. This patch adds the converter of a location information from PDB to a DWARF expression, so it becomes possible to watch values of variables of primitive data types. At the moment the converter supports only Static, TLS, RegRel, Enregistered and Constant PDB location types, but it seems that it's enough for most cases. There are still some problems with retrieving values of variables (e.g. we can't watch variables of composite types), but they look not relevant to the conversion to DWARF. Patch by: Aleksandr Urakov Differential revision: https://reviews.llvm.org/D49018 llvm-svn: 336988
* Retrieve a function PDB symbol correctly from nested blocksPavel Labath2018-06-281-0/+8
| | | | | | | | | | | | | | | | | | | Summary: This patch fixes a problem with retrieving a function symbol by an address in a nested block. In the current implementation of ResolveSymbolContext function it retrieves a symbol with PDB_SymType::None and then checks if found symbol's tag equals to PDB_SymType::Function. So, if nested block's symbol was found, ResolveSymbolContext does not resolve a function. Reviewers: asmith, labath, zturner Reviewed By: asmith, labath Differential Revision: https://reviews.llvm.org/D47939 Patch by Aleksandr Urakov <aleksandr.urakov@jetbrains.com> llvm-svn: 335822
* PDB support of function-level linking and splitted functionsAaron Smith2018-06-083-0/+25
| | | | | | | | | | | | | | | | | | | 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: aleksandr.urakov, labath, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D47708 llvm-svn: 334260
* [SymbolFilePDB] Add a test for wchar_t type in PDB.Aaron Smith2018-05-231-0/+3
| | | | | | | | The wchar_t is unsigned. https://msdn.microsoft.com/en-us/library/s3f49ktz.aspx llvm-svn: 333051
* [SymbolFilePDB] Add support for resolving variable symbolsAaron Smith2018-05-231-0/+50
| | | | | | | | | | | | | | | | | Summary: Implement FindGlobalVariables and ParseVariableContext methods. Compile unit information is necessary for resolving variable context, however some PDB symbols do not have this information. For now an empty DWARFExpression is used to construct a lldb::Variable instance with the limitation that using lldb to lookup the value of a global or local variable is not available. This commit may slow down lit/SymbolFile/PDB/compilands.test since the test includes MS specific modules that spend more time parsing variables. Reviewers: rnk, zturner, lldb-commits Subscribers: aprantl, JDevlieghere, llvm-commits Differential Revision: https://reviews.llvm.org/D45224 llvm-svn: 333049
* [SymbolFilePDB] Add missing Char16 and Char32 types in a few placesAaron Smith2018-03-071-0/+6
| | | | | | | | | | Reviewers: zturner, rnk, lldb-commits Subscribers: clayborg, llvm-commits Differential Revision: https://reviews.llvm.org/D44166 llvm-svn: 326875
* [SymbolFilePDB] Add support for CVR pointer type qualifierAaron Smith2018-03-071-0/+46
| | | | | | | | | | | | | | | | | Summary: - Complete element type of PDBSymbolTypeArray. - Add a test to check types of multi-dimensional array and pointers with CVR. Reviewers: zturner, rnk, lldb-commits Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44167 llvm-svn: 326859
* [SymbolFilePDB] Add support for function symbolsAaron Smith2018-02-093-1/+76
| | | | | | | | | | | | | | | | | | | | | | | Summary: This is combination of following changes, - Resolve function symbols in PDB symbol file. `lldb-test symbols` will display information about function symbols. - Implement SymbolFilePDB::FindFunctions methods. On lldb console, searching function symbol by name and by regular expression are both available. - Create lldb type for PDBSymbolFunc. - Add tests to check whether functions with the same name but from different sources can be resolved correctly. Reviewers: zturner, lldb-commits Reviewed By: zturner Subscribers: amccarth, labath, llvm-commits Differential Revision: https://reviews.llvm.org/D42443 llvm-svn: 324707
* [SymbolFilePDB] Fix null array access when parsing the type of a function ↵Aaron Smith2018-01-231-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | 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 information 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 Reviewed By: zturner Subscribers: majnemer, llvm-commits Differential Revision: https://reviews.llvm.org/D42434 llvm-svn: 323255
* Revert "[SymbolFilePDB] Fix null array access when parsing the type of a ↵Pavel Labath2018-01-221-40/+0
| | | | | | | | | | 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-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | 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
* [lldb] Add support to cache a PDB's global scope and fix a bug in getting ↵Aaron Smith2018-01-131-0/+3
the source file name for a compiland Summary: This commit is a combination of the following changes: - Cache PDB's global scope (executable) in SymbolFilePDB - Change naming of `cu` to `compiland` which is PDB specific - Change ParseCompileUnitForSymIndex to ParseCompileUnitForUID. Prefer using a common name `UID` instead of PDB's `System Index` Adding one more argument `index` to this method, which is used to specify the index of the compile unit in a cached compile unit array - Add GetPDBCompilandByUID method to simply code - Fix a bug in getting the source file name for a PDB compiland. For some reason, PDBSymbolCompiland::getSourceFileName() could return an empty name, so if that is true, we have to walk through all source files of this compiland and determine the right source file used to generate this compiland based on language indicated. The previous implementation called PDBSession::findOneSourceFile method to get its name for the compiland. This is not accurate since the `one source file` found could be a header other than source file. Reviewers: zturner, lldb-commits Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41428 llvm-svn: 322433
OpenPOWER on IntegriCloud