summaryrefslogtreecommitdiff
path: root/lldb/packages/Python/lldbsuite/test/make
AgeCommit message (Collapse)Author
2025-11-17[LLDB] Fix test compilation errors under asan (NFC) (#168408)Adrian Prantl
https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake-sanitized/2744/consoleText
2025-11-06[NFCI][lldb][test] Enable GNU POSIX extensions where necessary (#166768)Raul Tambre
Otherwise these tests are reliant on the compiler defaulting to having the extensions on. Rest of LLVM's codebase doesn't seem to make such assumptions. Tested by building with `-std=c2y` in Clang's C frotend's config file.
2025-11-05[LLDB] Fix typoAdrian Prantl
2025-11-04[LLDB] Run API tests with PDB too (#149305)nerix
From https://github.com/llvm/llvm-project/pull/148554#issuecomment-3083261858 - this adds an option for API tests to be run with the both PDB readers on Windows. As there are a lot of failures with PDB, this is an opt-in per test. To get PDB, `-g -gcodeview` has to be used on Clang. `-gcodeview` alone isn't enough, because it won't cause clang to pass `-debug` to the linker. #149498 tracks the (currently) failing tests.
2025-10-31[LLDB] Fix ASAN tests on newer versions of macOS (#165883)Adrian Prantl
macOS forbids injecting the ASAN runtime into system processes when SIP is enabled. That includes the just-built libLTO that the just-built clang injects into the system linker. Since we don't test the compiler here, just use the system (non-asanified) LTO library to make ASAN tests work for most users, including the bots.
2025-10-28[lldb][test] When an external stdlib is specified do not link to the system ↵Ebuka Ezike
stdlib (#164462) On linux if you specify the an external libc++ and clang will still link to the system's libc++. This patch fixes that. Fixes https://github.com/llvm/llvm-project/issues/116040
2025-08-25[lldb][DataFormatters] Support newer _LIBCPP_COMPRESSED_PAIR layout (#155153)Michael Buch
Starting with https://github.com/llvm/llvm-project/pull/154686 the compressed_pair children are now wrapped in an anonymous structure. This patch adjusts the LLDB data-formatters to support that. Outstanding questions: 1. Should GetChildMemberWithName look through anonymous structures? That will break users most likely. But maybe introducing a new API is worth it? Then we wouldnt have to do this awkward passing around of `anon_struct_index` 2. Do we support the layout without the anonymous structure? It's not too much added complexity. And we did release that version of libc++, so there is code out there compiled against it. But there is no great way of testing it (some of our macOS matrix bots do test it i suppose, but not in a targeted way). We have the layout "simulator" tests for some of the STL types which I will adjust.
2025-08-24[lldb][test][NFC] Re-arrange ifdefs in compressed_pair.hMichael Buch
In an upcoming patch we'll start supporting a new compressed_pair layout. This refactor will make it easier to add tests for that new layout.
2025-07-31[lldb] Support Darwin cross compilation for remote Linux test suite runs ↵Jonas Devlieghere
(#151403) Fix cross-compilation of test inferiors on Darwin, targeting remote Linux. This requires specifying the target triple and using LLD for linking. Fixes #150806
2025-07-15[LLDB] Compile API tests with exceptions enabled on Windows (#148691)nerix
From #148554 - compile tests with exceptions on Windows (`-fno-exceptions` was added 11 years ago in c7826524acda6a9c8816261d5c48b94dc92935ed). The variant test uses `try {} catch {}` to create variants that are valueless by exception. On other platforms, exceptions are enabled as well. I have no clue why compiling with exceptions will optimize out `a_long_guy` in the changed test (even with `-O0`). Taking the address of that value will ensure it's kept.
2025-07-03[lldb][test] Synchronize `__compressed_pair_padding` with libc++ (#142516)A. Jiang
This PR mirrors changes of `__compressed_pair_padding` in libc++ into lldb test suite. Related PR for libc++: - #108956 - #109028 - #142125
2025-06-24Reland "[lldb] Add count for number of DWO files loaded in statistics ↵qxy11
#144424" (#145572) This relands changes in #144424 for adding a count of DWO files parsed/loaded and the total number of DWO files. The previous PR was reverted in #145494 due to the newly added unit tests failing on Windows and MacOS CIs since these platforms don't support DWO. This change add an additional `@add_test_categories(["dwo"])` to the new tests to [skip](https://github.com/llvm/llvm-project/blob/cd46354dbd10820158edabe14dbd49d9f9010722/lldb/packages/Python/lldbsuite/test/test_categories.py#L56) these tests on Windows/MacOS. Original PR: #144424 ### Testing Ran unit tests ``` $ bin/lldb-dotest -p TestStats.py llvm-project/lldb/test/API/commands/statistics/basic/ ---------------------------------------------------------------------- Ran 24 tests in 211.391s OK (skipped=3) ```
2025-06-24Revert "[lldb] Add count for number of DWO files loaded in statistics" (#145494)Michael Buch
Reverts llvm/llvm-project#144424 Caused CI failures. macOS CI failure was: ``` 10:20:36 FAIL: test_dwp_dwo_file_count (TestStats.TestCase) 10:20:36 Test "statistics dump" and the loaded dwo file count. 10:20:36 ---------------------------------------------------------------------- 10:20:36 Traceback (most recent call last): 10:20:36 File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/commands/statistics/basic/TestStats.py", line 639, in test_dwp_dwo_file_count 10:20:36 self.assertEqual(debug_stats["totalDwoFileCount"], 2) 10:20:36 AssertionError: 0 != 2 10:20:36 Config=arm64-/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang 10:20:36 ====================================================================== 10:20:36 FAIL: test_no_debug_names_eager_loads_dwo_files (TestStats.TestCase) 10:20:36 Test the eager loading behavior of DWO files when debug_names is absent by 10:20:36 ---------------------------------------------------------------------- 10:20:36 Traceback (most recent call last): 10:20:36 File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/commands/statistics/basic/TestStats.py", line 566, in test_no_debug_names_eager_loads_dwo_files 10:20:36 self.assertEqual(debug_stats["totalDwoFileCount"], 2) 10:20:36 AssertionError: 0 != 2 10:20:36 Config=arm64-/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang 10:20:36 ====================================================================== 10:20:36 FAIL: test_split_dwarf_dwo_file_count (TestStats.TestCase) 10:20:36 Test "statistics dump" and the dwo file count. 10:20:36 ---------------------------------------------------------------------- 10:20:36 Traceback (most recent call last): 10:20:36 File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/commands/statistics/basic/TestStats.py", line 588, in test_split_dwarf_dwo_file_count 10:20:36 self.assertEqual(len(debug_stats["modules"]), 1) 10:20:36 AssertionError: 42 != 1 10:20:36 Config=arm64-/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang ```
2025-06-23[lldb] Add count for number of DWO files loaded in statistics (#144424)qxy11
## Summary A new `totalLoadedDwoFileCount` and `totalDwoFileCount` counters to available statisctics when calling "statistics dump". 1. `GetDwoFileCounts ` is created, and returns a pair of ints representing the number of loaded DWO files and the total number of DWO files, respectively. An override is implemented for `SymbolFileDWARF` that loops through each compile unit, and adds to a counter if it's a DWO unit, and then uses `GetDwoSymbolFile(false)` to check whether the DWO file was already loaded/parsed. 3. In `Statistics`, use `GetSeparateDebugInfo` to sum up the total number of loaded/parsed DWO files along with the total number of DWO files. This is done by checking whether the DWO file was already successfully `loaded` in the collected DWO data, anding adding to the `totalLoadedDwoFileCount`, and adding to `totalDwoFileCount` for all CU units. ## Expected Behavior - When binaries are compiled with split-dwarf and separate DWO files, `totalLoadedDwoFileCount` would be the number of loaded DWO files and `totalDwoFileCount` would be the total count of DWO files. - When using a DWP file instead of separate DWO files, `totalLoadedDwoFileCount` would be the number of parsed compile units, while `totalDwoFileCount` would be the total number of CUs in the DWP file. This should be similar to the counts we get from loading separate DWO files rather than only counting whether a single DWP file was loaded. - When not using split-dwarf, we expect both `totalDwoFileCount` and `totalLoadedDwoFileCount` to be 0 since no separate debug info is loaded. ## Testing **Manual Testing** On an internal script that has many DWO files, `statistics dump` was called before and after a `type lookup` command. The `totalLoadedDwoFileCount` increased as expected after the `type lookup`. ``` (lldb) statistics dump { ... "totalLoadedDwoFileCount": 29, } (lldb) type lookup folly::Optional<unsigned int>::Storage typedef std::conditional<true, folly::Optional<unsigned int>::StorageTriviallyDestructible, folly::Optional<unsigned int>::StorageNonTriviallyDestructible>::type typedef std::conditional<true, folly::Optional<unsigned int>::StorageTriviallyDestructible, folly::Optional<unsigned int>::StorageNonTriviallyDestructible>::type ... (lldb) statistics dump { ... "totalLoadedDwoFileCount": 2160, } ``` **Unit test** Added three unit tests that build with new "third.cpp" and "baz.cpp" files. For tests with w/ flags `-gsplit-dwarf -gpubnames`, this generates 2 DWO files. Then, the test incrementally adds breakpoints, and does a type lookup, and the count should increase for each of these as new DWO files get loaded to support these. ``` $ bin/lldb-dotest -p TestStats.py ~/llvm-sand/external/llvm-project/lldb/test/API/commands/statistics/basic/ ---------------------------------------------------------------------- Ran 20 tests in 211.738s OK (skipped=3) ```
2025-05-13[lldb] Move lldb_enable_attach from test_common to a separate header (#139550)Pavel Labath
test_common is force-included into every compilation, which causes problems when we're compiling assembly code, as we were in #138805. This avoids that as we can include the header only when it's needed.
2025-01-31[lldb] Add RISCV for Makefile.rules (#124758)kper
As discussed with @DavidSpickett in discord. Running the test runner caused the following issue: ``` gmake: Entering directory '/home/kper/oss/llvm-project/build/lldb-test-build.noindex/functionalities/thread/concurrent_events/TestConcurrentSignalWatch.test' /home/kper/oss/llvm-project/build/bin/clang++ -std=c++11 -g -O0 -mriscv -I/home/kper/oss/llvm-project/lldb/packages/Python/lldbsuite/test/make/../../../../..//include -I/home/kper/oss/llvm-project/build/tools/lldb/include -I/home/kper/oss/llvm-project/lldb/test/API/functionalities/thread/concurrent_events -I/home/kper/oss/llvm-project/lldb/packages/Python/lldbsuite/test/make -include /home/kper/oss/llvm-project/lldb/packages/Python/lldbsuite/test/make/test_common.h -fno-limit-debug-info --driver-mode=g++ -MT main.o -MD -MP -MF main.d -c -o main.o /home/kper/oss/llvm-project/lldb/test/API/functionalities/thread/concurrent_events/main.cpp clang++: error: unknown argument: '-mriscv' gmake: *** [Makefile.rules:619: main.o] Error 1 ``` By overriding the flags, we avoid the `-mriscv`.
2025-01-14[LLDB][LoongArch] Add LSX and LASX register definitions and operationswanglei
With this patch, vector registers can be read and written when debugging a live process. Note: We currently assume that all LoongArch64 processors include the LSX and LASX extensions. To add test cases, the following modifications were also made: lldb/packages/Python/lldbsuite/test/lldbtest.py lldb/packages/Python/lldbsuite/test/make/Makefile.rules Reviewed By: DavidSpickett, SixWeining Pull Request: https://github.com/llvm/llvm-project/pull/120664
2024-10-19[lldb][test][NFC] Document DYLIB_NAME Makefile variable (#112735)Michael Buch
Got caught out by this because simply specifying `DYLIB_CXX_SOURCES` (without specifying `DYLIB_NAME`) resulted in linker errors because the dylib was never built (and linked). We should probably make that a Makefile error (though I haven't audited when exactly not specifying `DYLIB_NAME` is valid; looked like that can happen when we specify `FRAMEWORK`).
2024-10-07Reland "[lldb][test] TestDataFormatterLibcxxStringSimulator.py: add new ↵Michael Buch
padding layout" (#111123) Relands https://github.com/llvm/llvm-project/pull/108375 which had to be reverted because it was failing on the Windows buildbot. Trying to reland this with `msvc::no_unique_address` on Windows.
2024-09-24lldb: get lldb API tests working with newer Android NDKsAndrew Rogers
## Purpose Running the LLDB API tests against a remote Android target with NDK version r22 or later fails to compile the test inferiors. NDK r21 from 2021 is the most recent NDK that still works with the LLDB API tests. This PR updates the Android make rules to support newer Android NDK versions (r19 and later). ## Overview * Updates and simplifies `Android.rules` to match the newer Android NDK unified toolchain layout introduced in NDK r19 * Sets `OBJCOPY` and `ARCHIVER` env vars, required by a few test cases, to their `llvm-` versions in the unified toolchain * Drops support for pre-2019 Android NDK versions to keep the rules simple * Provides an error message if the tests are run using an incompatible NDK layout ## Problem Details Android introduced a unified tools layout in NDK r19 (2019) and removed the old layout in r22 (2021). Releases r19, r20, and r21 support both the old and new layout side-by-side. More details are in #106270. ## Validation Ran a sub-set of the LLDB API tests against remote Android targets for the four primary architectures i386, x86_64, arm, and aarch64. No validation was done against riscv targets. For each case, ran the copy of `lldb-server` from the Android NDK on the device with the latest LLDB test cases in llvm-project Ran tests with both r19 (the oldest supported) and r26 (more recent, unified layout only) NDK versions. Example test command for aarch64: ``` ./build/bin/lldb-dotest --out-of-tree-debugserver --arch aarch64 --platform-name remote-android --platform-url connect://localhost:5432 --platform-working-dir /data/local/tmp --compiler=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/clang lldb/test/API/android/ ``` **NOTE: there are a lot of test failures when running the full suite (especially against 32-bit ARM target). These failures occur independent of this change.** Verified the expected error message appears when attempting to run using NDK r18 ``` Build Command Output: make: Entering directory '/home/andrew/src/llvm/llvm-project/build/lldb-test-build.noindex/android/platform/TestDefaultCacheLineSize.test_cache_line_size' /home/andrew/src/llvm/llvm-project/lldb/packages/Python/lldbsuite/test/make/Android.rules:16: *** "No unified toolchain sysroot found in /home/andrew/Android/Sdk/ndk/18.1.5063045/toolchains/llvm/prebuilt/linux-x86_64/bin/../../../../... NDK must be r19 or later.". Stop. make: Leaving directory '/home/andrew/src/llvm/llvm-project/build/lldb-test-build.noindex/android/platform/TestDefaultCacheLineSize.test_cache_line_size' ``` ## Impact **This change explicitly removes support for the pre-2019 NDK structure.** Only NDK r19 (from 2019) and later can be used when running the LLDB API tests. If the maintainers object, we can easily support both the old and new NDK toolchain layouts side-by-side at the cost of readability/maintainability. Since this change only impacts tests, I don't see much value in supporting NDKs that are over 5 years old. ## Guidance to Reviewers * I am not an expert on `clang` arguments so if anything looks off let me know. * While I personally thing supporting 5+ year old NDKs for testing seems unnecessary, please chime-in if you are concerned with dropping that support. I can easily revise to support both old and new layouts side-by-side. * If there are any specific tests you'd like me to run I will do my best to accommodate. It doesn't look like there's much (any?) Android LLDB CI coverage.
2024-09-16[lldb][test] Add a new __compressed_pair layout to libcxx simulator tests ↵Michael Buch
(#99012) This is a follow-up to https://github.com/llvm/llvm-project/pull/98330 for the upcoming `__compressed_pair` refactor in https://github.com/llvm/llvm-project/issues/93069 This patch just adds the 2 new copies of `_LIBCPP_COMPRESSED_PAIR` layouts to the simulator tests.
2024-09-11[lldb][test] Toolchain detection rewrite in Python (#102185)Vladislav Dzhidzhoev
This fix is based on a problem with cxx_compiler and cxx_linker macros on Windows. There was an issue with compiler detection in paths containing "icc". In such case, Makefile.rules thought it was provided with icc compiler. To solve that, utilities detection has been rewritten in Python. The last element of compiler's path is separated, taking into account the platform path delimiter, and compiler type is extracted, with regard of possible cross-toolchain prefix. --------- Co-authored-by: Pavel Labath <pavel@labath.sk>
2024-08-06[lldb][debuginfod] Fix the DebugInfoD PR that caused issues when working ↵Kevin Frei
with stripped binaries (#99362) @walter-erquinigo found the the [PR with testing and a fix for DebugInfoD](https://github.com/llvm/llvm-project/pull/98344) caused an issue when working with stripped binaries. The issue is that when you're working with split-dwarf, there are *3* possible files: The stripped binary the user is debugging, the "only-keep-debug" *or* unstripped binary, plus the `.dwp` file. The debuginfod plugin should provide the unstripped/OKD binary. However, if the debuginfod plugin fails, the default symbol locator plugin will just return the stripped binary, which doesn't help. So, to address that, the SymbolVendorELF code checks to see if the SymbolLocator's ExecutableObjectFile request returned the same file, and bails if that's the case. You can see the specific diff as the second commit in the PR. I'm investigating adding a test: I can't quite get a simple repro, and I'm unwilling to make any additional changes to Makefile.rules to this diff, for Pavlovian reasons.
2024-08-06[LLDB][test] Update Makefile.rules to support Windows host+Linux target (#99266)Vladislav Dzhidzhoev
These changes aim to support cross-compilation build on Windows host for Linux target for API tests execution. They're not final: changes will follow for refactoring and adjustments to make all tests pass. Chocolatey make is recommended to be used since it is maintained better than GnuWin32 mentioned here https://lldb.llvm.org/resources/build.html#windows (latest GnuWin32 release is dated by 2010) and helps to avoid problems with building tests (for example, GnuWin32 make doesn't support long paths and there are some other failures with building for Linux with it). Co-authored-by: Pavel Labath <pavel@labath.sk>
2024-07-19[LLDB][test] Improve SHELL detection on Windows in Makefile.rules (#99532)Vladislav Dzhidzhoev
In MinGW make, the `%windir%` variable has a lowercase name `$(windir)` when launched from cmd.exe, and `$(WINDIR)` name when launched from MSYS2, since MSYS2 represents standard Windows environment variables names in upper case. This commit makes Makefile.rules consider both run variants.
2024-07-18[LLDB][test] Drop OS/HOST_OS detection code from Makefile.rules (#99535)Vladislav Dzhidzhoev
Remove commands for OS/HOST_OS detection from Makefile.rules to simplify it, since logic for these variables has been implemented in `lldb/packages/Python/lldbsuite/test/lldbplatformutil.py` (7021e44b2f0e11717c0d82456bad0fed4a0b48f9).
2024-07-16[lldb][test] Add a layout simulator test for std::unique_ptr (#98330)Michael Buch
This is motivated by the upcoming refactor of libc++'s `__compressed_pair` in https://github.com/llvm/llvm-project/pull/76756 As this will require changes to numerous LLDB libc++ data-formatters (see early draft https://github.com/llvm/llvm-project/pull/96538), it would be nice to have a test-suite that will actually exercise both the old and new layout. We have a matrix bot that tests old versions of Clang (but currently those only date back to Clang-15). Having them in the test-suite will give us quicker signal on what broke. We have an existing test that exercises various layouts of `std::string` over time in `TestDataFormatterLibcxxStringSimulator.py`, but that's the only STL type we have it for. This patch proposes a new `libcxx-simulators` directory which will take the same approach for all the STL types that we can feasibly support in this way (as @labath points out, for some types this might just not be possible due to their implementation complexity). Nonetheless, it'd be great to have a record of how the layout of libc++ types changed over time. Some related discussion: * https://github.com/llvm/llvm-project/pull/97568#issuecomment-2213426804
2024-07-15[LLDB] Revert #98351 and #98344walter erquinigo
This reverts commit 2fa1220a37a3f55b76a29803d8333b3a3937d53a. This reverts commit b9496a74eb4029629ca2e440c5441614e766f773. The patch #98344 causes a crash in LLDB when parsing some files like `numpy.libs/libgfortran-daac5196.so.5.0.0` on graviton (you can download it in https://drive.google.com/file/d/12ygLjJwWpzdYsrzBPp1JGiFHxcgM0-XY/view?usp=drive_link if you want to troubleshoot yourself). The assert that is hit is the following: ``` llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2452: std::pair<unsigned int, std::map<long unsigned int, lldb_private::AddressClass> > ObjectFileELF::ParseSymbolTable(lldb_private::Symtab*, lldb::user_id_t, lldb_private::Section*): Assertion `strtab->GetObjectFile() == this' failed. [383588:383636:20240716,025305.572639:ERROR crashpad_client_linux.cc:780] Crashpad isn't enabled ``` This object file doesn't have apparently a strings table but LLDB still tries to process it due to the code that is being reverted.
2024-07-10[lldb] DebugInfoD tests & fixes (but with dwp testing disabled) (#98344)Kevin Frei
This is all the tests and fixes I've had percolating since my first attempt at this in January. After 6 months of trying, I've given up on adding the ability to test DWP files in LLDB API tests. I've left both the tests (disabled) and the changes to Makefile.rules in place, in the hopes that someone who can configure the build bots will be able to enable the tests once a non-borked dwp tool is widely available. Other than disabling the DWP tests, this continues to be the same diff that I've tried to land and [not](https://github.com/llvm/llvm-project/pull/90622) [revert](https://github.com/llvm/llvm-project/pull/87676) [five](https://github.com/llvm/llvm-project/pull/86812) [times](https://github.com/llvm/llvm-project/pull/85693) [before](https://github.com/llvm/llvm-project/pull/96802). There are a couple of fixes that the testing exposed, and I've abandoned the DWP tests because I want to get those fixes finally upstreamed, as without them DebugInfoD is less useful.
2024-07-10[lldb][test] Set target and host OS for API tests in case of remote testingVladislav Dzhidzhoev
Makefile.rules uses HOST_OS and OS variables for determining host and target OSes for API tests compilation. This commit moves the platform detection logic from Makefile to Python lldb test suite. This is useful for the case of Windows-to-Linux cross-testing.
2024-07-08Revert "[LLDB] DebugInfoD tests: attempt to fix Fuchsia build" (#98101)Kevin Frei
Reverts llvm/llvm-project#96802 Attempt #5 fails. It's been 6 months. I despise Makefile.rules and have no ability to even *detect* these failures without _landing_ a diff. In the mean time, we have no testing for DWP files at all (and a regression that was introduced, that I fix with this diff) so I'm going to just remove some of the tests and try to land it again, but with less testing I guess.
2024-07-08[LLDB] DebugInfoD tests: attempt to fix Fuchsia build (#96802)Kevin Frei
This is the same diff I've put up at many times before. I've been trying to add some brand new functionality to the LLDB test infrastucture (create split-dwarf files!), and we all know that no good deed goes unpunished. The last attempt was reverted because it didn't work on the Fuchsia build. There are no code differences between this and [the](https://github.com/llvm/llvm-project/pull/90622) [previous](https://github.com/llvm/llvm-project/pull/87676) [four](https://github.com/llvm/llvm-project/pull/86812) [diffs](https://github.com/llvm/llvm-project/pull/85693) landed & reverted (due to testing infra failures). The only change in this one is the way `dwp` is being identified in `Makefile.rules`. Thanks to @petrhosek for helping me figure out how the fuchsia builders are configured. I now prefer to use llvm-dwp and fall back to gnu's dwp if the former isn't found. Hopefully this will work everywhere it needs to.
2024-05-22Revert "[lldb] Added Debuginfod tests and fixed a couple issues" (#93094)Daniel Thornburgh
Reverts llvm/llvm-project#92572 due to Fuchsia CI breakages (using CLI tools in tests that weren't necessarily built).
2024-05-22[lldb] Added Debuginfod tests and fixed a couple issues (#92572)Kevin Frei
Here we go with attempt number five. Again, no changes to the LLDB code diff, which has been reviewed several times. For the tests, I added a `@skipIfCurlSupportMissing` annotation so that the Debuginfod mocked server stuff won't run, and I also disabled non-Linux/FreeBSD hosts altogether, as they fail for platform reasons on macOS and Windows. In addition, I updated the process for extracting the GNU BuildID to no create a target, per some feedback on the previous diff. For reference, previous PR's (landed, backed out after the fact for various reasons) #90622, #87676, #86812, #85693 --------- Co-authored-by: Kevin Frei <freik@meta.com>
2024-05-03Revert "[lldb] Fix TestSharedLibStrippedSymbols for #90622"David Spickett
And "LLDB Debuginfod tests and a fix or two (#90622)". f8fedfb6802173372ec923f99f31d4af810fbcb0 / 2d4acb086541577ac6ab3a140b9ceb9659ce7094 As it has caused a test failure on 32 bit Arm: https://lab.llvm.org/buildbot/#/builders/17/builds/52580 Expr/TestStringLiteralExpr.test. The follow up did fix lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py but not the other failure.
2024-05-03[lldb] Fix TestSharedLibStrippedSymbols for #90622Pavel Labath
`ifeq` needs to be at the beginning of a line, otherwise it's interpreted as part of the recipe.
2024-05-02LLDB Debuginfod tests and a fix or two (#90622)Kevin Frei
I'm taking yet another swing at getting these tests going, on the hypothesis that the problems with buildbots & whatnot are because they're not configured with CURL support, which I've confirmed would cause the previous tests to fail. (I have no access to an ARM64 linux system, but I did repro the failure on MacOS configured without CURL support) So, the only difference between this diff and [previous](https://github.com/llvm/llvm-project/pull/85693) [diffs](https://github.com/llvm/llvm-project/pull/87676) that have already been approved is that I've added a condition to the tests to only run if Debuginfod capabilities should be built into the binary. I had done this for these tests when they were [Shell tests](https://github.com/llvm/llvm-project/pull/79181) and not API tests, but I couldn't find a direct analog in any API test, so I used the "plugins" model used by the intel-pt tests as well. --------- Co-authored-by: Kevin Frei <freik@meta.com>
2024-05-01Install generated API headers into LLDB.framework (#90666)Adrian Prantl
2024-04-04Revert "Debuginfod Testing & fixes: 3rd times the charm? (#87676)"Shubham Rastogi
This reverts commit d6713ad80d6907210c629f22babaf12177fa329c. This changed was reverted because of greendragon failures such as Unresolved Tests (2): lldb-api :: debuginfod/Normal/TestDebuginfod.py lldb-api :: debuginfod/SplitDWARF/TestDebuginfodDWP.py
2024-04-04Debuginfod Testing & fixes: 3rd times the charm? (#87676)Kevin Frei
I believe I've got the tests properly configured to only run on Linux x86(_64), as I don't have a Linux AArch64/Arm device to diagnose what's going wrong with the tests (I suspect there's some issue with generating `.note.gnu.build-id` sections...) The actual code fixes have now been reviewed 3 times: https://github.com/llvm/llvm-project/pull/79181 (moved shell tests to API tests), https://github.com/llvm/llvm-project/pull/85693 (Changed some of the testing infra), and https://github.com/llvm/llvm-project/pull/86812 (didn't get the tests configured quite right). The Debuginfod integration for symbol acquisition in LLDB now works with the `executable` and `debuginfo` Debuginfod network requests working properly for normal, `objcopy --only-keep-debug` stripped, split-dwarf, and `objcopy --only-keep-debug` stripped *plus* split-dwarf symbols/binaries. The reasons for the multiple attempts have been tests on platforms I don't have access to (Linux AArch64/Arm + MacOS x86_64). I believe I've got the tests properly disabled for everything except for Linux x86(_64) now. I've built & tested on MacOS AArch64 and Linux x86_64. --------- Co-authored-by: Kevin Frei <freik@meta.com>
2024-04-03Revert "DebugInfoD issues, take 2" (#87583)Chelsea Cassanova
Reverts llvm/llvm-project#86812. This commit caused a regression on the x86_64 MacOS buildbot: https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake/784/
2024-04-03DebugInfoD issues, take 2 (#86812)Kevin Frei
The previous diff (and it's subsequent fix) were reverted as the tests didn't work properly on the AArch64 & ARM LLDB buildbots. I made a couple more minor changes to tests (from @clayborg's feedback) and disabled them for non Linux-x86(_64) builds, as I don't have the ability do anything about an ARM64 Linux failure. If I had to guess, I'd say the toolchain on the buildbots isn't respecting the `-Wl,--build-id` flag. Maybe, one day, when I have a Linux AArch64 system I'll dig in to it. From the reverted PR: I've migrated the tests in my https://github.com/llvm/llvm-project/pull/79181 from shell to API (at @JDevlieghere's suggestion) and addressed a couple issues that were exposed during testing. The tests first test the "normal" situation (no DebugInfoD involvement, just normal debug files sitting around), then the "no debug info" situation (to make sure the test is seeing failure properly), then it tests to validate that when DebugInfoD returns the symbols, things work properly. This is duplicated for DWP/split-dwarf scenarios. --------- Co-authored-by: Kevin Frei <freik@meta.com>
2024-03-23Revert "DebugInfoD tests + fixing issues exposed by tests (#85693)"Muhammad Omair Javaid
This reverts commit 6d939a6ec69adf284cdbef2034b49fd02ba503fc. This broke following LLDB bots: https://lab.llvm.org/buildbot/#/builders/96/builds/54867 https://lab.llvm.org/buildbot/#/builders/17/builds/50824
2024-03-21DebugInfoD tests + fixing issues exposed by tests (#85693)Kevin Frei
Finally getting back to Debuginfod tests: I've migrated the tests in my [earlier PR](https://github.com/llvm/llvm-project/pull/79181) from shell to API (at @JDevlieghere's suggestion) and addressed a couple issues that came about during testing. The tests first test the "normal" situation (no DebugInfoD involvement, just normal debug files sitting around), then the "no debug info" situation (to make sure the test is seeing failure properly), then it tests to validate that when Debuginfod returns the symbols, things work properly. This is duplicated for DWP/split-dwarf scenarios. --------- Co-authored-by: Kevin Frei <freik@meta.com>
2023-11-12[lldb][test] Implement getting thread ID on OpenBSD (#71129)Brad Smith
2023-11-03[lldb] Use get-task-allow entitlement on macOS too (#71112)Daniel Thornburgh
Running the LLDB test suite in a GUI-less macOS environment (say, ssh) requires that the debugged tasks be signed with the get-task-allow entitlement.
2023-03-28[lldb] Support Universal Mach-O binaries with a fat64 headerJonas Devlieghere
Support universal Mach-O binaries with a fat64 header. After 4d683f7fa7d4, dsymutil can now generate such binaries when the offsets would otherwise overflow the 32-bit offsets in the regular fat header. rdar://107289570 Differential revision: https://reviews.llvm.org/D147012
2023-03-23Android.rules: remove mips* rulesFangrui Song
They have been obsoleted for a long time and D146565 recently removed Clang support.
2023-03-23[lldb] Explicitly set libcxx paths when USE_SYSTEM_STDLIB is providedFelipe de Azevedo Piovezan
For tests marked as "USE_SYSTEM_STDLIB", the expectation is that the system's standard library should be used. However, the implementation of this flag is such that we simply don't pass _any_ libcxxx-related flags to Clang; in turn, Clang will use its defaults. For a Clang/Libcxx pair compiled together, Clang defaults to: 1. The headers of the sibling libcxx. 2. The libraries of the system. This mismatch is actually a bug in the driver; once fixed, however, (2) would point to the sibling libcxx as well, which is _not_ what test authors intended with the USE_SYSTEM_STDLIB flag. As such, this patch explicitly sets a path to the system's libraries. This change is done only in Apple platforms so that we can test this works in this case first. Differential Revision: https://reviews.llvm.org/D146714
2022-10-26[test] Fix LLDB tests with just-built libcxx when using a target directory.Jordan Rupprecht
In certain configurations, libc++ headers all exist in the same directory, and libc++ binaries exist in the same directory as lldb libs. When `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` is enabled (*and* the host is not Apple, which is why I assume this wasn't caught by others?), this is not the case: most headers will exist in the usual `include/c++/v1` directory, but `__config_site` exists in `include/$TRIPLE/c++/v1`. Likewise, the libc++.so binary exists in `lib/$TRIPLE/`, not `lib/` (where LLDB libraries reside). This also adds the just-built-libcxx functionality to the lldb-dotest tool. The `LIBCXX_` cmake config is borrowed from `libcxx/CMakeLists.txt`. I could not figure out a way to share the cmake config; ideally we would reuse the same config instead of copy/paste. Reviewed By: JDevlieghere, fdeazeve Differential Revision: https://reviews.llvm.org/D133973