summaryrefslogtreecommitdiffstats
path: root/lldb/lit/tools
Commit message (Collapse)AuthorAgeFilesLines
* [LLDB] Remove lldb-miJonas Devlieghere2019-07-1836-563/+0
| | | | | | | | | | | | | | As discussed on the mailing list [1], this patch removes the lldb-mi tool and its tests from the LLDB repository. We moved lldb-mi into a separate repository on GitHub [2] for downstream users or maintainers to build and package. [1] http://lists.llvm.org/pipermail/lldb-dev/2019-July/015103.html [2] https://github.com/lldb-tools/lldb-mi Differential revision: https://reviews.llvm.org/D64255 llvm-svn: 366465
* [lldb] [test] Extend D55859 symbols.enable-external-lookup=false for more ↵Jan Kratochvil2019-06-1710-0/+30
| | | | | | | | | | | | | | | | | | | | | | testcases D55859 <https://reviews.llvm.org/D55859> has no effect for some of the testcases so this patch extends it even for (all?) other testcases known to me. LLDB was failing when LLDB prints errors reading system debug infos (`*-debuginfo.rpm`, DWZ-optimized) which should never happen as LLDB testcases should not be affected by system debug infos. `lldb/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template` is using only SB API which does not expose `ModuleList` so I had to call `HandleCommand()` there. `lldb-test.cpp` could also use `HandleCommand` and then there would be no need for `ModuleListProperties::SetEnableExternalLookup()` but I think it is cleaner with API and not on based on text commands. Differential Revision: https://reviews.llvm.org/D63339 llvm-svn: 363567
* @skipIfLinux flaky lldb-mi testsPavel Labath2019-05-132-0/+2
| | | | llvm-svn: 360564
* Make lldb-mi optional and change how we deal with missing tools in litJonas Devlieghere2019-05-031-3/+1
| | | | | | | | | We don't need the variables in lit, we can use the capabilities to check if the utility exists. Differential revision: https://reviews.llvm.org/D61533 llvm-svn: 359926
* [tools] Make vscode and lldb-instr optional.Davide Italiano2019-04-161-0/+4
| | | | | | | | | | | | | | | | Summary: Saves some build times, and they're not part of the usual developer workflow. Reviewers: JDevlieghere, friss Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D60780 llvm-svn: 358528
* [Reproducers] Capture return values of functions returning by ptr/refJonas Devlieghere2019-04-034-0/+15
| | | | | | | | | | | | | | | For some reason I had convinced myself that functions returning by pointer or reference do not require recording their result. However, after further considering I don't see how that could work, at least not with the current implementation. Interestingly enough, the reproducer instrumentation already (mostly) accounts for this, though the lldb-instr tool did not. This patch adds the missing macros and updates the lldb-instr tool. Differential revision: https://reviews.llvm.org/D60178 llvm-svn: 357639
* [lldb-instr] Support LLDB_RECORD_DUMMYJonas Devlieghere2019-03-084-0/+5
| | | | | | | Extend lldb-instr to insert LLDB_RECORD_DUMMY macros for currently unsupported signatures (void and function pointers). llvm-svn: 355710
* Skip TestGdbserverPort.test on WindowsJan Kratochvil2019-03-071-1/+3
| | | | | | | | | | | lldb/cmake/modules/LLDBConfig.cmake does not build lldb-server on Windows: if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD") set(LLDB_CAN_USE_LLDB_SERVER 1) Also do not append 'platform' parameter twice - although that was quietly ignored. llvm-svn: 355579
* Sanity check --max-gdbserver-portJan Kratochvil2019-03-061-0/+2
| | | | | | | | | | | | | | | | | | | | In mail [lldb-dev] Remote debugging a docker process https://lists.llvm.org/pipermail/lldb-dev/2019-March/014795.html user was confused by --min-gdbserver-port and --max-gdbserver-port options being ignored. I think there is even a bug that --max-gdbserver-port is upper exclusive limit (and not upper inclusive limit appropriate for max). At least this patch should catch such mistake by an error message. The question is whether --max-gdbserver-port should not be changed to really be max and not max+1 but that would break backward compatibility. Now the mail example does produce: error: --min-gdbserver-port (5001) is not lower than --max-gdbserver-port (5001) Differential Revision: https://reviews.llvm.org/D58962 llvm-svn: 355554
* [lldb] [test] Mark failing tests XFAIL on NetBSDMichal Gorny2019-03-049-0/+17
| | | | | | | | | | | | | | | | Add a convenience 'expectedFailureNetBSD' decorator and mark all tests currently failing on NetBSD with it. Also skip a few tests that hang the test suite. This should establish a baseline for the test suite and get us closer to enabling tests on buildbot. This will help us catch regressions while we still have a lot of work to do to get tests working. It seems that there are also some flaky tests. I am going to address them later on. Differential Revision: https://reviews.llvm.org/D58527 llvm-svn: 355320
* Revert "[lldb-mi] Move TestMIPrompt away from pexpect()."Davide Italiano2019-02-211-17/+0
| | | | | | | I see a test failing on the macOS bots. I can't reproduce locally, so try to get the bots green before I can investigate. llvm-svn: 354540
* [lldb-mi] Move TestMIPrompt away from pexpect().Davide Italiano2019-02-201-0/+17
| | | | llvm-svn: 354506
* [lldb-instr] Group RECORD macrosJonas Devlieghere2019-02-201-0/+2
| | | | | | Group LLDB_RECORD macros per input file. llvm-svn: 354423
* [lldb-instr] Don't print REGISTER macro when RECORD is already presentJonas Devlieghere2019-02-191-0/+1
| | | | | | | | | | | Currently we'd always print the LLDB_REGISTER macro, even if the LLDB_RECORD macro was already present. This patches changes that to make it easier to incrementally update the macros. Note that it's still possible for the RECORD and REGISTER macros to get out of sync. llvm-svn: 354400
* [lldb-instr] Test that we ignore existing macros.Jonas Devlieghere2019-02-193-1/+13
| | | | | | Although the functionality was already present, it wasn't tested. llvm-svn: 354303
* [lldb-instr] Wrap returns of struct/classes in LLDB_RECORD_RESULTJonas Devlieghere2019-02-194-1/+8
| | | | | | | The instrumentation framework requires return values of custom classes and structs to be wrapped in the LLDB_RECORD_RESULT macro. llvm-svn: 354301
* [lldb-instr] Add constructor and move test into lit/toolsJonas Devlieghere2019-02-184-0/+47
| | | | | | | | The test had an implicit constructor for the Foo struct. Also, as the instrumentation doesn't have to be reproducer specific, I moved the tests into the lit/tools directory. llvm-svn: 354294
* [lldb] [test] Skip lldb-mi test if LLDB_DISABLE_PYTHON is usedMichal Gorny2019-02-111-0/+2
| | | | | | | | | | Skip running lldb-mi tests when Python support is disabled. This causes lldb-mi to unconditionally fail, and therefore all the relevant tests fail as well. Differential Revision: https://reviews.llvm.org/D58000 llvm-svn: 353700
* [lit] Make sure tests are actually skipped on darwin and windows.Davide Italiano2019-01-171-1/+1
| | | | llvm-svn: 351486
* [lit] Use the new build.py script in the lldb-mi testsStella Stamenova2018-12-1810-40/+10
| | | | | | This allows the tests to pass on Windows as well llvm-svn: 349562
* Fix some issues with LLDB's lit configuration files.Zachary Turner2018-11-1912-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recently I tried to port LLDB's lit configuration files over to use a on the surface, but broke some cases that weren't broken before and also exposed some additional problems with the old approach that we were just getting lucky with. When we set up a lit environment, the goal is to make it as hermetic as possible. We should not be relying on PATH and enabling the use of arbitrary shell commands. Instead, only whitelisted commands should be allowed. These are, generally speaking, the lit builtins such as echo, cd, etc, as well as anything for which substitutions have been explicitly set up for. These substitutions should map to the build output directory, but in some cases it's useful to be able to override this (for example to point to an installed tools directory). This is, of course, how it's supposed to work. What was actually happening is that we were bringing in PATH and LD_LIBRARY_PATH and then just running the given run line as a shell command. This led to problems such as finding the wrong version of clang-cl on PATH since it wasn't even a substitution, and flakiness / non-determinism since the environment the tests were running in would change per-machine. On the other hand, it also made other things possible. For example, we had some tests that were explicitly running cl.exe and link.exe instead of clang-cl and lld-link and the only reason it worked at all is because it was finding them on PATH. Unfortunately we can't entirely get rid of these tests, because they support a few things in debug info that clang-cl and lld-link don't (notably, the LF_UDT_MOD_SRC_LINE record which makes some of the tests fail. The high level changes introduced in this patch are: 1. Removal of functionality - The lit test suite no longer respects LLDB_TEST_C_COMPILER and LLDB_TEST_CXX_COMPILER. This means there is no more support for gcc, but nobody was using this anyway (note: The functionality is still there for the dotest suite, just not the lit test suite). There is no longer a single substitution %cxx and %cc which maps to <arbitrary-compiler>, you now explicitly specify the compiler with a substitution like %clang or %clangxx or %clang_cl. We can revisit this in the future when someone needs gcc. 2. Introduction of the LLDB_LIT_TOOLS_DIR directory. This does in spirit what LLDB_TEST_C_COMPILER and LLDB_TEST_CXX_COMPILER used to do, but now more friendly. If this is not specified, all tools are expected to be the just-built tools. If it is specified, the tools which are not themselves being tested but are being used to construct and run checks (e.g. clang, FileCheck, llvm-mc, etc) will be searched for in this directory first, then the build output directory. 3. Changes to core llvm lit files. The use_lld() and use_clang() functions were introduced long ago in anticipation of using them in lldb, but since they were never actually used anywhere but their respective problems, there were some issues to be resolved regarding generality and ability to use them outside their project. 4. Changes to .test files - These are all just replacing things like clang-cl with %clang_cl and %cxx with %clangxx, etc. 5. Changes to lit.cfg.py - Previously we would load up some system environment variables and then add some new things to them. Then do a bunch of work building out our own substitutions. First, we delete the system environment variable code, making the environment hermetic. Then, we refactor the substitution logic into two separate helper functions, one which sets up substitutions for the tools we want to test (which must come from the build output directory), and another which sets up substitutions for support tools (like compilers, etc). 6. New substitutions for MSVC -- Previously we relied on location of MSVC by bringing in the entire parent's PATH and letting subprocess.Popen just run the command line. Now we set up real substitutions that should have the same effect. We use PATH to find them, and then look for INCLUDE and LIB to construct a substitution command line with appropriate /I and /LIBPATH: arguments. The nice thing about this is that it opens the door to having separate %msvc-cl32 and %msvc-cl64 substitutions, rather than only requiring the user to run vcvars first. Because we can deduce the path to 32-bit libraries from 64-bit library directories, and vice versa. Without these substitutions this would have been impossible. Differential Revision: https://reviews.llvm.org/D54567 llvm-svn: 347216
* Refactor the lit configuration filesZachary Turner2018-11-0211-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | A year or so ago, I re-wrote most of the lit infrastructure in LLVM so that it wasn't so boilerplate-y. I added lots of common helper type stuff, simplifed usage patterns, and made the code more elegant and maintainable. We migrated to this in LLVM, clang, and lld's lit files, but not in LLDBs. This started to bite me recently, as the 4 most recent times I tried to run the lit test suite in LLDB on a fresh checkout the first thing that would happen is that python would just start crashing with unhelpful backtraces and I would have to spend time investigating. You can reproduce this today by doing a fresh cmake generation, doing ninja lldb and then python bin/llvm-lit.py -sv ~/lldb/lit/SymbolFile at which point you'll get a segfault that tells you nothing about what your problem is. I started trying to fix the issues with bandaids, but it became clear that the proper solution was to just bring in the work I did in the rest of the projects. The side benefit of this is that the lit configuration files become much cleaner and more understandable as a result. Differential Revision: https://reviews.llvm.org/D54009 llvm-svn: 346008
* [lldb-mi] Implement -gdb-set breakpoint pending on/offMarc-Andre Laperle2018-10-302-0/+53
| | | | | | | | | | | | | | | | | | Summary: This allows creating pending breakpoint automatically when a location is not found. This is used by some front-ends instead of doing "-break-insert -f" every time. See also https://sourceware.org/gdb/onlinedocs/gdb/Set-Breaks.html Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com> Subscribers: MaskRay, llvm-commits, lldb-commits, ki.stfu Tags: #lldb Differential Revision: https://reviews.llvm.org/D52953 llvm-svn: 345563
* [lldb-mi] Fix bugs in target-select-so-path.testAlexander Polyakov2018-09-252-6/+9
| | | | | | | | | | | | | | | | | | | | Summary: * This patch fixes hanging of the test in case of using python3, changes callback function that will be called if the timer ends, changes python interpreter to `%python` that is set up by llvm-lit. * Also, the test didn't work properly since it didn't contain a call of filecheck_proc.communicate(), that means that filecheck didn't run and its return code was equal to 0 in all cases. Reviewers: teemperor, labath, tatyana-krasnukha, aprantl Reviewed By: teemperor, labath Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D52498 llvm-svn: 343033
* [lldb-mi] Fix hanging of target-select-so-path.testAlexander Polyakov2018-09-241-13/+21
| | | | | | | | | | | | | | | | | | | | | | | Summary: The target-select-so-path test might hang on some platforms. The reason of that behavior was in incorrect usage of Filecheck and lldb-mi processes. Instead of redirecting lldb-mi's output to Filecheck, we should run lldb-mi session, finish the session, collect its output and then pass it to Filecheck. Also, this patch adds a timer to the test to prevent it from hanging in the future. Reviewers: tatyana-krasnukha, aprantl, teemperor Reviewed By: tatyana-krasnukha, teemperor Subscribers: apolyakov, aprantl, teemperor, ki.stfu, abidh, lldb-commits Differential Revision: https://reviews.llvm.org/D52139 llvm-svn: 342915
* [lldb-mi] Correct regex in the symbol-list-lines testAlexander Polyakov2018-09-151-2/+2
| | | | | | | | | | | | | | | | | | | Summary: The test failed in case of compiling a test suite with gcc (checked versions are 5.2.0 and 7.3.0) because it adds one more line entry comparing to clang. It doesn't break the test's logic, so I just added a regex that matches this case. Reviewers: tatyana-krasnukha, aprantl, clayborg Reviewed By: aprantl Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D52101 llvm-svn: 342329
* 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
* [lldb-mi] Re-implement target-select commandAlexander Polyakov2018-08-074-0/+69
| | | | | | | | | | 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
* [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
* [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
* [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
* [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
* [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
* [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
* [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, 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
* [lldb-mi] Add possibility to set breakpoints without selecting a target.Adrian Prantl2018-05-243-0/+23
Now it's possible to set breakpoints before selecting a target, they will be set to the dummy target and then copied to an each added one. Patch by Alexander Polyakov! Differential Revision: https://reviews.llvm.org/D46588 llvm-svn: 333205
OpenPOWER on IntegriCloud