https://github.com/JDevlieghere updated 
https://github.com/llvm/llvm-project/pull/188082

>From 379381ae0fea3a776eef912cf08e19999cd65ef6 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere <[email protected]>
Date: Mon, 23 Mar 2026 10:10:31 -0700
Subject: [PATCH 1/2] [lldb] Check for arm64e debugserver in
 skipUnlessArm64eSupported

Explicitly check whether we are building debugserver for arm64e. To
debug an arm64e binary, debugserver itself needs to be an arm64e
process.

This PR eliminates the possibility of configuring LLDB with Right now,
it's possible to configure CMake with LLDB_ENABLE_ARM64E_DEBUGSERVER=Off
and the decorator wouldn't account for that.
---
 lldb/packages/Python/lldbsuite/test/configuration.py | 3 +++
 lldb/packages/Python/lldbsuite/test/decorators.py    | 4 ++++
 lldb/packages/Python/lldbsuite/test/dotest.py        | 3 +++
 lldb/packages/Python/lldbsuite/test/dotest_args.py   | 6 ++++++
 lldb/test/API/lit.cfg.py                             | 3 +++
 lldb/test/API/lit.site.cfg.py.in                     | 1 +
 lldb/test/CMakeLists.txt                             | 3 ++-
 7 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/lldb/packages/Python/lldbsuite/test/configuration.py 
b/lldb/packages/Python/lldbsuite/test/configuration.py
index 002d775594ff5..dde1a5e52be47 100644
--- a/lldb/packages/Python/lldbsuite/test/configuration.py
+++ b/lldb/packages/Python/lldbsuite/test/configuration.py
@@ -150,6 +150,9 @@
 # Whether MTE (Memory Tagging Extension) is enabled.
 mte_enabled = False
 
+# Whether debugserver is built with arm64e support.
+arm64e_debugserver = False
+
 # the build type of lldb
 # Typical values include Debug, Release, RelWithDebInfo and MinSizeRel
 cmake_build_type = None
diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py 
b/lldb/packages/Python/lldbsuite/test/decorators.py
index cb3aa1d6af115..bb698ab899395 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -1331,6 +1331,10 @@ def can_build_and_run_arm64e():
         if not _compiler_supports(compiler_path, "-arch arm64e"):
             return "Compiler cannot target arm64e"
 
+        # Need debugserver built with arm64e support.
+        if not configuration.arm64e_debugserver:
+            return "debugserver not built with arm64e support"
+
         return None
 
     return skipTestIfFn(can_build_and_run_arm64e)(func)
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py 
b/lldb/packages/Python/lldbsuite/test/dotest.py
index 2bfef9c83aed8..9b84375ba8e17 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -472,6 +472,9 @@ def parseOptionsAndInitTestdirs():
     if args.enable_mte:
         configuration.mte_enabled = True
 
+    if args.arm64e_debugserver:
+        configuration.arm64e_debugserver = True
+
     # Gather all the dirs passed on the command line.
     if len(args.args) > 0:
         configuration.testdirs = [
diff --git a/lldb/packages/Python/lldbsuite/test/dotest_args.py 
b/lldb/packages/Python/lldbsuite/test/dotest_args.py
index 8f4b623c4b1c9..4c0a67203755e 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -285,6 +285,12 @@ def create_parser():
         action="store_true",
         help="Indicate that the test suite is running with MTE (Memory Tagging 
Extension) enabled.",
     )
+    group.add_argument(
+        "--arm64e-debugserver",
+        dest="arm64e_debugserver",
+        action="store_true",
+        help="Indicate that debugserver is built with arm64e support.",
+    )
 
     # Configuration options
     group = parser.add_argument_group("Remote platform options")
diff --git a/lldb/test/API/lit.cfg.py b/lldb/test/API/lit.cfg.py
index a48cb8c5a9b4a..c567e83f3d7f3 100644
--- a/lldb/test/API/lit.cfg.py
+++ b/lldb/test/API/lit.cfg.py
@@ -303,6 +303,9 @@ def delete_module_cache(path):
 if getattr(config, "lldb_enable_mte", False):
     dotest_cmd += ["--enable-mte"]
 
+if getattr(config, "lldb_enable_arm64e_debugserver", False):
+    dotest_cmd += ["--arm64e-debugserver"]
+
 # `dotest` args come from three different sources:
 # 1. Derived by CMake based on its configs (LLDB_TEST_COMMON_ARGS), which end
 # up in `dotest_common_args_str`.
diff --git a/lldb/test/API/lit.site.cfg.py.in b/lldb/test/API/lit.site.cfg.py.in
index 0f7630c1e6e44..a3b6c9eeb1219 100644
--- a/lldb/test/API/lit.site.cfg.py.in
+++ b/lldb/test/API/lit.site.cfg.py.in
@@ -44,6 +44,7 @@ config.libcxx_include_dir = "@LIBCXX_GENERATED_INCLUDE_DIR@"
 config.libcxx_include_target_dir = "@LIBCXX_GENERATED_INCLUDE_TARGET_DIR@"
 config.lldb_launcher = "@LLDB_LAUNCHER@"
 config.lldb_enable_mte = @LLDB_ENABLE_MTE@
+config.lldb_enable_arm64e_debugserver = @LLDB_ENABLE_ARM64E_DEBUGSERVER@
 # The API tests use their own module caches.
 config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", 
"lldb-api")
 config.clang_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_CLANG@", 
"lldb-api")
diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt
index 1edfed8c66427..a664391ea6e7b 100644
--- a/lldb/test/CMakeLists.txt
+++ b/lldb/test/CMakeLists.txt
@@ -267,7 +267,8 @@ llvm_canonicalize_cmake_booleans(
   LLDB_TOOL_LLDB_SERVER_BUILD
   LLDB_USE_SYSTEM_DEBUGSERVER
   LLDB_IS_64_BITS
-  LLDB_BUILD_LLDBRPC)
+  LLDB_BUILD_LLDBRPC
+  LLDB_ENABLE_ARM64E_DEBUGSERVER)
 
 # Configure the individual test suites.
 add_subdirectory(API)

>From fffdf1de4a643757c5a43c761ddd07cd6939ec7f Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere <[email protected]>
Date: Mon, 23 Mar 2026 10:47:51 -0700
Subject: [PATCH 2/2] Address Jason's feedback

---
 lldb/test/API/lit.site.cfg.py.in      | 2 +-
 lldb/test/CMakeLists.txt              | 6 +++++-
 lldb/utils/lldb-dotest/CMakeLists.txt | 6 ++++++
 lldb/utils/lldb-dotest/lldb-dotest.in | 3 +++
 4 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/lldb/test/API/lit.site.cfg.py.in b/lldb/test/API/lit.site.cfg.py.in
index a3b6c9eeb1219..f01e0d73441a1 100644
--- a/lldb/test/API/lit.site.cfg.py.in
+++ b/lldb/test/API/lit.site.cfg.py.in
@@ -44,7 +44,7 @@ config.libcxx_include_dir = "@LIBCXX_GENERATED_INCLUDE_DIR@"
 config.libcxx_include_target_dir = "@LIBCXX_GENERATED_INCLUDE_TARGET_DIR@"
 config.lldb_launcher = "@LLDB_LAUNCHER@"
 config.lldb_enable_mte = @LLDB_ENABLE_MTE@
-config.lldb_enable_arm64e_debugserver = @LLDB_ENABLE_ARM64E_DEBUGSERVER@
+config.lldb_enable_arm64e_debugserver = @LLDB_USE_ARM64E_DEBUGSERVER@
 # The API tests use their own module caches.
 config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", 
"lldb-api")
 config.clang_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_CLANG@", 
"lldb-api")
diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt
index a664391ea6e7b..b117d24195f9f 100644
--- a/lldb/test/CMakeLists.txt
+++ b/lldb/test/CMakeLists.txt
@@ -250,6 +250,10 @@ if (CMAKE_SIZEOF_VOID_P EQUAL 8)
   set(LLDB_IS_64_BITS 1)
 endif()
 
+if (LLDB_ENABLE_ARM64E_DEBUGSERVER OR LLDB_USE_SYSTEM_DEBUGSERVER)
+  set(LLDB_USE_ARM64E_DEBUGSERVER ON)
+endif()
+
 set(LLDB_TEST_SHELL_DISABLE_REMOTE OFF CACHE BOOL "Disable remote Shell tests 
execution")
 
 # These values are not canonicalized within LLVM.
@@ -268,7 +272,7 @@ llvm_canonicalize_cmake_booleans(
   LLDB_USE_SYSTEM_DEBUGSERVER
   LLDB_IS_64_BITS
   LLDB_BUILD_LLDBRPC
-  LLDB_ENABLE_ARM64E_DEBUGSERVER)
+  LLDB_USE_ARM64E_DEBUGSERVER)
 
 # Configure the individual test suites.
 add_subdirectory(API)
diff --git a/lldb/utils/lldb-dotest/CMakeLists.txt 
b/lldb/utils/lldb-dotest/CMakeLists.txt
index 50d0afadf25e6..23f1fc23c783d 100644
--- a/lldb/utils/lldb-dotest/CMakeLists.txt
+++ b/lldb/utils/lldb-dotest/CMakeLists.txt
@@ -11,9 +11,14 @@ if(TARGET darwin-mte-launcher)
   set(LLDB_LAUNCHER 
${LLVM_RUNTIME_OUTPUT_INTDIR}/darwin-mte-launcher${CMAKE_EXECUTABLE_SUFFIX})
 endif()
 
+if (LLDB_ENABLE_ARM64E_DEBUGSERVER OR LLDB_USE_SYSTEM_DEBUGSERVER)
+  set(LLDB_USE_ARM64E_DEBUGSERVER ON)
+endif()
+
 llvm_canonicalize_cmake_booleans(
   LLDB_BUILD_INTEL_PT
   LLDB_HAS_LIBCXX
+  LLDB_USE_ARM64E_DEBUGSERVER
 )
 
 if ("libcxx" IN_LIST LLVM_ENABLE_RUNTIMES)
@@ -50,6 +55,7 @@ set(vars
   LIBCXX_GENERATED_INCLUDE_DIR
   LIBCXX_GENERATED_INCLUDE_TARGET_DIR
   LLDB_LAUNCHER
+  LLDB_USE_ARM64E_DEBUGSERVER
   )
 
 llvm_canonicalize_cmake_booleans(LLDB_HAS_LIBCXX)
diff --git a/lldb/utils/lldb-dotest/lldb-dotest.in 
b/lldb/utils/lldb-dotest/lldb-dotest.in
index 6657b6f74dd00..6465b1ddd5476 100755
--- a/lldb/utils/lldb-dotest/lldb-dotest.in
+++ b/lldb/utils/lldb-dotest/lldb-dotest.in
@@ -23,6 +23,7 @@ libcxx_libs_dir = "@LIBCXX_LIBRARY_DIR@"
 libcxx_include_dir = "@LIBCXX_GENERATED_INCLUDE_DIR@"
 libcxx_include_target_dir = "@LIBCXX_GENERATED_INCLUDE_TARGET_DIR@"
 cmake_build_type = "@CMAKE_BUILD_TYPE@"
+lldb_enable_arm64e_debugserver = @LLDB_USE_ARM64E_DEBUGSERVER@
 
 if __name__ == '__main__':
     wrapper_args = sys.argv[1:]
@@ -53,6 +54,8 @@ if __name__ == '__main__':
         cmd.extend(['--framework', lldb_framework_dir])
     if lldb_build_intel_pt == "1":
         cmd.extend(['--enable-plugin', 'intel-pt'])
+    if lldb_enable_arm64e_debugserver:
+        cmd.extend(['--arm64e-debugserver'])
     cmd.extend(['--lldb-obj-root', lldb_obj_root])
     cmd.extend(['--cmake-build-type', cmake_build_type])
     cmd.extend(wrapper_args)

_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to