1 import("//llvm/lib/Target/targets.gni")
2 import("//llvm/utils/gn/build/write_cmake_config.gni")
4 # In the CMake build, each plugin calls `add_lldb_library(name PLUGIN ...)`,
5 # which implicitly adds the plugin name to the LLDB_PLUGINS list.
6 # A few places then query that list and add dependencies on it.
7 # lldb/source/Plugins/CMakeList.txt then does string munging on the list of
8 # plugin names to generate Plugins.def.
9 # In the GN build, we instead have an explicit list of all plugins here.
10 # Every entry in this list is a (GN target, LLDB_PLUGIN Plugins.def name) pair.
14 "//lldb/source/Plugins/ABI/X86",
20 "//lldb/source/Plugins/Architecture/PPC64",
24 "//lldb/source/Plugins/Disassembler/LLVMC",
28 "//lldb/source/Plugins/DynamicLoader/Darwin-Kernel",
29 "DynamicLoaderDarwinKernel",
32 "//lldb/source/Plugins/DynamicLoader/MacOSX-DYLD",
33 "DynamicLoaderMacOSXDYLD",
36 "//lldb/source/Plugins/DynamicLoader/POSIX-DYLD",
37 "DynamicLoaderPosixDYLD",
40 "//lldb/source/Plugins/DynamicLoader/Static",
41 "DynamicLoaderStatic",
44 "//lldb/source/Plugins/DynamicLoader/Windows-DYLD",
45 "DynamicLoaderWindowsDYLD",
48 "//lldb/source/Plugins/Instruction/ARM",
52 "//lldb/source/Plugins/JITLoader/GDB",
56 "//lldb/source/Plugins/Language/CPlusPlus",
60 "//lldb/source/Plugins/Language/ObjC",
64 "//lldb/source/Plugins/Language/ObjCPlusPlus",
65 "ObjCPlusPlusLanguage",
68 "//lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI",
72 "//lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime",
76 "//lldb/source/Plugins/ObjectContainer/BSD-Archive",
77 "ObjectContainerBSDArchive",
80 "//lldb/source/Plugins/ObjectContainer/Universal-Mach-O",
81 "ObjectContainerMachOArchive",
84 "//lldb/source/Plugins/ObjectFile/Breakpad",
88 "//lldb/source/Plugins/ObjectFile/ELF",
92 "//lldb/source/Plugins/ObjectFile/Mach-O",
96 "//lldb/source/Plugins/ObjectFile/PDB",
100 "//lldb/source/Plugins/ObjectFile/PECOFF",
104 "//lldb/source/Plugins/ObjectFile/Placeholder",
105 "ObjectFilePlaceholder",
108 "//lldb/source/Plugins/ObjectFile/wasm",
112 "//lldb/source/Plugins/Platform/Linux",
116 "//lldb/source/Plugins/Platform/MacOSX",
120 "//lldb/source/Plugins/Platform/Windows",
124 "//lldb/source/Plugins/Process/elf-core",
128 "//lldb/source/Plugins/Process/gdb-remote",
129 "", # Uses LLDB_PROCESS_GDB_PLUGIN instead.
132 "//lldb/source/Plugins/Process/mach-core",
136 "//lldb/source/Plugins/Process/minidump",
140 "//lldb/source/Plugins/REPL/Clang",
144 "//lldb/source/Plugins/ScriptInterpreter/None",
145 "", # Uses LLDB_SCRIPT_PLUGIN instead.
148 "//lldb/source/Plugins/SymbolFile/Breakpad",
149 "SymbolFileBreakpad",
152 "//lldb/source/Plugins/SymbolFile/DWARF",
156 "//lldb/source/Plugins/SymbolFile/PDB",
160 "//lldb/source/Plugins/SymbolFile/Symtab",
164 if (current_os == "mac") {
166 "//lldb/source/Plugins/SymbolVendor/MacOSX",
167 "SymbolVendorMacOSX",
172 "//lldb/source/Plugins/SymbolVendor/ELF",
177 "//lldb/source/Plugins/SymbolVendor/wasm",
182 "//lldb/source/Plugins/SymbolVendor/PECOFF",
183 "SymbolVendorPECOFF",
187 "//lldb/source/Plugins/TypeSystem/Clang",
192 "//lldb/source/Plugins/UnwindAssembly/InstEmulation",
193 "UnwindAssemblyInstEmulation",
196 "//lldb/source/Plugins/UnwindAssembly/x86",
201 write_cmake_config("Plugins.def") {
202 input = "Plugins.def.in"
203 output = "$target_gen_dir/Plugins.def"
206 foreach(plugin, lldb_plugins) {
207 plugin_id = plugin[1]
208 if (plugin_id != "") {
209 # \n is a literal '\' followed by a literal 'n', not a newline character.
210 # write_cmake_config.py replaces it with a real newline.
211 enum_plugins += "LLDB_PLUGIN(" + plugin_id + ")\n"
215 deps = [ "//lldb/source/Plugins/ScriptInterpreter/None" ]
216 enum_plugins += "LLDB_SCRIPT_PLUGIN(ScriptInterpreterNone)"
218 values = [ "LLDB_ENUM_PLUGINS=" + enum_plugins ]
220 # These are in separate variables to make sure ProcessWindowsCommon is
221 # initalized after all plugins, but before ProcessGDBRemote.
222 if (current_os == "win") {
224 [ "LLDB_PROCESS_WINDOWS_PLUGIN=LLDB_PLUGIN(ProcessWindowsCommon)" ]
226 values += [ "LLDB_PROCESS_WINDOWS_PLUGIN=" ]
228 values += [ "LLDB_PROCESS_GDB_PLUGIN=LLDB_PLUGIN(ProcessGDBRemote)" ]
231 config("AllLldbPlugins_config") {
232 visibility = [ ":LldbAllPlugins" ]
234 # To pick up Plugins.def.
235 include_dirs = [ "$root_gen_dir/lldb/source" ]
238 group("LldbAllPlugins") {
239 deps = [ ":Plugins.def" ]
240 foreach(plugin, lldb_plugins) {
241 deps += [ plugin[0] ]
243 public_configs = [ ":AllLldbPlugins_config" ]