Skip to content

[lldb][test] Add support for building Wasm test inferiors#192872

Merged
JDevlieghere merged 3 commits into
llvm:mainfrom
JDevlieghere:wasm-test-scaffolding
Apr 21, 2026
Merged

[lldb][test] Add support for building Wasm test inferiors#192872
JDevlieghere merged 3 commits into
llvm:mainfrom
JDevlieghere:wasm-test-scaffolding

Conversation

@JDevlieghere
Copy link
Copy Markdown
Member

This PR adds support for building the test inferiors to WebAssembly. Specifically, it allows you to configure a sysroot and resource dir (pointing at the WASI SDK). The Wasm runtime can be configured through the LLDB_TEST_USER_ARGS.

LLDB_TEST_TRIPLE:STRING=wasm32-wasip1
LLDB_TEST_SYSROOT:PATH=/path/to/wasi-sdk-32.0-arm64-macos/share/wasi-sysroot
LLDB_TEST_RESOURCE_DIR:PATH=/path/to/wasi-sdk-32.0-arm64-macos/lib/clang/22/
LLDB_TEST_USER_ARGS:STRING=--setting;platform.plugin.wasm.runtime-path=/path/to/iwasm;--setting;platform.plugin.wasm.runtime-args=--heap-size=1048576;--setting;platform.plugin.wasm.port-arg=-g=

With the configuration listed above I was able to confirm that I could build and run a handful of C and C++ tests. To set expectations: lots of tests are unsupported because they rely on things not available in Wasm (e.g. shared libraries) or they use features currently unsupported in LLDB (most notably: expression evaluation).

This PR adds support for building the test inferiors to WebAssembly.
Specifically, it allows you to configure a sysroot and resource dir
(pointing at the WASI SDK). The Wasm runtime can be configured through
the `LLDB_TEST_USER_ARGS`.

```
LLDB_TEST_TRIPLE:STRING=wasm32-wasip1
LLDB_TEST_SYSROOT:PATH=/path/to/wasi-sdk-32.0-arm64-macos/share/wasi-sysroot
LLDB_TEST_RESOURCE_DIR:PATH=/path/to/wasi-sdk-32.0-arm64-macos/lib/clang/22/
LLDB_TEST_USER_ARGS:STRING=--setting;platform.plugin.wasm.runtime-path=/path/to/iwasm;--setting;platform.plugin.wasm.runtime-args=--heap-size=1048576;--setting;platform.plugin.wasm.port-arg=-g=
```

With the configuration listed above I was able to confirm that I could
build and run a handful of C and C++ tests. To set expectations: lots of
tests are unsupported because they rely on things not available in Wasm
(e.g. shared libraries) or they use features currently unsupported in
LLDB (most notably: expression evaluation).
@JDevlieghere
Copy link
Copy Markdown
Member Author

CC @MaxDesiatov

@llvmbot llvmbot added the lldb label Apr 19, 2026
@llvmbot
Copy link
Copy Markdown
Member

llvmbot commented Apr 19, 2026

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

Changes

This PR adds support for building the test inferiors to WebAssembly. Specifically, it allows you to configure a sysroot and resource dir (pointing at the WASI SDK). The Wasm runtime can be configured through the LLDB_TEST_USER_ARGS.

LLDB_TEST_TRIPLE:STRING=wasm32-wasip1
LLDB_TEST_SYSROOT:PATH=/path/to/wasi-sdk-32.0-arm64-macos/share/wasi-sysroot
LLDB_TEST_RESOURCE_DIR:PATH=/path/to/wasi-sdk-32.0-arm64-macos/lib/clang/22/
LLDB_TEST_USER_ARGS:STRING=--setting;platform.plugin.wasm.runtime-path=/path/to/iwasm;--setting;platform.plugin.wasm.runtime-args=--heap-size=1048576;--setting;platform.plugin.wasm.port-arg=-g=

With the configuration listed above I was able to confirm that I could build and run a handful of C and C++ tests. To set expectations: lots of tests are unsupported because they rely on things not available in Wasm (e.g. shared libraries) or they use features currently unsupported in LLDB (most notably: expression evaluation).


Full diff: https://github.com/llvm/llvm-project/pull/192872.diff

11 Files Affected:

  • (modified) lldb/packages/Python/lldbsuite/test/builders/builder.py (+6)
  • (modified) lldb/packages/Python/lldbsuite/test/configuration.py (+3)
  • (modified) lldb/packages/Python/lldbsuite/test/dotest.py (+2)
  • (modified) lldb/packages/Python/lldbsuite/test/dotest_args.py (+7)
  • (modified) lldb/packages/Python/lldbsuite/test/lldbplatformutil.py (+16-1)
  • (modified) lldb/packages/Python/lldbsuite/test/lldbtest.py (+1-1)
  • (modified) lldb/packages/Python/lldbsuite/test/make/Makefile.rules (+9-1)
  • (added) lldb/packages/Python/lldbsuite/test/make/Wasm.rules (+14)
  • (modified) lldb/test/API/CMakeLists.txt (+2)
  • (modified) lldb/test/API/lit.cfg.py (+2)
  • (modified) lldb/test/API/lit.site.cfg.py.in (+1)
diff --git a/lldb/packages/Python/lldbsuite/test/builders/builder.py b/lldb/packages/Python/lldbsuite/test/builders/builder.py
index 03c1af579b018..1c557a64bd195 100644
--- a/lldb/packages/Python/lldbsuite/test/builders/builder.py
+++ b/lldb/packages/Python/lldbsuite/test/builders/builder.py
@@ -247,6 +247,11 @@ def getLibCxxArgs(self):
     def getLLDBObjRoot(self):
         return ["LLDB_OBJ_ROOT={}".format(configuration.lldb_obj_root)]
 
+    def getResourceDirArgs(self):
+        if configuration.resource_dir:
+            return ["RESOURCE_DIR={}".format(configuration.resource_dir)]
+        return []
+
     def _getDebugInfoArgs(self, debug_info):
         if debug_info is None:
             return []
@@ -298,6 +303,7 @@ def getBuildCommand(
             self.getModuleCacheSpec(),
             self.getLibCxxArgs(),
             self.getLLDBObjRoot(),
+            self.getResourceDirArgs(),
             self.getCmdLine(dictionary),
         ]
         command = list(itertools.chain(*command_parts))
diff --git a/lldb/packages/Python/lldbsuite/test/configuration.py b/lldb/packages/Python/lldbsuite/test/configuration.py
index d1c933b35fcdf..e1189f0f31d03 100644
--- a/lldb/packages/Python/lldbsuite/test/configuration.py
+++ b/lldb/packages/Python/lldbsuite/test/configuration.py
@@ -50,6 +50,9 @@
 # Allow specifying a triple for cross compilation.
 triple = None
 
+# Clang resource directory for cross compilation.
+resource_dir = None
+
 # The overriden dwarf verison.
 # Don't use this to test the current compiler's
 # DWARF version, as this won't be set if the
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py
index 7f73fce14bcdd..45a0d68e5364b 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -276,6 +276,8 @@ def parseOptionsAndInitTestdirs():
         configuration.dsymutil = seven.get_command_output(
             "xcrun -find -toolchain default dsymutil"
         )
+    if args.resource_dir:
+        configuration.resource_dir = args.resource_dir
     if args.llvm_tools_dir:
         configuration.llvm_tools_dir = args.llvm_tools_dir
         configuration.filecheck = shutil.which("FileCheck", path=args.llvm_tools_dir)
diff --git a/lldb/packages/Python/lldbsuite/test/dotest_args.py b/lldb/packages/Python/lldbsuite/test/dotest_args.py
index f3b0837bdc4ab..a3d6db2e2d53a 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -106,6 +106,13 @@ def create_parser():
         dest="dsymutil",
         help=textwrap.dedent("Specify which dsymutil to use."),
     )
+    group.add_argument(
+        "--resource-dir",
+        metavar="dir",
+        dest="resource_dir",
+        default="",
+        help=textwrap.dedent("Specify the clang resource directory for cross-compiling test inferiors."),
+    )
     group.add_argument(
         "--llvm-tools-dir",
         metavar="dir",
diff --git a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
index a3fab6e49c2a7..cccba1b6f31db 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
@@ -108,7 +108,22 @@ def finalize_build_dictionary(dictionary):
 
     if dictionary is None:
         dictionary = {}
-    if target_is_android():
+
+    if configuration.triple:
+        # When cross-compiling with an explicit triple, derive OS from it
+        # rather than from the selected platform.
+        triple_os = configuration.triple.split("-")[1] if "-" in configuration.triple else ""
+        if triple_os.startswith("wasi"):
+            dictionary["OS"] = "Wasm"
+        elif triple_os == "linux" or triple_os.startswith("linux"):
+            dictionary["OS"] = "Linux"
+        elif triple_os == "windows" or triple_os.startswith("windows"):
+            dictionary["OS"] = "Windows_NT"
+        elif triple_os == "apple":
+            dictionary["OS"] = "Darwin"
+        else:
+            dictionary["OS"] = triple_os
+    elif target_is_android():
         dictionary["OS"] = "Android"
         dictionary["PIE"] = 1
     elif platformIsDarwin():
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index f2a9f3bba1993..5289a5ef0a189 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -822,7 +822,7 @@ def setUpCommands(cls):
 
         # Set any user-overridden settings.
         for setting, value in configuration.settings:
-            commands.append("setting set %s %s" % (setting, value))
+            commands.append("settings set -- %s %s" % (setting, value))
 
         # Make sure that a sanitizer LLDB's environment doesn't get passed on.
         if (
diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
index 5cff3f5d91539..44063a47b56ae 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -118,6 +118,10 @@ ifeq "$(OS)" "Android"
 	include $(THIS_FILE_DIR)/Android.rules
 endif
 
+ifeq "$(OS)" "Wasm"
+	include $(THIS_FILE_DIR)/Wasm.rules
+endif
+
 ifeq "$(TRIPLE)" ""
   ifeq "$(ARCH)" ""
     # No triple, no arch: query the compiler for its default triple.
@@ -172,7 +176,11 @@ ifeq "$(OS)" "Darwin"
 else
     ifneq "$(SDKROOT)" ""
         SYSROOT_FLAGS := --sysroot "$(SDKROOT)"
-        GCC_TOOLCHAIN_FLAGS := --gcc-toolchain="$(SDKROOT)/usr"
+        ifeq "$(OS)" "Wasm"
+            GCC_TOOLCHAIN_FLAGS :=
+        else
+            GCC_TOOLCHAIN_FLAGS := --gcc-toolchain="$(SDKROOT)/usr"
+        endif
     else
         # Do not set up these options if SDKROOT was not specified.
         # This is a regular build in that case (or Android).
diff --git a/lldb/packages/Python/lldbsuite/test/make/Wasm.rules b/lldb/packages/Python/lldbsuite/test/make/Wasm.rules
new file mode 100644
index 0000000000000..a28521391d410
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/make/Wasm.rules
@@ -0,0 +1,14 @@
+USE_SYSTEM_STDLIB = 1
+
+ifneq "$(RESOURCE_DIR)" ""
+ARCH_CFLAGS += -resource-dir $(RESOURCE_DIR)
+endif
+
+ARCH_CXXFLAGS += \
+	-fno-exceptions
+
+ARCH_LDFLAGS += \
+	$(if $(RESOURCE_DIR),-resource-dir $(RESOURCE_DIR)) \
+	-Wl,--export-all \
+	-Wl,--no-entry \
+	-Wl,--allow-undefined
diff --git a/lldb/test/API/CMakeLists.txt b/lldb/test/API/CMakeLists.txt
index 0738278c63a9c..bff3bac438d6b 100644
--- a/lldb/test/API/CMakeLists.txt
+++ b/lldb/test/API/CMakeLists.txt
@@ -92,6 +92,8 @@ set(LLDB_TEST_EXECUTABLE "${LLDB_DEFAULT_TEST_EXECUTABLE}" CACHE PATH "lldb exec
 set(LLDB_TEST_COMPILER "${LLDB_DEFAULT_TEST_COMPILER}" CACHE PATH "C Compiler to use for building LLDB test inferiors")
 set(LLDB_TEST_DSYMUTIL "${LLDB_DEFAULT_TEST_DSYMUTIL}" CACHE PATH "dsymutil used for generating dSYM bundles")
 set(LLDB_TEST_MAKE "${LLDB_DEFAULT_TEST_MAKE}" CACHE PATH "make tool used for building test executables")
+set(LLDB_TEST_RESOURCE_DIR "" CACHE PATH "Clang resource directory for cross-compiling test inferiors")
+set(LLDB_TEST_SYSROOT "" CACHE PATH "Sysroot for cross-compiling test inferiors")
 
 if ("${LLDB_TEST_COMPILER}" STREQUAL "")
   message(FATAL_ERROR "LLDB test compiler not specified. Tests will not run.")
diff --git a/lldb/test/API/lit.cfg.py b/lldb/test/API/lit.cfg.py
index c92b104c9227c..f58e1e5ace5a3 100644
--- a/lldb/test/API/lit.cfg.py
+++ b/lldb/test/API/lit.cfg.py
@@ -323,6 +323,8 @@ def delete_module_cache(path):
     dotest_cmd += ["--platform-working-dir", config.lldb_platform_working_dir]
 if is_configured("cmake_sysroot"):
     dotest_cmd += ["--sysroot", config.cmake_sysroot]
+if is_configured("test_resource_dir"):
+    dotest_cmd += ["--resource-dir", config.test_resource_dir]
 
 if is_configured("dotest_user_args_str"):
     dotest_cmd.extend(config.dotest_user_args_str.split(";"))
diff --git a/lldb/test/API/lit.site.cfg.py.in b/lldb/test/API/lit.site.cfg.py.in
index b7cd281425d7e..b1070c24bbb72 100644
--- a/lldb/test/API/lit.site.cfg.py.in
+++ b/lldb/test/API/lit.site.cfg.py.in
@@ -43,6 +43,7 @@ config.libcxx_libs_dir = "@LIBCXX_LIBRARY_DIR@"
 config.libcxx_include_dir = "@LIBCXX_GENERATED_INCLUDE_DIR@"
 config.libcxx_include_target_dir = "@LIBCXX_GENERATED_INCLUDE_TARGET_DIR@"
 config.lldb_launcher = "@LLDB_LAUNCHER@"
+config.test_resource_dir = "@LLDB_TEST_RESOURCE_DIR@"
 config.lldb_enable_mte = @LLDB_ENABLE_MTE@
 config.lldb_enable_arm64e_debugserver = @LLDB_USE_ARM64E_DEBUGSERVER@
 # The API tests use their own module caches.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 19, 2026

✅ With the latest revision this PR passed the Python code formatter.

@DavidSpickett
Copy link
Copy Markdown
Contributor

lots of tests are unsupported because they rely on things not available in Wasm (e.g. shared libraries)

Do runtimes support multiple processes? I tried the test suite against qemu-user and that was the main issue there.

Which is my way of saying: I think it would be ok if we end up with a few more categories for things that don't/are never going to work in a wasm runtime generally.

As long as we avoid too many SkipIfThisOneSpecificImplementationOfARuntime.

@MaxDesiatov
Copy link
Copy Markdown
Contributor

cc @kateinoigakukun

Comment thread lldb/packages/Python/lldbsuite/test/lldbplatformutil.py Outdated
Comment thread lldb/packages/Python/lldbsuite/test/builders/builder.py Outdated
Comment thread lldb/packages/Python/lldbsuite/test/make/Makefile.rules
Comment thread lldb/packages/Python/lldbsuite/test/make/Wasm.rules Outdated
endif

ARCH_CXXFLAGS += \
-fno-exceptions
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a global thing like WASM in general doesn't support this or is this something connected to the particular SDK being used at the moment?

Either is fine, just wondering.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WASI SDK I'm iterating with didn't have C++ exception support, but it seems like it was very recently added to WASI so we may be able to start using it in the (near) future: WebAssembly/wasi-sdk#565

Copy link
Copy Markdown
Contributor

@MaxDesiatov MaxDesiatov Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all runtimes have support for exception handling BTW. IIRC C++ exception are compiled down by Clang to Wasm exceptions? For WasmKit we would have to merge this one first swiftwasm/WasmKit#311

Copy link
Copy Markdown
Contributor

@DavidSpickett DavidSpickett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JDevlieghere JDevlieghere merged commit 40fcd25 into llvm:main Apr 21, 2026
11 checks passed
@JDevlieghere JDevlieghere deleted the wasm-test-scaffolding branch April 21, 2026 17:44
@llvm-ci
Copy link
Copy Markdown

llvm-ci commented Apr 21, 2026

LLVM Buildbot has detected a new failure on builder lldb-aarch64-windows running on linaro-armv8-windows-msvc-05 while building lldb at step 6 "test".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/141/builds/17603

Here is the relevant piece of the build log for the reference
Step 6 (test) failure: build (failure)
...
llvm-lit.py: C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\llvm\utils\lit\lit\llvm\config.py:64: note: using lit tools: C:\Users\tcwg\scoop\apps\git\current\usr\bin
llvm-lit.py: C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\llvm\utils\lit\lit\llvm\config.py:569: note: using clang: c:\users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe
llvm-lit.py: C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\llvm\utils\lit\lit\llvm\config.py:569: note: using ld.lld: c:\users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\ld.lld.exe
llvm-lit.py: C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\llvm\utils\lit\lit\llvm\config.py:569: note: using lld-link: c:\users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\lld-link.exe
llvm-lit.py: C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\llvm\utils\lit\lit\llvm\config.py:569: note: using ld64.lld: c:\users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\ld64.lld.exe
llvm-lit.py: C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\llvm\utils\lit\lit\llvm\config.py:569: note: using wasm-ld: c:\users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\wasm-ld.exe
-- Testing: 2514 tests, 2 workers --
UNSUPPORTED: lldb-api :: api/check_public_api_headers/TestPublicAPIHeaders.py (1 of 2514)
UNSUPPORTED: lldb-api :: android/platform/TestDefaultCacheLineSize.py (2 of 2514)
UNRESOLVED: lldb-api :: api/command-return-object/TestSBCommandReturnObject.py (3 of 2514)
******************** TEST 'lldb-api :: api/command-return-object/TestSBCommandReturnObject.py' FAILED ********************
Script:
--
C:/Users/tcwg/scoop/apps/python/current/python.exe C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/llvm-project/lldb\test\API\dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./lib --env LLVM_INCLUDE_DIR=C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/include --env LLVM_TOOLS_DIR=C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin --triple aarch64-pc-windows-msvc --build-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/lldb-test-build.noindex --lldb-module-cache-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/lldb-test-build.noindex/module-cache-lldb\lldb-api --clang-module-cache-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/lldb-test-build.noindex/module-cache-clang\lldb-api --executable C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin/lldb.exe --compiler C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin/clang.exe --dsymutil C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin/dsymutil.exe --make C:/Users/tcwg/scoop/shims/make.exe --llvm-tools-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin --lldb-obj-root C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/tools/lldb --lldb-libs-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./lib --cmake-build-type Release --skip-category=watchpoint --env LLDB_LAUNCH_FLAG_USE_PIPES=1 C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\test\API\api\command-return-object -p TestSBCommandReturnObject.py
--
Exit Code: 1

Command Output (stdout):
--
lldb version 23.0.0git (https://github.com/llvm/llvm-project.git revision 40fcd2517a110b8914acdf2f5bd0b37110e5795c)
  clang revision 40fcd2517a110b8914acdf2f5bd0b37110e5795c
  llvm revision 40fcd2517a110b8914acdf2f5bd0b37110e5795c
Skipping the following test categories: watchpoint, libc++, libstdcxx, dwo, dsym, gmodules, debugserver, objc, fork, pexpect


--
Command Output (stderr):
--
PASS: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_get_command (TestSBCommandReturnObject.TestSBCommandReturnObject.test_get_command)

PASS: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_get_value (TestSBCommandReturnObject.TestSBCommandReturnObject.test_get_value)

FAIL: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_sb_command_return_object (TestSBCommandReturnObject.TestSBCommandReturnObject.test_sb_command_return_object)

Log Files:

 - C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\lldb-test-build.noindex\api\command-return-object\TestSBCommandReturnObject.test_sb_command_return_object\Error_test_sb_command_return_object.log

======================================================================

ERROR: test_sb_command_return_object (TestSBCommandReturnObject.TestSBCommandReturnObject.test_sb_command_return_object)

----------------------------------------------------------------------

Error when building test subject.



Build Command:

@llvm-ci
Copy link
Copy Markdown

llvm-ci commented Apr 21, 2026

LLVM Buildbot has detected a new failure on builder lldb-x86_64-win running on as-builder-10 while building lldb at step 9 "test-check-lldb-api".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/211/builds/7704

Here is the relevant piece of the build log for the reference
Step 9 (test-check-lldb-api) failure: Test just built components: check-lldb-api completed (failure)
******************** TEST 'lldb-api :: commands/expression/codegen-crash-typedefdecl-not-in_declcontext/TestCodegenCrashTypedefDeclNotInDeclContext.py' FAILED ********************
Script:
--
C:/Python312/python.exe C:/buildbot/as-builder-10/lldb-x86-64/llvm-project/lldb\test\API\dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=C:/buildbot/as-builder-10/lldb-x86-64/build/./lib --env LLVM_INCLUDE_DIR=C:/buildbot/as-builder-10/lldb-x86-64/build/include --env LLVM_TOOLS_DIR=C:/buildbot/as-builder-10/lldb-x86-64/build/./bin --triple x86_64-pc-windows-msvc --build-dir C:/buildbot/as-builder-10/lldb-x86-64/build/lldb-test-build.noindex --lldb-module-cache-dir C:/buildbot/as-builder-10/lldb-x86-64/build/lldb-test-build.noindex/module-cache-lldb\lldb-api --clang-module-cache-dir C:/buildbot/as-builder-10/lldb-x86-64/build/lldb-test-build.noindex/module-cache-clang\lldb-api --executable C:/buildbot/as-builder-10/lldb-x86-64/build/./bin/lldb.exe --compiler C:/buildbot/as-builder-10/lldb-x86-64/build/./bin/clang.exe --dsymutil C:/buildbot/as-builder-10/lldb-x86-64/build/./bin/dsymutil.exe --make C:/ninja/make.exe --llvm-tools-dir C:/buildbot/as-builder-10/lldb-x86-64/build/./bin --lldb-obj-root C:/buildbot/as-builder-10/lldb-x86-64/build/tools/lldb --lldb-libs-dir C:/buildbot/as-builder-10/lldb-x86-64/build/./lib --cmake-build-type Release --skip-category=lldb-dap --env LLDB_LAUNCH_FLAG_USE_PIPES=1 C:\buildbot\as-builder-10\lldb-x86-64\llvm-project\lldb\test\API\commands\expression\codegen-crash-typedefdecl-not-in_declcontext -p TestCodegenCrashTypedefDeclNotInDeclContext.py
--
Exit Code: 1

Command Output (stdout):
--
lldb version 23.0.0git (https://github.com/llvm/llvm-project.git revision 40fcd2517a110b8914acdf2f5bd0b37110e5795c)
  clang revision 40fcd2517a110b8914acdf2f5bd0b37110e5795c
  llvm revision 40fcd2517a110b8914acdf2f5bd0b37110e5795c
Skipping the following test categories: lldb-dap, libc++, libstdcxx, dwo, dsym, gmodules, debugserver, objc, fork, pexpect


--
Command Output (stderr):
--
UNSUPPORTED: LLDB (C:\buildbot\as-builder-10\lldb-x86-64\build\bin\clang.exe-x86_64) :: test_dsym (lldbsuite.test.lldbtest.TestCodegenCrashTypedefDeclNotInDeclContext.test_dsym) (test case does not fall in any category of interest for this run) 

FAIL: LLDB (C:\buildbot\as-builder-10\lldb-x86-64\build\bin\clang.exe-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestCodegenCrashTypedefDeclNotInDeclContext.test_dwarf)

Log Files:

 - C:\buildbot\as-builder-10\lldb-x86-64\build\lldb-test-build.noindex\commands\expression\codegen-crash-typedefdecl-not-in_declcontext\TestCodegenCrashTypedefDeclNotInDeclContext.test_dwarf\Failure_test_dwarf.log

UNSUPPORTED: LLDB (C:\buildbot\as-builder-10\lldb-x86-64\build\bin\clang.exe-x86_64) :: test_dwo (lldbsuite.test.lldbtest.TestCodegenCrashTypedefDeclNotInDeclContext.test_dwo) (test case does not fall in any category of interest for this run) 

======================================================================

FAIL: test_dwarf (lldbsuite.test.lldbtest.TestCodegenCrashTypedefDeclNotInDeclContext.test_dwarf)

----------------------------------------------------------------------

Traceback (most recent call last):

  File "C:\buildbot\as-builder-10\lldb-x86-64\llvm-project\lldb\packages\Python\lldbsuite\test\lldbtest.py", line 2031, in test_method

    return attrvalue(self)

           ^^^^^^^^^^^^^^^

  File "C:\buildbot\as-builder-10\lldb-x86-64\llvm-project\lldb\packages\Python\lldbsuite\test\lldbinline.py", line 122, in _test

    self.do_test()

  File "C:\buildbot\as-builder-10\lldb-x86-64\llvm-project\lldb\packages\Python\lldbsuite\test\lldbinline.py", line 152, in do_test

    parser.handle_breakpoint(self, bp_id)

...

@slydiman
Copy link
Copy Markdown
Contributor

All Windows buildbots are broken.
20 tests are failed or unresolved on x86_64
and 100+ tests are failed or unresolved on AArch64.
Please fix ASAP or revert.

DavidSpickett added a commit that referenced this pull request Apr 22, 2026
llvm-sync Bot pushed a commit to arm/arm-toolchain that referenced this pull request Apr 22, 2026
cpullvm-upstream-sync Bot pushed a commit to navaneethshan/cpullvm-toolchain-1 that referenced this pull request Apr 22, 2026
linuxlonelyeagle pushed a commit to linuxlonelyeagle/llvm-project that referenced this pull request Apr 23, 2026
This PR adds support for building the test inferiors to WebAssembly.
Specifically, it allows you to configure a sysroot and resource dir
(pointing at the WASI SDK). The Wasm runtime can be configured through
the `LLDB_TEST_USER_ARGS`.

```
LLDB_TEST_TRIPLE:STRING=wasm32-wasip1
LLDB_TEST_SYSROOT:PATH=/path/to/wasi-sdk-32.0-arm64-macos/share/wasi-sysroot
LLDB_TEST_RESOURCE_DIR:PATH=/path/to/wasi-sdk-32.0-arm64-macos/lib/clang/22/
LLDB_TEST_USER_ARGS:STRING=--setting;platform.plugin.wasm.runtime-path=/path/to/iwasm;--setting;platform.plugin.wasm.runtime-args=--heap-size=1048576;--setting;platform.plugin.wasm.port-arg=-g=
```

With the configuration listed above I was able to confirm that I could
build and run a handful of C and C++ tests. To set expectations: lots of
tests are unsupported because they rely on things not available in Wasm
(e.g. shared libraries) or they use features currently unsupported in
LLDB (most notably: expression evaluation).
linuxlonelyeagle pushed a commit to linuxlonelyeagle/llvm-project that referenced this pull request Apr 23, 2026
llvm-upstreamsync Bot pushed a commit to qualcomm/cpullvm-toolchain that referenced this pull request Apr 24, 2026
yingopq pushed a commit to yingopq/llvm-project that referenced this pull request Apr 29, 2026
This PR adds support for building the test inferiors to WebAssembly.
Specifically, it allows you to configure a sysroot and resource dir
(pointing at the WASI SDK). The Wasm runtime can be configured through
the `LLDB_TEST_USER_ARGS`.

```
LLDB_TEST_TRIPLE:STRING=wasm32-wasip1
LLDB_TEST_SYSROOT:PATH=/path/to/wasi-sdk-32.0-arm64-macos/share/wasi-sysroot
LLDB_TEST_RESOURCE_DIR:PATH=/path/to/wasi-sdk-32.0-arm64-macos/lib/clang/22/
LLDB_TEST_USER_ARGS:STRING=--setting;platform.plugin.wasm.runtime-path=/path/to/iwasm;--setting;platform.plugin.wasm.runtime-args=--heap-size=1048576;--setting;platform.plugin.wasm.port-arg=-g=
```

With the configuration listed above I was able to confirm that I could
build and run a handful of C and C++ tests. To set expectations: lots of
tests are unsupported because they rely on things not available in Wasm
(e.g. shared libraries) or they use features currently unsupported in
LLDB (most notably: expression evaluation).
yingopq pushed a commit to yingopq/llvm-project that referenced this pull request Apr 29, 2026
KHicketts pushed a commit to KHicketts/llvm-project that referenced this pull request Apr 30, 2026
This PR adds support for building the test inferiors to WebAssembly.
Specifically, it allows you to configure a sysroot and resource dir
(pointing at the WASI SDK). The Wasm runtime can be configured through
the `LLDB_TEST_USER_ARGS`.

```
LLDB_TEST_TRIPLE:STRING=wasm32-wasip1
LLDB_TEST_SYSROOT:PATH=/path/to/wasi-sdk-32.0-arm64-macos/share/wasi-sysroot
LLDB_TEST_RESOURCE_DIR:PATH=/path/to/wasi-sdk-32.0-arm64-macos/lib/clang/22/
LLDB_TEST_USER_ARGS:STRING=--setting;platform.plugin.wasm.runtime-path=/path/to/iwasm;--setting;platform.plugin.wasm.runtime-args=--heap-size=1048576;--setting;platform.plugin.wasm.port-arg=-g=
```

With the configuration listed above I was able to confirm that I could
build and run a handful of C and C++ tests. To set expectations: lots of
tests are unsupported because they rely on things not available in Wasm
(e.g. shared libraries) or they use features currently unsupported in
LLDB (most notably: expression evaluation).
KHicketts pushed a commit to KHicketts/llvm-project that referenced this pull request Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants