Skip to content

Commit

Permalink
[bazel] Add support for lldb-server (llvm#88989)
Browse files Browse the repository at this point in the history
  • Loading branch information
keith committed Apr 16, 2024
1 parent 50a3717 commit 1bc0921
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 2 deletions.
73 changes: 71 additions & 2 deletions utils/bazel/llvm-project-overlay/lldb/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,9 @@ cc_library(
"//lldb/source/Plugins:PluginSymbolLocatorDebugSymbols",
"//lldb/source/Plugins:PluginSymbolVendorMacOSX",
],
"@platforms//os:linux": [
"//lldb/source/Plugins:PluginProcessLinux",
],
"//conditions:default": [],
}),
)
Expand Down Expand Up @@ -752,7 +755,13 @@ cc_binary(
data = [
":lldb-argdumper",
] + select({
"@platforms//os:macos": [":debugserver"],
"@platforms//os:macos": [
":debugserver",
":lldb-server",
],
"@platforms//os:linux": [
":lldb-server",
],
"//conditions:default": [],
}),
deps = [
Expand Down Expand Up @@ -799,8 +808,8 @@ cc_library(
["tools/debugserver/source/**/*.cpp"],
exclude = ["tools/debugserver/source/debugserver.cpp"],
),
tags = ["nobuildkite"],
local_defines = ["LLDB_USE_OS_LOG"],
tags = ["nobuildkite"],
deps = [
":DebugServerCommonHeaders",
":DebugServerCommonMacOSXHeaders",
Expand Down Expand Up @@ -852,3 +861,63 @@ cc_binary(
srcs = glob(["tools/argdumper/*.cpp"]),
deps = ["//llvm:Support"],
)

gentbl_cc_library(
name = "lldb_server_opts_gen",
strip_include_prefix = ".",
tbl_outs = [(
["-gen-opt-parser-defs"],
"LLGSOptions.inc",
)],
tblgen = "//llvm:llvm-tblgen",
td_file = "tools/lldb-server/LLGSOptions.td",
deps = ["//llvm:OptParserTdFiles"],
)

cc_binary(
name = "lldb-server",
srcs = glob([
"tools/lldb-server/*.cpp",
"tools/lldb-server/*.h",
]),
target_compatible_with = select({
"@platforms//os:linux": [],
"@platforms//os:macos": [],
# TODO: This can theoretically support more platforms, but it hasn't been tested yet
"//conditions:default": ["@platforms//:incompatible"],
}),
deps = [
":Host",
":Initialization",
":Utility",
":Version",
":lldb_server_opts_gen",
"//lldb:Target",
"//lldb:TargetHeaders",
"//lldb/source/Plugins:PluginCPlusPlusLanguage",
"//lldb/source/Plugins:PluginExpressionParserClang",
"//lldb/source/Plugins:PluginInstructionARM",
"//lldb/source/Plugins:PluginInstructionARM64",
"//lldb/source/Plugins:PluginInstructionLoongArch",
"//lldb/source/Plugins:PluginInstructionMIPS",
"//lldb/source/Plugins:PluginInstructionMIPS64",
"//lldb/source/Plugins:PluginInstructionRISCV",
"//lldb/source/Plugins:PluginObjCLanguage",
"//lldb/source/Plugins:PluginProcessGDBRemote",
"//lldb/source/Plugins:PluginSymbolFileDWARF",
"//lldb/source/Plugins:PluginSymbolFileNativePDB",
"//lldb/source/Plugins:PluginSymbolFilePDB",
"//lldb/source/Plugins:PluginTypeSystemClang",
"//llvm:Option",
"//llvm:Support",
] + select({
"@platforms//os:linux": [
"//lldb/source/Plugins:PluginObjectFileELF",
"//lldb/source/Plugins:PluginProcessLinux",
],
"@platforms//os:macos": [
"//lldb/source/Plugins:PluginObjectFileMachO",
],
"//conditions:default": [],
}),
)
19 changes: 19 additions & 0 deletions utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2100,6 +2100,25 @@ cc_library(
],
)

cc_library(
name = "PluginProcessLinux",
srcs = glob(["Process/Linux/*.cpp"]),
hdrs = glob(["Process/Linux/*.h"]),
include_prefix = "Plugins",
deps = [
":PluginProcessPOSIX",
":PluginProcessUtility",
"//lldb:Core",
"//lldb:Headers",
"//lldb:Host",
"//lldb:SymbolHeaders",
"//lldb:TargetHeaders",
"//lldb:Utility",
"//llvm:Support",
"//llvm:TargetParser",
],
)

cc_library(
name = "PluginScriptedProcess",
srcs = glob(["Process/scripted/*.cpp"]),
Expand Down

0 comments on commit 1bc0921

Please sign in to comment.