summaryrefslogtreecommitdiffstats
path: root/lldb/lit
Commit message (Collapse)AuthorAgeFilesLines
...
* Darwin: mark test unsupported while we sort out how to make it generic.Tim Northover2018-08-091-1/+1
| | | | | | | | This test relies on communicating with debugserver via an unnamed (pre-opened) pipe, but macOS's version of debugserver doesn't seem to support that mode of operation. So disable the test for now. llvm-svn: 339343
* [lit, python] Change the order of the quotes in the lit cfg fileStella Stamenova2018-08-071-1/+1
| | | | | | Double quotes are always correct in paths on windows while single quotes only work sometimes. By swapping the order of the quotes in the subsitution we guarantee that the quotes will be correct on Windows. Both sets work correctly on Linux in the test environment. llvm-svn: 339180
* [lldb-mi] Re-implement target-select commandAlexander Polyakov2018-08-075-2/+77
| | | | | | | | | | Now target-select uses SB API instead of HandleCommand. This patch has been reviewed along with the r339175. Differential Revision: https://reviews.llvm.org/D49739 llvm-svn: 339178
* Misc module/dwarf logging improvementsLeonard Mosescu2018-08-071-2/+1
| | | | | | | | | | | | | | This change improves the logging for the lldb.module category to note a few interesting cases: 1. Local object file found, but specs not matching 2. Local object file not found, using a placeholder module The handling and logging for the cases wehre we fail to load compressed dwarf symbols is also improved. Differential Revision: https://reviews.llvm.org/D50274 llvm-svn: 339161
* [lit, python] Always add quotes around the python path in litStella Stamenova2018-08-061-1/+1
| | | | | | | | | | | | | Summary: The issue with the python path is that the path to python on Windows can contain spaces. To make the tests always work, the path to python needs to be surrounded by quotes. This is a companion change to: https://reviews.llvm.org/D50206 Reviewers: asmith, zturner Differential Revision: https://reviews.llvm.org/D50280 llvm-svn: 339076
* [lldb-mi] Re-implement data-info-line command.Alexander Polyakov2018-07-233-0/+41
| | | | | | | | | | | | | | Summary: Now data-info-line command uses SB API instead of HandleCommand. Reviewers: aprantl, clayborg, jingham Reviewed By: aprantl Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D49062 llvm-svn: 337689
* ELF: Replace the header-extension unit test with a lit onePavel Labath2018-07-192-1/+73
| | | | | | | | | The new test checks that we are actually able to read data from these kinds of elf headers correctly instead of just that we read the section number correctly. It is also easier to figure out what's going on in the test. llvm-svn: 337459
* Fix variables.test after D49018Stella Stamenova2018-07-181-7/+7
| | | | | | | | | | | | | | Summary: This one fixes variables.test after D49018. The test was broken because D49018 adds a location information to variables, but I hadn't noticed that, because I used 32-bit build to run tests, so the test looked to me already broken before that commit (the test relies on mangled names, but the mangling schemes are different for 32-bit and 64-bit). Reviewers: stella.stamenova, lldb-commits Reviewed By: stella.stamenova Patch By: Aleksandr Urakov Differential Revision: https://reviews.llvm.org/D49475 llvm-svn: 337397
* [lit, lldbsuite] Remove tests that are duplicated between lit and lldb-suiteStella Stamenova2018-07-185-80/+0
| | | | | | | | | | | | Summary: Several tests exist in both lit and lldbsuite. This removes the lit version of the duplicated tests. Reviewers: asmith, zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D49450 llvm-svn: 337393
* [CMake] Have check-lldb-unit use CMAKE_CURRENT_BINARY_DIRJonas Devlieghere2018-07-171-2/+3
| | | | | | | | | | | | | | | llvm-lit uses `map_config` directives (generated at configuration-time) to make it possible to pass a test path relative to the source instead of the build folder (CMAKE_CURRENT_BINARY_DIR). However, this doesn't work in the case of swift where the build directory layout prevents llvm-lit from knowing about lldb and its test paths. This caused check-lldb-unit to fail in this configuration, while everything was working as expected upstream. This patch fixes the issue by passing a path relative to the build directory. This was already the case for check-lldb-lit. llvm-svn: 337291
* Fix typo in find-basic-function testPavel Labath2018-07-161-4/+4
| | | | | | | | | Wrong FileCheck header meant that we were not matching what we should. This allows us to get rid of the -allow-deprecated-dag-overlap flag in the test. llvm-svn: 337188
* [lldb-mi] Make symbol-list-lines.test XFAIL on WindowsAlexander Polyakov2018-07-131-0/+3
| | | | | | | It's a temporary decision until we reach out what causes a failure. llvm-svn: 337064
* Convert a location information from PDB to a DWARF expressionJonas Devlieghere2018-07-133-0/+45
| | | | | | | | | | | | | | | | | | 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
* [FileCheck] Add -allow-deprecated-dag-overlap to failing lldb testsJoel E. Denny2018-07-111-3/+3
| | | | | | | | | | See https://reviews.llvm.org/D47106 for details. Reviewed By: probinson Differential Revision: https://reviews.llvm.org/D49192 llvm-svn: 336846
* Allow specifying an exit code for the 'quit' commandRaphael Isemann2018-07-1110-0/+43
| | | | | | | | | | | | | | | | | | | Summary: This patch adds the possibility to specify an exit code when calling quit. We accept any int, even though it depends on the user what happens if the int is out of the range of what the operating system supports as exit codes. Fixes rdar://problem/38452312 Reviewers: davide, jingham, clayborg Reviewed By: jingham Subscribers: clayborg, jingham, lldb-commits Differential Revision: https://reviews.llvm.org/D48659 llvm-svn: 336824
* Retrieve a function PDB symbol correctly from nested blocksStella Stamenova2018-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. It is very simple to reproduce this. For example, in the next program ``` int main() { auto r = 0; for (auto i = 1; i <= 10; i++) { r += i & 1 + (i - 1) & 1 - 1; } return r; } ``` if we will stop inside the cycle and will do a backtrace, the top element will be broken. But how we can test this? I thought to add an option to lldb-test to allow search a function by address, but the address may change when the compiler will be changed. Patch by: Aleksandr Urakov Reviewers: asmith, labath, zturner Reviewed By: asmith, labath Subscribers: stella.stamenova, llvm-commits Differential Revision: https://reviews.llvm.org/D47939 llvm-svn: 336564
* [lit] Don't require semicolon separatorJonas Devlieghere2018-07-042-4/+11
| | | | | | | | | This patch removes the requirement for a semicolon as a separator when passing arguments to lit. It relies on the shlex module that is part of Python to do simple lexical analysis, similar to what happens in a Unix shell. llvm-svn: 336290
* [lldb-mi] Re-implement symbol-list-lines command.Alexander Polyakov2018-07-037-0/+35
| | | | | | | | | | | | | | Summary: Now this command uses SB API instead of HandleCommand. Reviewers: aprantl, clayborg Reviewed By: aprantl, clayborg Subscribers: ki.stfu, eraman, lldb-commits Differential Revision: https://reviews.llvm.org/D48802 llvm-svn: 336206
* [lldb-mi] Re-implement a few MI commands.Alexander Polyakov2018-07-025-0/+118
| | | | | | | | | | | | | | | Summary: This patch updates exec-next-instruction, exec-step-instruction, exec-finish, exec-interrupt commands to use SB API instead of HandleCommand. Reviewers: aprantl, clayborg Reviewed By: aprantl Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D48520 llvm-svn: 336155
* Add a test for reading lld-generated build-idsPavel Labath2018-06-296-6/+32
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This test makes sure we are able to read the shorter build-ids which are generated by lld. To make this work, I've extended lldb-test to print the UUID of the loaded object file. I've renamed the lldb-test subcommand from "module-sections" to "object-file" to reflect the fact it prints more than just the sections. I've also added the module Architecture to the output, so we could avoid printing the entire symbol file information just to get the ArchSpec details in the lc_version_min test (which was also the only test in it's folder not using the module-sections command). Reviewers: aprantl, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D48646 llvm-svn: 335967
* Retrieve a function PDB symbol correctly from nested blocksPavel Labath2018-06-282-0/+15
| | | | | | | | | | | | | | | | | | | 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
* DebugNamesDWARFIndex: fix handling of compressed sectionsPavel Labath2018-06-141-0/+14
| | | | | | | | | | | | | This fixes a silly bug where we were accidentally freeing the memory used to store the decompressed .debug_names data. I had actually considered this scenario when writing the class and put appropriate precautions in place -- I just failed to wire it all up correctly. This was only an issue for compressed sections because in case of uncompressed ones we would access the data straight out of the mmapped object file. llvm-svn: 334717
* DWARFDebugNames: Implement last GetGlobalVariables overloadPavel Labath2018-06-121-2/+10
| | | | | | | This function implements the search for all global variables within a given compilation unit. llvm-svn: 334500
* lldb-test symbols: Add -file argument and the ability to dump global ↵Pavel Labath2018-06-123-0/+25
| | | | | | | | | | | | | | | variables in a file The motivation for this is to be able to Dwarf index ability to look up variables within a given compilation unit. It also fits in with the patch in progress at D47939, which will add the ability to look up funtions using file+line pairs. The verification of which lldb-test options can be used together was getting a bit unwieldy, so I moved the logic out into a separate function. llvm-svn: 334498
* lit/SymbolFile/DWARF: Simplify test RUN linesPavel Labath2018-06-128-22/+14
| | | | | | | Use -mllvm compiler argument to enable DWARF v5 accelerator tables instead of piping the IR through llc. llvm-svn: 334496
* DWARFDebugNames: Fix lookup in dwo filesPavel Labath2018-06-111-0/+25
| | | | | | | | | | | | The getDIESectionOffset function is not correct for split dwarf files (and will probably be removed in D48009). This patch implements correct section offset computation for split and non-split compile units -- we first need to check if the referenced unit is a skeleton unit, and if it is, we add the die offset to the full unit base offset (as the full unit is the one which contains the die). llvm-svn: 334402
* [lldb-mi] Re-implement MI -exec-step command.Alexander Polyakov2018-06-101-0/+30
| | | | | | | | | | | | | | Summary: Now -exec-step uses SB API instead of HandleCommand hack. Reviewers: aprantl, clayborg, labath, stella.stamenova Reviewed By: aprantl Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D47838 llvm-svn: 334364
* [lldb, lldb-mi] Re-implement MI -exec-continue command.Alexander Polyakov2018-06-091-0/+20
| | | | | | | | | | | | | | Summary: Now -exec-continue command uses SB API to resume target's process. Reviewers: aprantl, clayborg, labath Reviewed By: clayborg Subscribers: apolyakov, labath, ki.stfu, llvm-commits, lldb-commits Differential Revision: https://reviews.llvm.org/D47415 llvm-svn: 334350
* DebugNamesDWARFIndex: Implement regex version of the GetFunctions methodPavel Labath2018-06-081-0/+27
| | | | | | | | | This also fixes a bug where SymbolFileDWARF was returning the same function multiple times - this can happen if both mangled and demangled names match the regex. Other lookup lookup functions had code to handle this case, but it was forgotten here. llvm-svn: 334277
* DebugNamesDWARFIndex: Implement GetFunctions methodPavel Labath2018-06-081-0/+16
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements the non-regex variant of GetFunctions. To share more code with the Apple implementation, I've extracted the common filtering code from that class into a utility function on the DWARFIndex base class. The new implementation also searching the accelerator table multiple times -- previously it could happen that the apple table would return the same die more than once if one specified multiple search flags in name_type_mask. This way, I separate table iteration from filtering, and so we can be sure each die is inserted at most once. Reviewers: clayborg, JDevlieghere Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D47881 llvm-svn: 334273
* PDB support of function-level linking and splitted functionsAaron Smith2018-06-084-0/+29
| | | | | | | | | | | | | | | | | | | 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
* [lldb-mi] Re-implement MI -exec-next command.Alexander Polyakov2018-06-072-0/+34
| | | | | | | | | | | | | | Summary: Now -exec-next command uses SB API for stepping over. Reviewers: aprantl, clayborg, stella.stamenova, labath Reviewed By: aprantl, clayborg, labath Subscribers: labath, ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D47797 llvm-svn: 334215
* [lit, windows] Disable a number of tests that are failing on WindowsStella Stamenova2018-06-071-0/+2
| | | | | | | | | | | | | | Summary: They all correspond to bugs that are already logged and I've added the appropriate (or most appropriate) bug numbers. This leaves only a handful of failing tests. Reviewers: asmith, zturner, labath Reviewed By: zturner Subscribers: eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D47892 llvm-svn: 334210
* DebugNamesDWARFIndex: Add type lookup suportPavel Labath2018-06-071-0/+10
| | | | | | | | This implements just one of the GetTypes overloads. The other is not testable from lldb-test so I'm leaving it unimplemented until I figure out what to do with testing. llvm-svn: 334190
* DebugNamesDWARFIndex: add namespace lookup supportPavel Labath2018-06-071-0/+10
| | | | llvm-svn: 334186
* DebugNamesDWARFIndex: Add support for partial indexesPavel Labath2018-06-071-0/+25
| | | | | | | | | | | | | | | | | | | | | Summary: It possible that a single module has indexed and non-indexed compile units. In this case, we can use the fast indexed lookup for the first ones and fall back to the manual index for the others. This patch implements this functionality by adding a units_to_avoid argument to the ManualDWARFIndex constructor. Any units present in that list will be ignored for the purposes of manual index. Individual DebugNamesDWARFIndex then always consult both the manual fallback index as well as the index in the .debug_names section. Reviewers: JDevlieghere, clayborg Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D47832 llvm-svn: 334185
* DebugNamesDWARFIndex: Add ability to lookup variablesPavel Labath2018-06-073-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds the ability to lookup variables to the DWARF v5 index class. During review we discovered an inconsistency between how the existing two indexes handle looking up qualified names of the variables: - manual index would return a value if the input string exactly matched the demangled name of some variable. - apple index ignored the context and returned any variable with the same base name. So, this patch also rectifies that situation: - it removes all context handling from the index classes. The GetGlobalVariables functions now just take a base name. For manual index, this meant we can stop putting demangled names into the variable index (this matches the behavior for functions). - context extraction is put into SymbolFileDWARF, so that it is common to all indexes. - additional filtering based on the context is also done in SymbolFileDWARF. This is done via a simple substring search, which is not ideal, but it matches what we are doing for functions (cf. Module::LookupInfo::Prune). Reviewers: clayborg, JDevlieghere Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D47781 llvm-svn: 334181
* [DWARF] Add (empty) DebugNamesDWARFIndex class and a setting to control its usePavel Labath2018-06-061-0/+8
| | | | | | | | | | | | | | | | | | | Summary: This patch adds the skeleton for implementing the DWARF v5 name index class. All of the methods are stubbed out and will be implemented in subsequent patches. The interesting part of the patch is the addition of a "ignore-file-indexes" setting to the dwarf plugin which enables a user to force using manual indexing path in lldb (for example as a debugging aid). I have also added a test that verifies that file indexes are used by default. Reviewers: JDevlieghere, clayborg, jingham Subscribers: mgorny, mehdi_amini, aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D47629 llvm-svn: 334088
* [lit] Do not run Python tests w/ LLDB_DISABLE_PYTHONMichal Gorny2018-06-063-0/+5
| | | | | | | | | | Skip all Python-based tests as unsupported when LLDB_DISABLE_PYTHON is enabled. Otherwise, those tests simply fail being unable to import lldb module. Differential Revision: https://reviews.llvm.org/D47812 llvm-svn: 334080
* [lit, pdb] Fix func-symbols.test (on Windows)Stella Stamenova2018-06-051-36/+37
| | | | | | | | | | | | Summary: This test was failing sporadically on windows because the order in which the symbols are generated was different between builds. To fix the test, we need to run FileCheck twice - once for each set of symbols we want to verify. The test only runs on Windows. Reviewers: asmith, zturner, labath Subscribers: stella.stamenova, llvm-commits Differential Revision: https://reviews.llvm.org/D47746 llvm-svn: 334025
* [lldb, lldb-mi] Enable lldb-mi -break-insert test on Windows.Alexander Polyakov2018-06-041-5/+4
| | | | | | | | | | | | | | | | | Summary: The default name for a compiler output on Linux is `a.out`, while on Windows it's `a.exe`. But if we add option `-o a.exe`, the compiler will create the executable `a.exe` on the both systems. Reviewers: aprantl, stella.stamenova Reviewed By: stella.stamenova Subscribers: ki.stfu, llvm-commits, lldb-commits Differential Revision: https://reviews.llvm.org/D47679 llvm-svn: 333963
* [IRMemoryMap] Use labels in the "malloc" and "free" lldb-test commandsVedant Kumar2018-06-043-304/+301
| | | | | | | | | | | | | | | | Change the syntax of the malloc and free commands in lldb-test's ir-memory-map subcommand to: <malloc> ::= <label> = malloc <size> <alignment> <free> ::= free <label> This should make it easier to read and extend tests in the future, e.g to test IRMemoryMap::WriteMemory or double-free behavior. Differential Revision: https://reviews.llvm.org/D47646 llvm-svn: 333930
* [LLDB] Unit tests basic support for OpenBSDDavid Carlier2018-06-041-0/+4
| | | | | | | | | | | | Add OpenBSD python module in order to support unit tests. Reviewers: labath, zturner Reviewed By: labath Differential Revision: https://reviews.llvm.org/D47692 llvm-svn: 333888
* AppleDWARFIndex: Get function method-ness directly from debug infoPavel Labath2018-06-041-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When searching for methods only, we need to do extra work to make sure the functions we get from the apple tables are indeed methods. Previously we were resolving the DIE into a SymbolContext and then checked whether the enclosing CompilerDeclContext is a class (or struct, or union). This patch changes that to operate on the debug info directly. This should be: - simpler - faster - more consistent with the ManualDWARFIndex (which does the same check, only at indexing time). What we lose this ways is for the language plugin to have a say in what it considers to be a "class", but that's probably more flexibility than we need (and if we really wanted to do that in the future, we could implement a more direct way to consult the plugin about this). This also fixes the find-method-local-struct test, which was failing because we were not able to construct a CompilerDeclContext for a local struct correctly. As a drive-by, I rename the DWARFDIE's IsStructClassOrUnion method to match the name on the CompilerDeclContext class. Reviewers: clayborg, JDevlieghere Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D47470 llvm-svn: 333878
* [lldb, lldm-mi] Fix hanging of -exec-run command.Alexander Polyakov2018-06-032-0/+7
| | | | | | | | | | | | | | Summary: -exec-run command hanged in case of invalid or dummy target. Reviewers: aprantl, stella.stamenova Reviewed By: aprantl Subscribers: ki.stfu, llvm-commits, lldb-commits Differential Revision: https://reviews.llvm.org/D47678 llvm-svn: 333844
* [lit, pdb] Fix two failing PDB tests on WindowsStella Stamenova2018-06-012-8/+8
| | | | | | | | | | | | | | Summary: One of the tests is failing to build because it needs GS-, the second test does not correctly match all the expected function names because newer DIA SDKs annotate the function names with their return type and inputs (e.g. "static long `anonymous namespace'::StaticFunction(int)") Reviewers: asmith, zturner Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D47653 llvm-svn: 333790
* [lit, lldbmi] Skip the new break-insert test on WindowsStella Stamenova2018-06-011-0/+4
| | | | | | | | | | | | | | Summary: Skip the new break-insert test on Windows because it hangs and so the test suite never completes. All other lldb-mi tests in the test suite are also skipped on windows Reviewers: asmith, aprantl, polyakov.alex Reviewed By: aprantl Subscribers: ki.stfu, llvm-commits Differential Revision: https://reviews.llvm.org/D47651 llvm-svn: 333789
* XFAIL TestIRMemoryMap.test on WindowsVedant Kumar2018-06-011-1/+1
| | | | | | | | I've xfailed this test instead of skipping it by request (https://reviews.llvm.org/D47646). Bug: https://bugs.llvm.org/show_bug.cgi?id=37656 llvm-svn: 333787
* Disable TestIRMemoryMap.test on WindowsVedant Kumar2018-06-011-0/+2
| | | | | | | It's been pointed out in https://reviews.llvm.org/D47646 that lldb-test fails to create a usable process on Windows when running this test. llvm-svn: 333785
* Add .debug_names section glue codePavel Labath2018-06-011-0/+9
| | | | llvm-svn: 333743
OpenPOWER on IntegriCloud