summaryrefslogtreecommitdiffstats
path: root/lldb/test
Commit message (Collapse)AuthorAgeFilesLines
...
* ValueObject: Fix a crash related to children address type computationPavel Labath2019-10-251-0/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch fixes a crash encountered when debugging optimized code. If some variable has been completely optimized out, but it's value is nonetheless known, the compiler can replace it with a DWARF expression computing its value. The evaluating these expressions results in a eValueTypeHostAddress Value object, as it's contents are computed into an lldb buffer. However, any value that is obtained by dereferencing pointers in this object should no longer have the "host" address type. Lldb had code to account for this, but it was only present in the ValueObjectVariable class. This wasn't enough when the object being described was a struct, as then the object holding the actual pointer was a ValueObjectChild. This caused lldb to dereference the contained pointer in the context of the host process and crash. Though I am not an expert on ValueObjects, it seems to me that this children address type logic should apply to all types of objects (and indeed, applying applying the same logic to ValueObjectChild fixes the crash). Therefore, I move this code to the base class, and arrange it to be run everytime the value is updated. The test case is a reduced and simplified version of the original debug info triggering the crash. Originally we were dealing with a local variable, but as these require a running process to display, I changed it to use a global one instead. Reviewers: jingham, clayborg Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D69273
* [CMake] Move LLDB_TEST_BUILD_DIRECTORY into test/CMakeLists.txtJonas Devlieghere2019-10-241-0/+3
| | | | | | The LLDB_TEST_BUILD_DIRECTORY variable only matters to the different test suites. Therefore they belong in test/CMakeLists.txt rather than the top-level CMakeLists.txt.
* [CMake] Move test dependency tracking into test/CMakeLists.txtJonas Devlieghere2019-10-241-11/+88
| | | | | | As the name suggests, the LLDB test dependencies only matter to the different test suites. Therefore they belong in test/CMakeLists.txt rather than the top-level CMakeLists.txt.
* [CMake] Don't set LLDB_TEST_* in the top-level CMakeListsJonas Devlieghere2019-10-241-1/+23
| | | | | All these variables only affect the API tests. Therefore they belong in test/API/CMakeLists.txt rather than the top-level CMakeLists.txt.
* [CMake] Remove unused variable LLDB_TEST_CXX_COMPILERJonas Devlieghere2019-10-241-1/+1
| | | | | | | | | | | | | CMake allows you to set a custom CXX compiler for the API test suite. However, this variable is never used, because dotest uses the same compiler to build C and CXX sources. I'm not sure if this variable was added with the intention of supporting a different compiler or if this is just a remnant of old functionality. Given that this hasn't been working for a while, I assume it's safe to remove. Differential revision: https://reviews.llvm.org/D69401
* [CMake] Split logic across test suite subdirectories (NFC)Jonas Devlieghere2019-10-244-79/+67
| | | | | | | | | The top-level CMake file in the test directory can be simplified by moving relevant configuration options into the corresponding subdirectories. Doing so makes it easier to understand what CMake options are needed by the different test suites. Differential revision: https://reviews.llvm.org/D69394
* [lldb] drop .symtab removal in minidebuginfo testsKonrad Kleine2019-10-213-15/+0
| | | | | | | | | | | | | | | | Summary: After D69041, we no longer have to manually remove the .symtab section once yaml2obj was run. Reviewers: espindola, alexshap Subscribers: emaste, arichardson, MaskRay, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69254 llvm-svn: 375415
* [LLDB] [Windows] Initial support for ARM register contextsMartin Storsjo2019-10-214-0/+103
| | | | | | Differential Revision: https://reviews.llvm.org/D69226 llvm-svn: 375392
* [Reproducer] XFAIL TestWorkingDir on WindowsJonas Devlieghere2019-10-181-0/+2
| | | | | | | | I'm having a hard time reproducing this and it's failing on the Windows bot. Temporarily X-failing this test while I continue to try building LLDB on Windows. llvm-svn: 375294
* Add REQUIRES: x86 to more tests which need the x86 llvm target builtPavel Labath2019-10-182-0/+4
| | | | llvm-svn: 375234
* [test] Add a .clang-format file for the shell test.Jonas Devlieghere2019-10-171-0/+3
| | | | | | | | | | | | | | | | | | The API tests have a .clang-format file that disables formatting altogether. While this is needed for some tests, it also leads to inconsistency between test files. The shell tests suffer from a similar problem: a test with a source-file extension (.c, .cpp) will get formatted, potentially breaking up lines and leading to invalid RUN commands. Rather than completely disabling formatting here, I propose to not enforce a line limit instead. That way tests will be consistent, but you can still have long run commands (as is not uncommon in LLVM either) and use breakpoints with patters that extend beyond 80 cols. Differential revision: https://reviews.llvm.org/D69058 llvm-svn: 375172
* Revert "[LLDB] [test] Use %clang_cl instead of build.py in a few tests"Martin Storsjo2019-10-172-5/+4
| | | | | | | This reverts SVN r375156, as it seems to have broken tests when run on macOS: http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/2706/console llvm-svn: 375163
* [LLDB] [test] Use %clang_cl instead of build.py in a few testsMartin Storsjo2019-10-172-4/+5
| | | | | | | | | | | | | | | | | | | | This allows explicitly specifying the intended target architecture, for tests that aren't supposed to be executed, and that don't require MSVC headers or libraries to be available. (These tests already implicitly assumed to be built for x86; one didn't specify anything, assuming x86_64, while the other specified --arch=32, which only picks the 32 bit variant of the default target architecture). Join two comment lines in disassembly.cpp, to keep row numbers checked in the test unchanged. This fixes running check-lldb on arm linux. Differential Revision: https://reviews.llvm.org/D69031 llvm-svn: 375156
* [Reproducer] Set the working directory in the VFSJonas Devlieghere2019-10-171-3/+7
| | | | | | | | | Now that the VFS knows how to deal with virtual working directories, we can set the current working directory to the one we recorded during reproducer capture. This ensures that relative paths are resolved correctly during replay. llvm-svn: 375064
* [Reproducer] Support dumping the reproducer CWDJonas Devlieghere2019-10-172-1/+7
| | | | | | | Add support for dumping the current working directory with `reproducer dump -p cwd`. llvm-svn: 375061
* [Reproducer] Capture the debugger's working directoryJonas Devlieghere2019-10-171-0/+11
| | | | | | | | This patch extends the reproducer to capture the debugger's current working directory. This information will be used later to set the current working directory of the VFS. llvm-svn: 375059
* [LLDB] [PECOFF] Use a "pc" vendor name in aarch64 triplesMartin Storsjo2019-10-151-1/+1
| | | | | | | | | | | | | | | | | | | This matches all other architectures listed in the same file. This fixes debugging aarch64 executables with lldb-server, which otherwise fails, with log messages like these: Target::SetArchitecture changing architecture to aarch64 (aarch64-pc-windows-msvc) Target::SetArchitecture Trying to select executable file architecture aarch64 (aarch64-pc-windows-msvc) ArchSpec::SetArchitecture sets the vendor to llvm::Triple::PC for any coff/win32 combination, and if this doesn't match the triple set by the PECOFF module, things doesn't seem to work with when using lldb-server. Differential Revision: https://reviews.llvm.org/D68939 llvm-svn: 374867
* [LLDB] [Windows] Initial support for ARM64 register contextsMartin Storsjo2019-10-154-0/+111
| | | | | | Differential Revision: https://reviews.llvm.org/D67954 llvm-svn: 374866
* DWARFExpression: Fix/add support for (v4) debug_loc base address selection ↵Pavel Labath2019-10-141-12/+29
| | | | | | | | | | | | | | | | | | | | entries The DWARFExpression is parsing the location lists in about five places. Of those, only one actually had proper support for base address selection entries. Since r374600, llvm has started to produce location expressions with base address selection entries more aggresively, which caused some tests to fail. This patch adds support for these entries to the places which had it missing, fixing the failing tests. It also adds a targeted test for the two of the three fixes, which should continue testing this functionality even if the llvm output changes. I am not aware of a way to write a targeted test for the third fix (DWARFExpression::Evaluate). llvm-svn: 374769
* [test] Reduce inconsistency between lit configuration files.Jonas Devlieghere2019-10-103-9/+17
| | | | | | | Add the Python extension to the configuration files in the API directory to match the other test suites. llvm-svn: 374461
* [test] Add timeout to API tests.Jonas Devlieghere2019-10-102-2/+9
| | | | | | | | Before the reorganiziation, the API tests were inheriting the timeout from the top-level lit file. Now that this is no longer the case, the lldb-api test suite needs to set its own timeout. llvm-svn: 374435
* [test] Cleanup top-level lit.cfg.pyJonas Devlieghere2019-10-101-28/+2
| | | | llvm-svn: 374434
* [test] Use a different module cache for Shell and API tests.Jonas Devlieghere2019-10-105-11/+28
| | | | | | | | | | | | | | Before the test reorganization, everything was part of a single test suite with a single module cache. Now that things are properly separated this is no longer the case. Only the shell tests inherited the logic to properly configure and wipe the module caches. This patch adds that logic back for the API tests. While doing so, I noticed that we were configuring a Clang module cache in CMake, but weren't actually using it from dotest.py. I included a fix for that in this patch as well. Differential revision: https://reviews.llvm.org/D68755 llvm-svn: 374386
* [test] Trim the symbtab test case (NFC)Jonas Devlieghere2019-10-101-10/+0
| | | | | | We don't actually need the section content for this tests. llvm-svn: 374382
* unwind-via-stack-win.yaml: update for changes in yaml formatPavel Labath2019-10-101-1/+15
| | | | llvm-svn: 374353
* [lldb] Fix minidebuginfo-set-and-hit-breakpoint.testRaphael Isemann2019-10-101-1/+1
| | | | | | | | | This was failing for me because of this error: llvm-objcopy: error: 'build/tools/lldb/test/ObjectFile/ELF/Output/minidebuginfo-set-and-hit-breakpoint.test.tmp.mini_debuginfo': section '.dynsym' cannot be removed because it is referenced by the section '.hash' Patch by Konrad Kleine! llvm-svn: 374352
* [CMake] Use the correct lit.cfg.pyJonas Devlieghere2019-10-091-1/+1
| | | | llvm-svn: 374244
* [LLDB] Remove standalone build dep on llvm-stripJonas Devlieghere2019-10-091-1/+6
| | | | | | | | | | | | When building standalone, since llvm-strip is a symlink, it is created using add_custom_command/add_custom_target which cannot be exported, and thus cannot be depended on by lldb. Patch by: Gwen Mittertreiner Differential revision: https://reviews.llvm.org/D68614 llvm-svn: 374229
* [CMake] Fix add_lldb_test_dependencyJonas Devlieghere2019-10-091-8/+8
| | | | | | | This function would ignore all but the first argument. Now it correctly adds every dependency by iterating over its arguments. llvm-svn: 374216
* Re-land "[test] Split LLDB tests into API, Shell & Unit"Jonas Devlieghere2019-10-09448-130/+20648
| | | | | | | 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-09447-20629/+134
| | | | | | | | 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-09447-134/+20629
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [CMake] Add two more uses of add_lldb_test_dependencyJonas Devlieghere2019-10-081-7/+1
| | | | llvm-svn: 374000
* [CMake] Track test dependencies with add_lldb_test_dependencyJonas Devlieghere2019-10-081-4/+4
| | | | | | | | | | | | | I often use `ninja lldb-test-deps` to build all the test dependencies before running a subset of the tests with `lit --filter`. This functionality seems to break relatively often because test dependencies are tracked in an ad-hoc way acrooss cmake files. This patch adds a helper function `add_lldb_test_dependency` to unify test dependency tracking by adding dependencies to lldb-test-deps. Differential revision: https://reviews.llvm.org/D68612 llvm-svn: 373996
* [CMake] Remove stale commentJonas Devlieghere2019-10-081-2/+0
| | | | llvm-svn: 373995
* [CMake] Add the system debugserver to lldb-test-deps.Jonas Devlieghere2019-09-251-0/+1
| | | | | | | When using the system debugserver we create a target to copy it over. This target has to be added to lldb-test-deps. llvm-svn: 372901
* [CMake] Don't modify LLVM_DISTRIBUTION_COMPONENTS if it's not setJonas Devlieghere2019-09-251-2/+4
| | | | | | | Don't try to remove debugserver from LLVM_DISTRIBUTION_COMPONENTS if the list is not set. llvm-svn: 372799
* [CMake] Don't try to install the system debugserver.Jonas Devlieghere2019-09-251-0/+4
| | | | | | | The custom target for the system debugserver has no install target, so we need to remove it from the LLVM_DISTRIBUTION_COMPONENTS list. llvm-svn: 372793
* [CMake] Copy over the system debugserver when using LLDB_USE_SYSTEM_DEBUGSERVERJonas Devlieghere2019-09-241-0/+4
| | | | | | | | | | | | | | | | r366433 broke support for the system debugserver. Although the change was well-intended, it (presumably) unintentionally removed the logic to copy over the debugserver. As a result, even with LLDB_USE_SYSTEM_DEBUGSERVER enabled, we ended up building, signing and using the just-built debugserver. This patch partially recovers the old behavior: when LLDB_USE_SYSTEM_DEBUGSERVER is set we don't build debugserver and just copy over the system one. Differential revision: https://reviews.llvm.org/D67991 llvm-svn: 372786
* [test] Fix various module cache bugs and inconsistenciesJonas Devlieghere2019-08-291-2/+0
| | | | | | | | | | | | | | | | | Currently, lit tests don't set neither the module cache for building inferiors nor the module cache used by lldb when running tests. Furthermore, we have several places where we rely on the path to the module cache being always the same, rather than passing the correct value around. This makes it hard to specify a different module cache path when debugging a a test. This patch reworks how we determine and pass around the module cache paths and fixes the omission on the lit side. It also adds a sanity check to the lit and dotest suites. Differential revision: https://reviews.llvm.org/D66966 llvm-svn: 370394
* [dotest] Remove multiprocessingJonas Devlieghere2019-07-301-7/+0
| | | | | | | | | | | Now that the Xcode project is removed, I want to focus on dotest as a test framework, and remove its driver capabilities for which we already rely on llvm's lit. Removing multiprocessing is the first step in that direction. Differential revision: https://reviews.llvm.org/D65311 llvm-svn: 367331
* [CMake] Align debugserver with lldb-server on DarwinStefan Granitz2019-07-201-1/+8
| | | | | | | | | | | | | | | | Summary: Make debugserver a tool like lldb-server, so it can be included/excluded via `LLDB_TOOL_DEBUGSERVER_BUILD`. This replaces the old `LLDB_NO_DEBUGSERVER` flag. Doing the same for darwin-debug while I am here. Reviewers: xiaobai, JDevlieghere, davide Reviewed By: xiaobai, JDevlieghere Subscribers: mgorny, lldb-commits, #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D64994 llvm-svn: 366631
* [CMake] Always build debugserver on Darwin and allow tests to use the ↵Stefan Granitz2019-07-181-14/+21
| | | | | | | | | | | | | | | | | | | | | | | | system's one Summary: We can always build debugserver, but we can't always sign it to be useable for testing. `LLDB_USE_SYSTEM_DEBUGSERVER` should only tell whether or not the system debugserver should be used for testing. The old behavior complicated the logic around debugserver a lot. The new logic sorts out most of it. Please note that this patch is in early stage and needs some more testing. It should not affect platfroms other than Darwin. It builds on Davide's approach to validate the code-signing identity at configuration time. What do you think? Reviewers: xiaobai, JDevlieghere, davide, compnerd, friss, labath, mgorny, jasonmolenda Reviewed By: JDevlieghere Subscribers: lldb-commits, #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D64806 llvm-svn: 366433
* [CMake] Folder structure for generated Xcode project to cover more targetsStefan Granitz2019-05-281-2/+2
| | | | llvm-svn: 361799
* [CMake] Fix subtle CMake bugAlex Langford2019-04-291-1/+1
| | | | | | | | CMake specifies that the DEPENDS field of add_custom_target is for files and output of add_custom_command. In order to add a target dependency, add_dependencies should be used. llvm-svn: 359490
* [CMake] Make lldb-test-deps a dependency of check-lldbJonas Devlieghere2019-02-131-0/+3
| | | | | | | We have a custom target for lldb's test dependencies but it must have gotten lost in one of the recent CMake refactorings. llvm-svn: 353978
* [CMake] Fix lldb-test-depends targetJonas Devlieghere2019-01-171-1/+0
| | | | | | | | The lldb-test-depends target was using the old CMake variable name LLDB_TEST_DEPENDS instead of LLDB_TEST_DEPS. This patch moves the target definition and makes it use the correct one. llvm-svn: 351489
* [CMake] Revised LLDB.framework buildsStefan Granitz2019-01-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add features to LLDB CMake builds that have so far only been available in Xcode. Clean up a few inconveniences and prepare further improvements. Options: * `LLDB_FRAMEWORK_BUILD_DIR` determines target directory (in build-tree) * `LLDB_FRAMEWORK_INSTALL_DIR` **only** determines target directory in install-tree * `LLVM_EXTERNALIZE_DEBUGINFO` allows externalized debug info (dSYM on Darwin, emitted to `bin`) * `LLDB_FRAMEWORK_TOOLS` determines which executables will be copied to the framework's Resources (dropped symlinking, removed INCLUDE_IN_SUITE, removed dummy targets) Other changes: * clean up `add_lldb_executable()` * include `LLDBFramework.cmake` from `source/API/CMakeLists.txt` * use `*.plist.in` files, which are typical for CMake and independent from Xcode * add clang headers to the framework bundle Reviewers: xiaobai, JDevlieghere, aprantl, davide, beanz, stella.stamenova, clayborg, labath Reviewed By: aprantl Subscribers: friss, mgorny, lldb-commits, #lldb Differential Revision: https://reviews.llvm.org/D55328 llvm-svn: 350391
* [CMake] Streamline code signing for debugserver #2Stefan Granitz2019-01-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Major fixes after D54476 (use Diff1 as base for comparison to see only recent changes): * In standalone builds target directory for debugserver must be LLDB's bin, not LLVM's bin * Default identity for code signing must not force-override LLVM_CODESIGNING_IDENTITY globally We have a lot of cases, make them explicit: * ID used for code signing (debugserver and in tests): ** `LLDB_CODESIGN_IDENTITY` if set explicitly, or otherwise ** `LLVM_CODESIGNING_IDENTITY` if set explicitly, or otherwise ** `lldb_codesign` as the default * On Darwin we have a debugserver target that: * On other systems, the debugserver target is not defined, which is equivalent to **[3A]** Common configurations on Darwin: * **[1A]** `cmake -GNinja ../llvm` builds debugserver from source and signs with `lldb_codesign`, no code signing for other binaries (prints status: //lldb debugserver: /path/to/bin/debugserver//) * **[1A]** `cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- -DLLDB_CODESIGN_IDENTITY=lldb_codesign ../llvm` builds debugserver from source and signs with `lldb_codesign`, ad-hoc code signing for other binaries (prints status: //lldb debugserver: /path/to/bin/debugserver//) * **[2A]** `cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- -DLLDB_USE_SYSTEM_DEBUGSERVER=ON ../llvm` copies debugserver from system, ad-hoc code signing for other binaries (prints status: //Copy system debugserver from: /path/to/system/debugserver//) * **[2B]** `cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- ../llvm` same, but prints additional warning: //Cannot code sign debugserver with identity '-'. Will fall back to system's debugserver. Pass -DLLDB_CODESIGN_IDENTITY=lldb_codesign to override the LLVM value for debugserver.// * **[3A]** `cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- -DLLDB_NO_DEBUGSERVER=ON ../llvm` debugserver not available (prints status: //lldb debugserver will not be available)// Reviewers: JDevlieghere, beanz, davide, vsk, aprantl, labath Reviewed By: JDevlieghere, labath Subscribers: mgorny, #lldb, lldb-commits Differential Revision: https://reviews.llvm.org/D55013 llvm-svn: 350388
* Revert "[CMake] Streamline code signing for debugserver and pass ↵Davide Italiano2018-11-271-2/+2
| | | | | | | | entitlements to extended llvm_codesign" It breaks the lldb cmake bots. llvm-svn: 347619
OpenPOWER on IntegriCloud