[llvm] [lldb][bazel] Add the Windows process plugin to the bazel build (PR #203146)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 10 19:00:04 PDT 2026


https://github.com/youngd007 updated https://github.com/llvm/llvm-project/pull/203146

>From feedf36ce339c03e56db328115eb1edd521555a3 Mon Sep 17 00:00:00 2001
From: David Young <davidayoung at meta.com>
Date: Wed, 10 Jun 2026 18:11:41 -0700
Subject: [PATCH 1/2] [lldb][bazel] Add the Windows process plugin to the bazel
 build

---
 .../lldb/source/Plugins/BUILD.bazel           | 34 ++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel b/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel
index 52e36eb703729..49edf59fed59a 100644
--- a/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel
@@ -2422,6 +2422,30 @@ cc_library(
     ],
 )
 
+cc_library(
+    name = "PluginProcessWindowsCommon",
+    srcs = glob(["Process/Windows/Common/*.cpp"]),
+    hdrs = glob([
+        "Process/Windows/Common/*.h",
+        "Process/Windows/Common/**/*.h",
+    ]),
+    includes = [".."],
+    target_compatible_with = select({
+        "@platforms//os:windows": [],
+        "//conditions:default": ["@platforms//:incompatible"],
+    }),
+    deps = [
+        ":PluginDynamicLoaderWindowsDYLD",
+        "//lldb:Breakpoint",
+        "//lldb:Core",
+        "//lldb:Headers",
+        "//lldb:Host",
+        "//lldb:Target",
+        "//lldb:Utility",
+        "//llvm:Support",
+    ],
+)
+
 _DEFAULT_LOAD_PLUGINS = "\n".join(["LLDB_PLUGIN({})".format(x) for x in DEFAULT_PLUGINS]) + \
                         "\n" + "\n".join(["LLDB_SCRIPT_PLUGIN({})".format(x) for x in DEFAULT_SCRIPT_PLUGINS])
 
@@ -2429,9 +2453,17 @@ expand_template(
     name = "plugins_config_gen",
     out = "Plugins.def",
     substitutions = {
-        "@LLDB_PROCESS_WINDOWS_PLUGIN@": "",
         "@LLDB_PROCESS_GDB_PLUGIN@": "LLDB_PLUGIN(ProcessGDBRemote)",
     } | select({
+        # ProcessWindowsCommon registers via its dedicated slot in Plugins.def.in
+        # (ordered after all other process plugins, before ProcessGDBRemote).
+        "@platforms//os:windows": {
+            "@LLDB_PROCESS_WINDOWS_PLUGIN@": "LLDB_PLUGIN(ProcessWindowsCommon)",
+        },
+        "//conditions:default": {
+            "@LLDB_PROCESS_WINDOWS_PLUGIN@": "",
+        },
+    }) | select({
         "@platforms//os:macos": {
             "@LLDB_ENUM_PLUGINS@": _DEFAULT_LOAD_PLUGINS + """
 LLDB_PLUGIN(ProcessMacOSXKernel)

>From 1dfc16a8f1af8ada43a0ca23ab1014ac26e5d365 Mon Sep 17 00:00:00 2001
From: David Young <davidayoung at meta.com>
Date: Wed, 10 Jun 2026 18:59:48 -0700
Subject: [PATCH 2/2] Make sure the windows process plugin is depended on so no
 link failure

---
 utils/bazel/llvm-project-overlay/lldb/BUILD.bazel | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel b/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel
index eb9384476972e..0245d01cfe32d 100644
--- a/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel
@@ -267,6 +267,9 @@ cc_library(
         "@platforms//os:linux": [
             "//lldb/source/Plugins:PluginProcessLinux",
         ],
+        "@platforms//os:windows": [
+            "//lldb/source/Plugins:PluginProcessWindowsCommon",
+        ],
         "//conditions:default": [],
     }),
     alwayslink = True,



More information about the llvm-commits mailing list