[Lldb-commits] [lldb] [lldb/Commands] Add `scripting template list` command with auto discovery (PR #97273)
mysterymath wrote: The reland broke the Fuchsia Windows build with a similar error to the LLVM Windows bots, but I wasn't able to cleanly revert this commit without detailed knowledge of the contents. Could you revert this (preferentially) or fix forward? https://github.com/llvm/llvm-project/pull/97273 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Added Debuginfod tests and fixed a couple issues (PR #92572)
mysterymath wrote: This broke the Fuchsia CI builders' LLDB test suite: https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8747217173107569041/overview ``` FAIL: LLDB (/b/s/w/ir/x/w/llvm_build/bin/clang-x86_64) :: test_normal_stripped_split_with_dwp (TestDebuginfodDWP.DebugInfodDWPTests.test_normal_stripped_split_with_dwp) == ERROR: test_debuginfod_both_okd_symfiles_from_service (TestDebuginfodDWP.DebugInfodDWPTests.test_debuginfod_both_okd_symfiles_from_service) Test behavior with both the only-keep-debug symbols and the dwp symbols -- Error when building test subject. ``` ``` == ERROR: test_expr_dwarf (TestSharedLibStrippedSymbols.SharedLibStrippedTestCase.test_expr_dwarf) Test that types work when defined in a shared library and forwa/d-declared in the main executable -- Error when building test subject. ... ifeq "" "YES" /bin/sh: 1: ifeq: not found make: *** [Makefile.rules:631: libfoo.so] Error 127 make: Leaving directory '/b/s/w/ir/x/w/llvm_build/lldb-test-build.noindex/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.test_expr_dwarf' https://github.com/llvm/llvm-project/pull/92572 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Revert "[lldb] Added Debuginfod tests and fixed a couple issues" (PR #93094)
https://github.com/mysterymath created https://github.com/llvm/llvm-project/pull/93094 Reverts llvm/llvm-project#92572 due to Fuchsia CI breakages (using CLI tools in tests that weren't necessarily built). >From daa63e1870999e8ca8db454a788a0720740d194a Mon Sep 17 00:00:00 2001 From: Daniel Thornburgh Date: Wed, 22 May 2024 13:54:32 -0700 Subject: [PATCH] Revert "[lldb] Added Debuginfod tests and fixed a couple issues (#92572)" This reverts commit e558d21e87882d40e29d858b1269ee8f1ddf2a38. --- lldb/include/lldb/Host/Config.h.cmake | 2 - .../Python/lldbsuite/test/decorators.py | 4 - .../Python/lldbsuite/test/make/Makefile.rules | 26 +-- lldb/source/API/SBDebugger.cpp| 13 +- .../SymbolFile/DWARF/SymbolFileDWARF.cpp | 38 ++-- .../Plugins/SymbolLocator/CMakeLists.txt | 7 +- .../SymbolVendor/ELF/SymbolVendorELF.cpp | 29 +-- lldb/test/API/debuginfod/Normal/Makefile | 19 -- .../API/debuginfod/Normal/TestDebuginfod.py | 186 - lldb/test/API/debuginfod/Normal/main.c| 7 - lldb/test/API/debuginfod/SplitDWARF/Makefile | 23 -- .../SplitDWARF/TestDebuginfodDWP.py | 196 -- lldb/test/API/debuginfod/SplitDWARF/main.c| 7 - 13 files changed, 22 insertions(+), 535 deletions(-) delete mode 100644 lldb/test/API/debuginfod/Normal/Makefile delete mode 100644 lldb/test/API/debuginfod/Normal/TestDebuginfod.py delete mode 100644 lldb/test/API/debuginfod/Normal/main.c delete mode 100644 lldb/test/API/debuginfod/SplitDWARF/Makefile delete mode 100644 lldb/test/API/debuginfod/SplitDWARF/TestDebuginfodDWP.py delete mode 100644 lldb/test/API/debuginfod/SplitDWARF/main.c diff --git a/lldb/include/lldb/Host/Config.h.cmake b/lldb/include/lldb/Host/Config.h.cmake index 9e538534086a2..3defa454f6d42 100644 --- a/lldb/include/lldb/Host/Config.h.cmake +++ b/lldb/include/lldb/Host/Config.h.cmake @@ -33,8 +33,6 @@ #cmakedefine01 LLDB_ENABLE_LZMA -#cmakedefine01 LLVM_ENABLE_CURL - #cmakedefine01 LLDB_ENABLE_CURSES #cmakedefine01 CURSES_HAVE_NCURSES_CURSES_H diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py index b4ac3bdabac86..79cc0a2aeacbe 100644 --- a/lldb/packages/Python/lldbsuite/test/decorators.py +++ b/lldb/packages/Python/lldbsuite/test/decorators.py @@ -1055,10 +1055,6 @@ def _get_bool_config_skip_if_decorator(key): return unittest.skipIf(not have, "requires " + key) -def skipIfCurlSupportMissing(func): -return _get_bool_config_skip_if_decorator("curl")(func) - - def skipIfCursesSupportMissing(func): return _get_bool_config_skip_if_decorator("curses")(func) diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index 2cbc918ebbaeb..bd8eea3d6f5a0 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -51,7 +51,7 @@ LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../ # # GNUWin32 uname gives "windows32" or "server version windows32" while # some versions of MSYS uname return "MSYS_NT*", but most environments -# standardize on "Windows_NT", so we'll make it consistent here. +# standardize on "Windows_NT", so we'll make it consistent here. # When running tests from Visual Studio, the environment variable isn't # inherited all the way down to the process spawned for make. #-- @@ -210,12 +210,6 @@ else ifeq "$(SPLIT_DEBUG_SYMBOLS)" "YES" DSYM = $(EXE).debug endif - - ifeq "$(MAKE_DWP)" "YES" - MAKE_DWO := YES - DWP_NAME = $(EXE).dwp - DYLIB_DWP_NAME = $(DYLIB_NAME).dwp - endif endif LIMIT_DEBUG_INFO_FLAGS = @@ -364,7 +358,6 @@ ifneq "$(OS)" "Darwin" OBJCOPY ?= $(call replace_cc_with,objcopy) ARCHIVER ?= $(call replace_cc_with,ar) - DWP ?= $(call replace_cc_with,dwp) override AR = $(ARCHIVER) endif @@ -535,10 +528,6 @@ ifneq "$(CXX)" "" endif endif -ifeq "$(GEN_GNU_BUILD_ID)" "YES" - LDFLAGS += -Wl,--build-id -endif - #-- # DYLIB_ONLY variable can be used to skip the building of a.out. # See the sections below regarding dSYM file as well as the building of @@ -577,17 +566,10 @@ else endif else ifeq "$(SPLIT_DEBUG_SYMBOLS)" "YES" -ifeq "$(SAVE_FULL_DEBUG_BINARY)" "YES" - cp "$(EXE)" "$(EXE).unstripped" -endif $(OBJCOPY) --only-keep-debug "$(EXE)" "$(DSYM)" $(OBJCOPY) --strip-debug --add-gnu-debuglink="$(DSYM)" "$(EXE)" "$(EXE)" endif -ifeq "$(MAKE_DWP)" "YES" - $(DWP) -o "$(DWP_NAME)" $(DWOS) endif -endif - #-- # Make the dylib @@ -629,15 +611,9 @@ endif else $(LD)
[Lldb-commits] [lldb] Revert "[lldb] Added Debuginfod tests and fixed a couple issues" (PR #93094)
https://github.com/mysterymath closed https://github.com/llvm/llvm-project/pull/93094 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [clang] [compiler-rt] [lldb] [llvm] [Support] Remove terminfo dependency (PR #92865)
mysterymath wrote: I did some brief investigation on our end. The pkg-config file for libedit includes a private dependency on libncurses, which provides the terminfo functions. The issue here seems to be one uncovered in LLVM's FindLibEdit.cmake. We're building against a static libedit, but that doesn't use the LibEdit_STATIC_LIBRARIES variable that would be aware of the private dependency of libedit on libncurses. We build everything as statically as we can, which is probably why we're the first to notice. @petrhosek mentioned that we've had to deal with similar concerns with ZSTD. I'll take a look at seeing if there's a straightforward to update FindLibEdit.cmake to handle this case. https://github.com/llvm/llvm-project/pull/92865 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Use packaging module instead of pkg_resources (PR #93712)
mysterymath wrote: At least at present, this will probably break Fuchsia's build; the Python we ship includes `pkg_resources` but not `packaging`. Is the default `cpython` build from source intended to build and install `packaging`? Is this something that changed recently? https://github.com/llvm/llvm-project/pull/93712 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Use packaging module instead of pkg_resources (PR #93712)
mysterymath wrote: We don't have `pexpect` either; instead the tests that require it are disabled. Our build is as hermetic as possible; even if the package were available in the Python on the bots, we wouldn't be able to use it, since we don't make use of the Python on the bots, for the most part. Instead, we build and ship a CPython from source as part of the bot build. So far we've avoided providing or requiring any additional Python dependencies, since we have relatively strict requirements for software chain of custody. We'd probably need to figure out a way to build `packaging` from source and to set up a source mirror for it. The previous status quo of checking Python deps into the LLVM monorepo had helped us a lot. https://github.com/llvm/llvm-project/pull/93712 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Use packaging module instead of pkg_resources (PR #93712)
mysterymath wrote: Did a bit of digging around; it looks like at the very least the Arch Linux python package and the Python docker container don't contain the `packaging` library. https://github.com/llvm/llvm-project/pull/93712 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Use packaging module instead of pkg_resources (PR #93712)
mysterymath wrote: > We have other packages the test suite relies on (pexpect, psutil, etc) so it > seemed reasonable, but if folks feel strongly about it we can maintain our > own "version parsing". Notably the other packages are optional; the lion's share of the test suite can be run without them. Cursorily it looks like this wouldn't be the case here? Admittedly, Fuchsia is the reason at least one of those callouts has been added; we've struggled reigning in LLVM/LLDB's deps due to the manual nature of our build scripts and bureaucratic hassles involved in taking on new deps. But it might be a good idea to have a broader discussion about what the mandatory dep story is/should be for parts of LLVM, rather than doing this piecemeal on patches like this. https://github.com/llvm/llvm-project/pull/93712 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Use packaging module instead of pkg_resources (PR #93712)
mysterymath wrote: @JDevlieghere , we just landed a patch that adds packaging for Fuchsia. Should be good to go ahead. https://github.com/llvm/llvm-project/pull/93712 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Support Unicode in the prompt (PR #66312)
mysterymath wrote: I dug into this a little bit; it looks like the autodetection for `LLDB_EDITLINE_USE_WCHAR` was broken on our build, so it was turned `OFF`, even though our libedit supports the wchar API. I can fix this on our end, but more generally, is there a way to condition this test on the value of that define? It seems like this wouldn't work otherwise, although I'm very fuzzy on the precise semantics of Unicode in editline/LLDB. https://github.com/llvm/llvm-project/pull/66312 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add config and decorator for wide character support in Editline (PR #66447)
@@ -781,6 +781,9 @@ SBStructuredData SBDebugger::GetBuildConfiguration() { AddBoolConfigEntry( *config_up, "editline", LLDB_ENABLE_LIBEDIT, "A boolean value that indicates if editline support is enabled in LLDB"); + AddBoolConfigEntry( + *config_up, "editline_wchar", LLDB_EDITLINE_USE_WCHAR, + "A boolean value that indicates if editline wide characters support is enabled in LLDB"); mysterymath wrote: nit: extra space between "editline" and "wide" https://github.com/llvm/llvm-project/pull/66447 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add config and decorator for wide character support in Editline (PR #66447)
https://github.com/mysterymath approved this pull request. https://github.com/llvm/llvm-project/pull/66447 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Fix a bug with cancelling "attach -w" after you have run a process previously (PR #65822)
mysterymath wrote: It looks like this is breaking buildbots: https://lab.llvm.org/buildbot/#/builders/68/builds/60267 The test can't find `main.cpp`, and it looks like the immediately preceding test issues an `os.chdir`. It has a hook to reset it, but maybe there's some problem with it? https://github.com/llvm/llvm-project/pull/65822 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 7f34674 - Revert "Remove some raciness from the TestProcessAttach.test_run_then_attach_wait_interrupt"
Author: Daniel Thornburgh Date: 2023-09-20T14:30:24-07:00 New Revision: 7f3467412ed52d6749b7c53f7934c4374c6d2a00 URL: https://github.com/llvm/llvm-project/commit/7f3467412ed52d6749b7c53f7934c4374c6d2a00 DIFF: https://github.com/llvm/llvm-project/commit/7f3467412ed52d6749b7c53f7934c4374c6d2a00.diff LOG: Revert "Remove some raciness from the TestProcessAttach.test_run_then_attach_wait_interrupt" This reverts commit df93c4ffdf220630ecceba5c9a7822c0aca7deaa. This change is breaking the LLDB CI builders, e.g. https://lab.llvm.org/buildbot/#/builders/68/builds/60350 Added: Modified: lldb/test/API/commands/process/attach/TestProcessAttach.py Removed: diff --git a/lldb/test/API/commands/process/attach/TestProcessAttach.py b/lldb/test/API/commands/process/attach/TestProcessAttach.py index 1f5359977480be6..0e916d2e8e4cbe1 100644 --- a/lldb/test/API/commands/process/attach/TestProcessAttach.py +++ b/lldb/test/API/commands/process/attach/TestProcessAttach.py @@ -4,8 +4,6 @@ import os -import threading -import time import lldb import shutil from lldbsuite.test.decorators import * @@ -130,84 +128,3 @@ def tearDown(self): # Call super's tearDown(). TestBase.tearDown(self) - -def test_run_then_attach_wait_interrupt(self): -# Test that having run one process doesn't cause us to be unable -# to interrupt a subsequent attach attempt. -self.build() -exe = self.getBuildArtifact(exe_name) - -target = lldbutil.run_to_breakpoint_make_target(self, exe_name, True) -launch_info = target.GetLaunchInfo() -launch_info.SetArguments(["q"], True) -error = lldb.SBError() -target.Launch(launch_info, error) -self.assertSuccess(error, "Launched a process") -self.assertState(target.process.state, lldb.eStateExited, "and it exited.") - -# Okay now we've run a process, try to attach/wait to something -# and make sure that we can interrupt that. - -options = lldb.SBCommandInterpreterRunOptions() -options.SetPrintResults(True) -options.SetEchoCommands(False) - -self.stdin_path = self.getBuildArtifact("stdin.txt") - -with open(self.stdin_path, "w") as input_handle: -input_handle.write("process attach -w -n noone_would_use_this_name\nquit") - -# Python will close the file descriptor if all references -# to the filehandle object lapse, so we need to keep one -# around. -self.filehandle = open(self.stdin_path, "r") -self.dbg.SetInputFileHandle(self.filehandle, False) - -# No need to track the output -self.stdout_path = self.getBuildArtifact("stdout.txt") -self.out_filehandle = open(self.stdout_path, "w") -self.dbg.SetOutputFileHandle(self.out_filehandle, False) -self.dbg.SetErrorFileHandle(self.out_filehandle, False) - -n_errors, quit_req, crashed = self.dbg.RunCommandInterpreter( -True, True, options, 0, False, False) - -while 1: -time.sleep(1) -if target.process.state == lldb.eStateAttaching: -break - -self.dbg.DispatchInputInterrupt() -self.dbg.DispatchInputInterrupt() - -# cycle waiting for the process state to change before trying -# to read the command output. I don't want to spin forever. -counter = 0 -got_exit = False -while counter < 20: -if target.process.state == lldb.eStateExited: -got_exit = True -break -counter += 1 -time.sleep(1) - -self.assertTrue(got_exit, "The process never switched to eStateExited") -# Even if the state has flipped, we still need to wait for the -# command to complete to see the result. We don't have a way to -# synchronize on "command completed" right now, but sleeping just -# a bit should be enough, all that's left is passing this error -# result to the command, and printing it to the debugger output. -time.sleep(1) - -self.out_filehandle.flush() -reader = open(self.stdout_path, "r") -results = reader.readlines() -found_result = False -for line in results: -if "Cancelled async attach" in line: -found_result = True -break -if not found_result: -print(f"Results: {results}") - -self.assertTrue(found_result, "Found async error in results") ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Enforce `pexpect` system availability by default (PR #84270)
mysterymath wrote: Chiming in on behalf of Fuchsia, since this did break us. We build and ship a custom Python with our LLDB, since we're intended to be a portable distribution. That Python doesn't have pexpect. I'm not very familiar with what pexpect is used for, or the states of the world before and after this change. Would it be possible to get a bit of background on this change so we can figure out how to move forward? https://github.com/llvm/llvm-project/pull/84270 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Enforce `pexpect` system availability by default (PR #84270)
mysterymath wrote: > @mysterymath do you run the API test suites with that custom python, i.e. > `ninja check-lldb-api`? If so, would you be able to add bundle `pexpect` for > your tests even if it's not in what you ship? We do run the tests with the Python we ship, since we don't have direct control of the version that is present on our builders, and Python doesn't have ABI compatibility sufficient for LLDB's purposes across major versions. We've generally tried to keep our builds hermetic and not build anything against host libraries unless absolutely necessary. We could possibly add `pexpect` to our shipped Python, but I haven't scoped what that would entail yet; there may be some bureaucratic hoops to jump through. I wouldn't expect much sympathy on that front of course, but it does seem like adding deps to the Python used by LLDB's test suite does make it more difficult to package a hermetic distribution of LLVM+LLDB. https://github.com/llvm/llvm-project/pull/84270 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Add `pexpect` category for tests that `import pexpect` (PR #84860)
https://github.com/mysterymath approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/84860 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [llvm] [lldb] Added settings for DEBUGINFOD cache location and timeout (PR #78605)
https://github.com/mysterymath commented: LGTM for debuginfod https://github.com/llvm/llvm-project/pull/78605 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [llvm] [lldb] Added settings for DEBUGINFOD cache location and timeout (PR #78605)
https://github.com/mysterymath edited https://github.com/llvm/llvm-project/pull/78605 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [llvm] [lldb] Added settings for DEBUGINFOD cache location and timeout (PR #78605)
@@ -46,6 +46,9 @@ bool canUseDebuginfod(); /// environment variable. SmallVector getDefaultDebuginfodUrls(); +/// Creates the cache-key for a given Debuginfod UrlPath mysterymath wrote: ```suggestion /// Returns the cache key for a given debuginfod URL path. ``` https://github.com/llvm/llvm-project/pull/78605 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [llvm] [lldb] Added settings for DEBUGINFOD cache location and timeout (PR #78605)
@@ -58,15 +61,25 @@ Expected getDefaultDebuginfodCacheDirectory(); /// DEBUGINFOD_TIMEOUT environment variable, default is 90 seconds (9 ms). std::chrono::milliseconds getDefaultDebuginfodTimeout(); +/// Get the full UrlPath for a source request of a given BuildID and file path. +std::string getDebuginfodSourceUrlPath(object::BuildIDRef ID, + StringRef SourceFilePath); + /// Fetches a specified source file by searching the default local cache /// directory and server URLs. Expected getCachedOrDownloadSource(object::BuildIDRef ID, StringRef SourceFilePath); +/// Get the full UrlPath for an Executable request of a given BuildID. mysterymath wrote: ```suggestion /// Get the full URL path for an executable request of a given BuildID. ``` https://github.com/llvm/llvm-project/pull/78605 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [llvm] [lldb] Added settings for DEBUGINFOD cache location and timeout (PR #78605)
@@ -58,15 +61,25 @@ Expected getDefaultDebuginfodCacheDirectory(); /// DEBUGINFOD_TIMEOUT environment variable, default is 90 seconds (9 ms). std::chrono::milliseconds getDefaultDebuginfodTimeout(); +/// Get the full UrlPath for a source request of a given BuildID and file path. mysterymath wrote: ```suggestion /// Get the full URL path for a source request of a given BuildID and file path. ``` https://github.com/llvm/llvm-project/pull/78605 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [llvm] [lldb] Added settings for DEBUGINFOD cache location and timeout (PR #78605)
@@ -58,15 +61,25 @@ Expected getDefaultDebuginfodCacheDirectory(); /// DEBUGINFOD_TIMEOUT environment variable, default is 90 seconds (9 ms). std::chrono::milliseconds getDefaultDebuginfodTimeout(); +/// Get the full UrlPath for a source request of a given BuildID and file path. +std::string getDebuginfodSourceUrlPath(object::BuildIDRef ID, + StringRef SourceFilePath); + /// Fetches a specified source file by searching the default local cache /// directory and server URLs. Expected getCachedOrDownloadSource(object::BuildIDRef ID, StringRef SourceFilePath); +/// Get the full UrlPath for an Executable request of a given BuildID. +std::string getDebuginfodExecutableUrlPath(object::BuildIDRef ID); + /// Fetches an executable by searching the default local cache directory and /// server URLs. Expected getCachedOrDownloadExecutable(object::BuildIDRef ID); +/// Get the full UrlPath for a debug binary request of a given BuildID. mysterymath wrote: ```suggestion /// Get the full URL path for a debug binary request of a given BuildID. ``` https://github.com/llvm/llvm-project/pull/78605 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [llvm] [lldb] Added settings for DEBUGINFOD cache location and timeout (PR #78605)
https://github.com/mysterymath approved this pull request. https://github.com/llvm/llvm-project/pull/78605 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 88eb4cb - Remove #if guards from AppendBounds to fix compile on old POSIX.
Author: Daniel Thornburgh Date: 2023-03-16T16:16:21-07:00 New Revision: 88eb4cbbfe7ded9556131c3bd4228ee9e9d01b4d URL: https://github.com/llvm/llvm-project/commit/88eb4cbbfe7ded9556131c3bd4228ee9e9d01b4d DIFF: https://github.com/llvm/llvm-project/commit/88eb4cbbfe7ded9556131c3bd4228ee9e9d01b4d.diff LOG: Remove #if guards from AppendBounds to fix compile on old POSIX. Added: Modified: lldb/source/Plugins/Process/POSIX/CrashReason.cpp Removed: diff --git a/lldb/source/Plugins/Process/POSIX/CrashReason.cpp b/lldb/source/Plugins/Process/POSIX/CrashReason.cpp index 058ec6ad2d975..2ae7f8390575d 100644 --- a/lldb/source/Plugins/Process/POSIX/CrashReason.cpp +++ b/lldb/source/Plugins/Process/POSIX/CrashReason.cpp @@ -54,7 +54,6 @@ static void AppendFaultAddr(std::string &str, lldb::addr_t addr) { str += ss.str(); } -#if defined(si_lower) && defined(si_upper) static void AppendBounds(std::string &str, lldb::addr_t lower_bound, lldb::addr_t upper_bound, lldb::addr_t addr) { llvm::raw_string_ostream stream(str); @@ -71,7 +70,6 @@ static void AppendBounds(std::string &str, lldb::addr_t lower_bound, stream << ")"; stream.flush(); } -#endif static CrashReason GetCrashReasonForSIGSEGV(int code) { switch (code) { ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] b22965d - [lldb] Pass CMAKE_SYSROOT through to LLDB shell tests
Author: Daniel Thornburgh Date: 2023-05-26T11:30:33-07:00 New Revision: b22965df1304a752af2724f7c2c3c58347532e71 URL: https://github.com/llvm/llvm-project/commit/b22965df1304a752af2724f7c2c3c58347532e71 DIFF: https://github.com/llvm/llvm-project/commit/b22965df1304a752af2724f7c2c3c58347532e71.diff LOG: [lldb] Pass CMAKE_SYSROOT through to LLDB shell tests This allows the LLDB Shell tests to succeed in (e.g. CI) environments where system libraries are provided hermetically as a sysroot. Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D151269 Added: Modified: lldb/test/Shell/helper/build.py lldb/test/Shell/helper/toolchain.py lldb/test/Shell/lit.site.cfg.py.in Removed: diff --git a/lldb/test/Shell/helper/build.py b/lldb/test/Shell/helper/build.py index 21e5d2f22316c..2a04967c89bc3 100755 --- a/lldb/test/Shell/helper/build.py +++ b/lldb/test/Shell/helper/build.py @@ -73,6 +73,14 @@ help="Include and link GNUstep libobjc2 (Windows and Linux only)", ) +parser.add_argument( +"--sysroot", +metavar="directory", +dest="sysroot", +required=False, +help="If specified, a sysroot to be passed via --sysroot", +) + if sys.platform == "darwin": parser.add_argument( "--apple-sdk", @@ -305,6 +313,7 @@ def __init__(self, toolchain_type, args, obj_ext): if args.objc_gnustep_dir else None ) +self.sysroot = args.sysroot def _exe_file_name(self): assert self.mode != "compile" @@ -761,6 +770,8 @@ def _get_compilation_command(self, source, obj): args.extend( ["-Xclang", "-gcodeview", "-Xclang", "--dependent-lib=msvcrtd"] ) +elif self.sysroot: +args.extend(["--sysroot", self.sysroot]) if self.std: args.append("-std={0}".format(self.std)) @@ -797,6 +808,8 @@ def _get_link_command(self): args.extend( ["-fuse-ld=lld-link", "-g", "-Xclang", "--dependent-lib=msvcrtd"] ) +elif self.sysroot: +args.extend(["--sysroot", self.sysroot]) return ("linking", self._obj_file_names(), self._exe_file_name(), None, args) diff --git a/lldb/test/Shell/helper/toolchain.py b/lldb/test/Shell/helper/toolchain.py index 31d3f1295fb4e..8b56c659b13bf 100644 --- a/lldb/test/Shell/helper/toolchain.py +++ b/lldb/test/Shell/helper/toolchain.py @@ -47,6 +47,8 @@ def use_lldb_substitutions(config): build_script_args.append( '--objc-gnustep-dir="{0}"'.format(config.objc_gnustep_dir) ) +if config.cmake_sysroot: +build_script_args.append("--sysroot={0}".format(config.cmake_sysroot)) lldb_init = _get_lldb_init_path(config) @@ -160,6 +162,9 @@ def use_support_substitutions(config): # The clang module cache is used for building inferiors. host_flags += ["-fmodules-cache-path={}".format(config.clang_module_cache)] +if config.cmake_sysroot: +host_flags += ["--sysroot={}".format(config.cmake_sysroot)] + host_flags = " ".join(host_flags) config.substitutions.append(("%clang_host", "%clang " + host_flags)) config.substitutions.append(("%clangxx_host", "%clangxx " + host_flags)) diff --git a/lldb/test/Shell/lit.site.cfg.py.in b/lldb/test/Shell/lit.site.cfg.py.in index f84cb60ff9404..736dfc335732b 100644 --- a/lldb/test/Shell/lit.site.cfg.py.in +++ b/lldb/test/Shell/lit.site.cfg.py.in @@ -13,6 +13,7 @@ config.lldb_tools_dir = lit_config.substitute("@LLDB_TOOLS_DIR@") # Since it comes from the command line, it may have backslashes which # should not need to be escaped. config.lldb_lit_tools_dir = lit_config.substitute(r"@LLDB_LIT_TOOLS_DIR@") +config.cmake_sysroot = lit_config.substitute("@CMAKE_SYSROOT@") config.target_triple = "@LLVM_TARGET_TRIPLE@" config.python_executable = "@Python3_EXECUTABLE@" config.have_zlib = @LLVM_ENABLE_ZLIB@ ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [llvm] [lldb] DEBUGINFOD based DWP acquisition for LLDB (PR #70996)
@@ -396,8 +398,22 @@ Symbols::LocateExecutableSymbolFile(const ModuleSpec &module_spec, } } } - - return LocateExecutableSymbolFileDsym(module_spec); + FileSpec dsym_bundle = LocateExecutableSymbolFileDsym(module_spec); + if (dsym_bundle) +return dsym_bundle; + + // If we didn't find anything by looking locally, let's try Debuginfod. + if (module_uuid.IsValid() && llvm::canUseDebuginfod()) { +llvm::object::BuildID build_id(module_uuid.GetBytes()); +llvm::Expected result = +llvm::getCachedOrDownloadDebuginfo(build_id); +if (result) + return FileSpec(*result); +// An error is just fine, here... +consumeError(result.takeError()); mysterymath wrote: Looks like gdb has a `set debuginfod verbose on/off` setting for this. There's also the generic `DEBUGINFOD_VERBOSE` environment variable. If set, this triggers remote logging to stderr. The environment variable is something we generally want to support for debuginfod lookups; that could probably safely live in the debuginfod client library itself, as it does with libdebuginfod. If LLDB had its own setting for this, it may be able to invoke a setter in the client library, but current everything in the client library is global, so there may be some threading gotchas there. For reference, here's the gdb settings for debuginfod: https://sourceware.org/gdb/current/onlinedocs/gdb.html/Debuginfod-Settings.html And the environment variables: https://manpages.debian.org/testing/debuginfod/debuginfod.8.en.html#ENVIRONMENT_VARIABLES https://github.com/llvm/llvm-project/pull/70996 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [llvm] DEBUGINFOD based DWP acquisition for LLDB (PR #70996)
@@ -258,6 +258,8 @@ class TargetProperties : public Properties { bool GetDebugUtilityExpression() const; + Args GetDebugInfoDURLs() const; mysterymath wrote: General naming nit: `debuginfod` is all lower-case, and capitalized as if it were a single word: `Debuginfod`. https://github.com/llvm/llvm-project/pull/70996 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Use get-task-allow entitlement on macOS too (PR #71112)
https://github.com/mysterymath created https://github.com/llvm/llvm-project/pull/71112 Running the LLDB test suite in a GUI-less CI macOS environment requires that the debugged tasks be signed with the get-task-allow entitlement. NOTE: I'm not entirely sure why the upstream macOS builders don't run into this; it could be something that occurs on newer macOS, or it could be that they have some global setting that prevents the debugger attachment check from firing. >From c309ac45505ad147ffc167099ec2f4fa4fe9b2d0 Mon Sep 17 00:00:00 2001 From: Daniel Thornburgh Date: Wed, 25 Oct 2023 16:08:07 -0700 Subject: [PATCH] [lldb] Use get-task-allow entitlement on macOS too Running the LLDB test suite in a GUI-less CI macOS environment requires that the debugged tasks be signed with the get-task-allow entitlement. --- .../Python/lldbsuite/test/builders/darwin.py | 15 --- .../lldbsuite/test/make/entitlements-macos.plist | 8 2 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 lldb/packages/Python/lldbsuite/test/make/entitlements-macos.plist diff --git a/lldb/packages/Python/lldbsuite/test/builders/darwin.py b/lldb/packages/Python/lldbsuite/test/builders/darwin.py index 40dd13bcfdea1d6..a023bda3ad80103 100644 --- a/lldb/packages/Python/lldbsuite/test/builders/darwin.py +++ b/lldb/packages/Python/lldbsuite/test/builders/darwin.py @@ -88,17 +88,18 @@ def getExtraMakeArgs(self): args["FRAMEWORK_INCLUDES"] = "-F{}".format(private_frameworks) operating_system, env = get_os_and_env() -if operating_system and operating_system != "macosx": -builder_dir = os.path.dirname(os.path.abspath(__file__)) -test_dir = os.path.dirname(builder_dir) + +builder_dir = os.path.dirname(os.path.abspath(__file__)) +test_dir = os.path.dirname(builder_dir) +if not operating_system: +entitlements_file = "entitlements-macos.plist" +else: if env == "simulator": entitlements_file = "entitlements-simulator.plist" else: entitlements_file = "entitlements.plist" -entitlements = os.path.join(test_dir, "make", entitlements_file) -args["CODESIGN"] = "codesign --entitlements {}".format(entitlements) -else: -args["CODESIGN"] = "codesign" +entitlements = os.path.join(test_dir, "make", entitlements_file) +args["CODESIGN"] = "codesign --entitlements {}".format(entitlements) # Return extra args as a formatted string. return ["{}={}".format(key, value) for key, value in args.items()] diff --git a/lldb/packages/Python/lldbsuite/test/make/entitlements-macos.plist b/lldb/packages/Python/lldbsuite/test/make/entitlements-macos.plist new file mode 100644 index 000..9acd12816c91373 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/make/entitlements-macos.plist @@ -0,0 +1,8 @@ + +http://www.apple.com/DTDs/PropertyList-1.0.dtd";> + + +com.apple.security.get-task-allow + + + ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Use get-task-allow entitlement on macOS too (PR #71112)
https://github.com/mysterymath edited https://github.com/llvm/llvm-project/pull/71112 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Use get-task-allow entitlement on macOS too (PR #71112)
https://github.com/mysterymath edited https://github.com/llvm/llvm-project/pull/71112 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Use get-task-allow entitlement on macOS too (PR #71112)
mysterymath wrote: > The nodes on GreenDragon run under a UI session so that might explain why we > don't see that issue there. Is there any harm with using > `packages/Python/lldbsuite/test/make/entitlements.plist` for macOS too? Does > `com.apple.private.security.no-sandbox` cause issues? At least on my macOS Sonoma workstation, I get a `Killed: 9` when I try to run a binary built with by the LLDB test suite with entitlement `com.apple.private.security.no-sandbox`. https://github.com/llvm/llvm-project/pull/71112 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [llvm] [lldb] DEBUGINFOD based DWP acquisition for LLDB (PR #70996)
@@ -396,8 +398,22 @@ Symbols::LocateExecutableSymbolFile(const ModuleSpec &module_spec, } } } - - return LocateExecutableSymbolFileDsym(module_spec); + FileSpec dsym_bundle = LocateExecutableSymbolFileDsym(module_spec); + if (dsym_bundle) +return dsym_bundle; + + // If we didn't find anything by looking locally, let's try Debuginfod. + if (module_uuid.IsValid() && llvm::canUseDebuginfod()) { +llvm::object::BuildID build_id(module_uuid.GetBytes()); +llvm::Expected result = +llvm::getCachedOrDownloadDebuginfo(build_id); +if (result) + return FileSpec(*result); +// An error is just fine, here... +consumeError(result.takeError()); mysterymath wrote: > @mysterymath that environment variable is used by the server, not the client. Ah, I should have linked to the debuginfod-find man page instead; pardon my laziness. It is used by the client, it's just that the server also includes a client for federation purposes. See https://sourceware.org/git/?p=elfutils.git;a=blob;f=debuginfod/debuginfod-client.c;h=dcf0503163fd73e126a2197d278f363fd6839810;hb=HEAD#l1881 https://github.com/llvm/llvm-project/pull/70996 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [llvm] [lldb] DEBUGINFOD based DWP acquisition for LLDB (PR #70996)
https://github.com/mysterymath edited https://github.com/llvm/llvm-project/pull/70996 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [llvm] [lldb] DEBUGINFOD based DWP acquisition for LLDB (PR #70996)
https://github.com/mysterymath edited https://github.com/llvm/llvm-project/pull/70996 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [llvm] [lldb] DEBUGINFOD based DWP acquisition for LLDB (PR #70996)
https://github.com/mysterymath edited https://github.com/llvm/llvm-project/pull/70996 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [llvm] [lldb] DEBUGINFOD based DWP acquisition for LLDB (PR #70996)
@@ -258,6 +258,8 @@ class TargetProperties : public Properties { bool GetDebugUtilityExpression() const; + Args GetDebugInfoDURLs() const; mysterymath wrote: I tend to think of it as agglutanitive, like "blackbird." https://github.com/llvm/llvm-project/pull/70996 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [llvm] [lldb] DEBUGINFOD based DWP acquisition for LLDB (PR #70996)
https://github.com/mysterymath edited https://github.com/llvm/llvm-project/pull/70996 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [llvm] DEBUGINFOD based DWP acquisition for LLDB (PR #70996)
https://github.com/mysterymath edited https://github.com/llvm/llvm-project/pull/70996 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [llvm] DEBUGINFOD based DWP acquisition for LLDB (PR #70996)
https://github.com/mysterymath edited https://github.com/llvm/llvm-project/pull/70996 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [llvm] DEBUGINFOD based DWP acquisition for LLDB (PR #70996)
mysterymath wrote: > > Out of curiosity, why did you choose the delimiter as ' ' instead of > > something like ';'? > > Because that's how the environment variable works. It was less a choice and > more 🤷 > > Also, ChatGPT tells me that URL's can include semicolons, so maybe it's not a > great idea to use that as a delimiter? (I don't think Debuginfod server URL's > can include semicolons, but I know they can't include spaces...) I'd also recommend having a LLDB setting reuse the DEBUGINFOD_URLS syntax, just to avoid creating an unnecessary difference between the LLDB and GDB syntax. https://github.com/llvm/llvm-project/pull/70996 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Use get-task-allow entitlement on macOS too (PR #71112)
https://github.com/mysterymath closed https://github.com/llvm/llvm-project/pull/71112 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Fix manual CURSES_LIBRARIES tinfo finding (PR #128245)
@@ -6,15 +6,24 @@ include(CMakePushCheckState) -function(lldb_check_curses_tinfo CURSES_LIBRARIES CURSES_HAS_TINFO) +function(lldb_check_curses_tinfo CURSES_HEADER CURSES_LIBRARIES CURSES_HAS_TINFO) cmake_reset_check_state() set(CMAKE_REQUIRED_LIBRARIES "${CURSES_LIBRARIES}") # acs_map is one of many symbols that are part of tinfo but could # be bundled in curses. - check_symbol_exists(acs_map "curses.h" CURSES_HAS_TINFO) + check_symbol_exists(acs_map "${CURSES_HEADER}" CURSES_HAS_TINFO) mysterymath wrote: This should still be "curses.h", since this is how curses will be referenced in the LLVM code that uses it. Instead, this should set `CMAKE_REQUIRED_INCLUDES` to the `CURSES_INCLUDE_DIRS` list. https://github.com/llvm/llvm-project/pull/128245 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits