[Lldb-commits] [lldb] [lldb] Add support for two-component tiple (PR #194764)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 28 18:11:23 PDT 2026


https://github.com/JDevlieghere created https://github.com/llvm/llvm-project/pull/194764

Support a two component triple (e.g. wasm32-wasip1) in lldbplatformutil.py.

>From 75e3b0e9d480aa2240382bf0f5af14b96e5914df Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere <jonas at devlieghere.com>
Date: Tue, 28 Apr 2026 18:09:33 -0700
Subject: [PATCH] [lldb] Add support for two-component tiple

Support a two component triple (e.g. wasm32-wasip1) in
lldbplatformutil.py.
---
 .../Python/lldbsuite/test/lldbplatformutil.py         | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
index f22f606563a44..e9db43a6cd5d2 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
@@ -104,6 +104,8 @@ def finalize_build_dictionary(dictionary):
         "windows": "Windows_NT",
         "macosx": "Darwin",
         "darwin": "Darwin",
+        "wasip1": "WASI",
+        "wasi": "WASI",
     }
 
     if dictionary is None:
@@ -124,8 +126,11 @@ def finalize_build_dictionary(dictionary):
 def _get_platform_os(p):
     # Use the triple to determine the platform if set.
     triple = p.GetTriple()
-    if triple:
-        platform = triple.split("-")[2]
+    if not triple:
+        triple = getattr(configuration, "triple", None) or ""
+    parts = triple.split("-")
+    if len(parts) >= 3:
+        platform = parts[2]
         if platform.startswith("freebsd"):
             platform = "freebsd"
         elif platform.startswith("netbsd"):
@@ -133,6 +138,8 @@ def _get_platform_os(p):
         elif platform.startswith("openbsd"):
             platform = "openbsd"
         return platform
+    if len(parts) >= 2:
+        return parts[1]
 
     return ""
 



More information about the lldb-commits mailing list