Skip to content

Commit 1bc0921

Browse files
authored
[bazel] Add support for lldb-server (#88989)
1 parent 50a3717 commit 1bc0921

File tree

2 files changed

+90
-2
lines changed

2 files changed

+90
-2
lines changed

utils/bazel/llvm-project-overlay/lldb/BUILD.bazel

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,9 @@ cc_library(
702702
"//lldb/source/Plugins:PluginSymbolLocatorDebugSymbols",
703703
"//lldb/source/Plugins:PluginSymbolVendorMacOSX",
704704
],
705+
"@platforms//os:linux": [
706+
"//lldb/source/Plugins:PluginProcessLinux",
707+
],
705708
"//conditions:default": [],
706709
}),
707710
)
@@ -752,7 +755,13 @@ cc_binary(
752755
data = [
753756
":lldb-argdumper",
754757
] + select({
755-
"@platforms//os:macos": [":debugserver"],
758+
"@platforms//os:macos": [
759+
":debugserver",
760+
":lldb-server",
761+
],
762+
"@platforms//os:linux": [
763+
":lldb-server",
764+
],
756765
"//conditions:default": [],
757766
}),
758767
deps = [
@@ -799,8 +808,8 @@ cc_library(
799808
["tools/debugserver/source/**/*.cpp"],
800809
exclude = ["tools/debugserver/source/debugserver.cpp"],
801810
),
802-
tags = ["nobuildkite"],
803811
local_defines = ["LLDB_USE_OS_LOG"],
812+
tags = ["nobuildkite"],
804813
deps = [
805814
":DebugServerCommonHeaders",
806815
":DebugServerCommonMacOSXHeaders",
@@ -852,3 +861,63 @@ cc_binary(
852861
srcs = glob(["tools/argdumper/*.cpp"]),
853862
deps = ["//llvm:Support"],
854863
)
864+
865+
gentbl_cc_library(
866+
name = "lldb_server_opts_gen",
867+
strip_include_prefix = ".",
868+
tbl_outs = [(
869+
["-gen-opt-parser-defs"],
870+
"LLGSOptions.inc",
871+
)],
872+
tblgen = "//llvm:llvm-tblgen",
873+
td_file = "tools/lldb-server/LLGSOptions.td",
874+
deps = ["//llvm:OptParserTdFiles"],
875+
)
876+
877+
cc_binary(
878+
name = "lldb-server",
879+
srcs = glob([
880+
"tools/lldb-server/*.cpp",
881+
"tools/lldb-server/*.h",
882+
]),
883+
target_compatible_with = select({
884+
"@platforms//os:linux": [],
885+
"@platforms//os:macos": [],
886+
# TODO: This can theoretically support more platforms, but it hasn't been tested yet
887+
"//conditions:default": ["@platforms//:incompatible"],
888+
}),
889+
deps = [
890+
":Host",
891+
":Initialization",
892+
":Utility",
893+
":Version",
894+
":lldb_server_opts_gen",
895+
"//lldb:Target",
896+
"//lldb:TargetHeaders",
897+
"//lldb/source/Plugins:PluginCPlusPlusLanguage",
898+
"//lldb/source/Plugins:PluginExpressionParserClang",
899+
"//lldb/source/Plugins:PluginInstructionARM",
900+
"//lldb/source/Plugins:PluginInstructionARM64",
901+
"//lldb/source/Plugins:PluginInstructionLoongArch",
902+
"//lldb/source/Plugins:PluginInstructionMIPS",
903+
"//lldb/source/Plugins:PluginInstructionMIPS64",
904+
"//lldb/source/Plugins:PluginInstructionRISCV",
905+
"//lldb/source/Plugins:PluginObjCLanguage",
906+
"//lldb/source/Plugins:PluginProcessGDBRemote",
907+
"//lldb/source/Plugins:PluginSymbolFileDWARF",
908+
"//lldb/source/Plugins:PluginSymbolFileNativePDB",
909+
"//lldb/source/Plugins:PluginSymbolFilePDB",
910+
"//lldb/source/Plugins:PluginTypeSystemClang",
911+
"//llvm:Option",
912+
"//llvm:Support",
913+
] + select({
914+
"@platforms//os:linux": [
915+
"//lldb/source/Plugins:PluginObjectFileELF",
916+
"//lldb/source/Plugins:PluginProcessLinux",
917+
],
918+
"@platforms//os:macos": [
919+
"//lldb/source/Plugins:PluginObjectFileMachO",
920+
],
921+
"//conditions:default": [],
922+
}),
923+
)

utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2100,6 +2100,25 @@ cc_library(
21002100
],
21012101
)
21022102

2103+
cc_library(
2104+
name = "PluginProcessLinux",
2105+
srcs = glob(["Process/Linux/*.cpp"]),
2106+
hdrs = glob(["Process/Linux/*.h"]),
2107+
include_prefix = "Plugins",
2108+
deps = [
2109+
":PluginProcessPOSIX",
2110+
":PluginProcessUtility",
2111+
"//lldb:Core",
2112+
"//lldb:Headers",
2113+
"//lldb:Host",
2114+
"//lldb:SymbolHeaders",
2115+
"//lldb:TargetHeaders",
2116+
"//lldb:Utility",
2117+
"//llvm:Support",
2118+
"//llvm:TargetParser",
2119+
],
2120+
)
2121+
21032122
cc_library(
21042123
name = "PluginScriptedProcess",
21052124
srcs = glob(["Process/scripted/*.cpp"]),

0 commit comments

Comments
 (0)