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 "//lldb/source/Plugins/SymbolLocator/Default",
165 "SymbolLocatorDefault",
168 if (current_os == "mac") {
171 "//lldb/source/Plugins/SymbolLocator/DebugSymbols",
172 "SymbolLocatorDebugSymbols",
175 "//lldb/source/Plugins/SymbolVendor/MacOSX",
176 "SymbolVendorMacOSX",
182 "//lldb/source/Plugins/SymbolVendor/ELF",
187 "//lldb/source/Plugins/SymbolVendor/wasm",
192 "//lldb/source/Plugins/SymbolVendor/PECOFF",
193 "SymbolVendorPECOFF",
197 "//lldb/source/Plugins/TypeSystem/Clang",
202 "//lldb/source/Plugins/UnwindAssembly/InstEmulation",
203 "UnwindAssemblyInstEmulation",
206 "//lldb/source/Plugins/UnwindAssembly/x86",
211 write_cmake_config("Plugins.def") {
212 input = "Plugins.def.in"
213 output = "$target_gen_dir/Plugins.def"
216 foreach(plugin, lldb_plugins) {
217 plugin_id = plugin[1]
218 if (plugin_id != "") {
219 # \n is a literal '\' followed by a literal 'n', not a newline character.
220 # write_cmake_config.py replaces it with a real newline.
221 enum_plugins += "LLDB_PLUGIN(" + plugin_id + ")\n"
225 deps = [ "//lldb/source/Plugins/ScriptInterpreter/None" ]
226 enum_plugins += "LLDB_SCRIPT_PLUGIN(ScriptInterpreterNone)"
228 values = [ "LLDB_ENUM_PLUGINS=" + enum_plugins ]
230 # These are in separate variables to make sure ProcessWindowsCommon is
231 # initalized after all plugins, but before ProcessGDBRemote.
232 if (current_os == "win") {
234 [ "LLDB_PROCESS_WINDOWS_PLUGIN=LLDB_PLUGIN(ProcessWindowsCommon)" ]
236 values += [ "LLDB_PROCESS_WINDOWS_PLUGIN=" ]
238 values += [ "LLDB_PROCESS_GDB_PLUGIN=LLDB_PLUGIN(ProcessGDBRemote)" ]
241 config("AllLldbPlugins_config") {
242 visibility = [ ":LldbAllPlugins" ]
244 # To pick up Plugins.def.
245 include_dirs = [ "$root_gen_dir/lldb/source" ]
248 group("LldbAllPlugins") {
249 deps = [ ":Plugins.def" ]
250 foreach(plugin, lldb_plugins) {
251 deps += [ plugin[0] ]
253 public_configs = [ ":AllLldbPlugins_config" ]