1import("//llvm/lib/Target/targets.gni") 2import("//llvm/utils/gn/build/write_cmake_config.gni") 3 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. 11lldb_plugins = [] 12if (llvm_build_X86) { 13 lldb_plugins += [ [ 14 "//lldb/source/Plugins/ABI/X86", 15 "ABIX86", 16 ] ] 17} 18lldb_plugins += [ 19 [ 20 "//lldb/source/Plugins/Architecture/PPC64", 21 "ArchitecturePPC64", 22 ], 23 [ 24 "//lldb/source/Plugins/Disassembler/LLVMC", 25 "DisassemblerLLVMC", 26 ], 27 [ 28 "//lldb/source/Plugins/DynamicLoader/Darwin-Kernel", 29 "DynamicLoaderDarwinKernel", 30 ], 31 [ 32 "//lldb/source/Plugins/DynamicLoader/MacOSX-DYLD", 33 "DynamicLoaderMacOSXDYLD", 34 ], 35 [ 36 "//lldb/source/Plugins/DynamicLoader/POSIX-DYLD", 37 "DynamicLoaderPosixDYLD", 38 ], 39 [ 40 "//lldb/source/Plugins/DynamicLoader/Static", 41 "DynamicLoaderStatic", 42 ], 43 [ 44 "//lldb/source/Plugins/DynamicLoader/Windows-DYLD", 45 "DynamicLoaderWindowsDYLD", 46 ], 47 [ 48 "//lldb/source/Plugins/Instruction/ARM", 49 "InstructionARM", 50 ], 51 [ 52 "//lldb/source/Plugins/JITLoader/GDB", 53 "JITLoaderGDB", 54 ], 55 [ 56 "//lldb/source/Plugins/Language/CPlusPlus", 57 "CPlusPlusLanguage", 58 ], 59 [ 60 "//lldb/source/Plugins/Language/ObjC", 61 "ObjCLanguage", 62 ], 63 [ 64 "//lldb/source/Plugins/Language/ObjCPlusPlus", 65 "ObjCPlusPlusLanguage", 66 ], 67 [ 68 "//lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI", 69 "CXXItaniumABI", 70 ], 71 [ 72 "//lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime", 73 "AppleObjCRuntime", 74 ], 75 [ 76 "//lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime", 77 "RenderScriptRuntime", 78 ], 79 [ 80 "//lldb/source/Plugins/ObjectContainer/BSD-Archive", 81 "ObjectContainerBSDArchive", 82 ], 83 [ 84 "//lldb/source/Plugins/ObjectContainer/Universal-Mach-O", 85 "ObjectContainerMachOArchive", 86 ], 87 [ 88 "//lldb/source/Plugins/ObjectFile/Breakpad", 89 "ObjectFileBreakpad", 90 ], 91 [ 92 "//lldb/source/Plugins/ObjectFile/ELF", 93 "ObjectFileELF", 94 ], 95 [ 96 "//lldb/source/Plugins/ObjectFile/JIT", 97 "ObjectFileJIT", 98 ], 99 [ 100 "//lldb/source/Plugins/ObjectFile/Mach-O", 101 "ObjectFileMachO", 102 ], 103 [ 104 "//lldb/source/Plugins/ObjectFile/PDB", 105 "ObjectFilePDB", 106 ], 107 [ 108 "//lldb/source/Plugins/ObjectFile/PECOFF", 109 "ObjectFilePECOFF", 110 ], 111 [ 112 "//lldb/source/Plugins/ObjectFile/wasm", 113 "ObjectFileWasm", 114 ], 115 [ 116 "//lldb/source/Plugins/Platform/Linux", 117 "PlatformLinux", 118 ], 119 [ 120 "//lldb/source/Plugins/Platform/MacOSX", 121 "PlatformMacOSX", 122 ], 123 [ 124 "//lldb/source/Plugins/Platform/Windows", 125 "PlatformWindows", 126 ], 127 [ 128 "//lldb/source/Plugins/Process/elf-core", 129 "ProcessElfCore", 130 ], 131 [ 132 "//lldb/source/Plugins/Process/gdb-remote", 133 "", # Uses LLDB_PROCESS_GDB_PLUGIN instead. 134 ], 135 [ 136 "//lldb/source/Plugins/Process/mach-core", 137 "ProcessMachCore", 138 ], 139 [ 140 "//lldb/source/Plugins/Process/minidump", 141 "ProcessMinidump", 142 ], 143 [ 144 "//lldb/source/Plugins/REPL/Clang", 145 "ClangREPL", 146 ], 147 [ 148 "//lldb/source/Plugins/ScriptInterpreter/None", 149 "", # Uses LLDB_SCRIPT_PLUGIN instead. 150 ], 151 [ 152 "//lldb/source/Plugins/SymbolFile/Breakpad", 153 "SymbolFileBreakpad", 154 ], 155 [ 156 "//lldb/source/Plugins/SymbolFile/DWARF", 157 "SymbolFileDWARF", 158 ], 159 [ 160 "//lldb/source/Plugins/SymbolFile/PDB", 161 "SymbolFilePDB", 162 ], 163 [ 164 "//lldb/source/Plugins/SymbolFile/Symtab", 165 "SymbolFileSymtab", 166 ], 167] 168if (current_os == "mac") { 169 lldb_plugins += [ [ 170 "//lldb/source/Plugins/SymbolVendor/MacOSX", 171 "SymbolVendorMacOSX", 172 ] ] 173} 174lldb_plugins += [ 175 [ 176 "//lldb/source/Plugins/SymbolVendor/ELF", 177 "SymbolVendorELF", 178 ], 179 180 [ 181 "//lldb/source/Plugins/SymbolVendor/wasm", 182 "SymbolVendorWasm", 183 ], 184 185 [ 186 "//lldb/source/Plugins/SymbolVendor/PECOFF", 187 "SymbolVendorPECOFF", 188 ], 189 190 [ 191 "//lldb/source/Plugins/TypeSystem/Clang", 192 "TypeSystemClang", 193 ], 194 195 [ 196 "//lldb/source/Plugins/UnwindAssembly/InstEmulation", 197 "UnwindAssemblyInstEmulation", 198 ], 199 [ 200 "//lldb/source/Plugins/UnwindAssembly/x86", 201 "UnwindAssemblyX86", 202 ], 203] 204 205write_cmake_config("Plugins.def") { 206 input = "Plugins.def.in" 207 output = "$target_gen_dir/Plugins.def" 208 209 enum_plugins = "" 210 foreach(plugin, lldb_plugins) { 211 plugin_id = plugin[1] 212 if (plugin_id != "") { 213 # \n is a literal '\' followed by a literal 'n', not a newline character. 214 # write_cmake_config.py replaces it with a real newline. 215 enum_plugins += "LLDB_PLUGIN(" + plugin_id + ")\n" 216 } 217 } 218 219 deps = [ "//lldb/source/Plugins/ScriptInterpreter/None" ] 220 enum_plugins += "LLDB_SCRIPT_PLUGIN(ScriptInterpreterNone)" 221 222 values = [ "LLDB_ENUM_PLUGINS=" + enum_plugins ] 223 224 # These are in separate variables to make sure ProcessWindowsCommon is 225 # initalized after all plugins, but before ProcessGDBRemote. 226 if (current_os == "win") { 227 values += 228 [ "LLDB_PROCESS_WINDOWS_PLUGIN=LLDB_PLUGIN(ProcessWindowsCommon)" ] 229 } else { 230 values += [ "LLDB_PROCESS_WINDOWS_PLUGIN=" ] 231 } 232 values += [ "LLDB_PROCESS_GDB_PLUGIN=LLDB_PLUGIN(ProcessGDBRemote)" ] 233} 234 235config("AllLldbPlugins_config") { 236 visibility = [ ":LldbAllPlugins" ] 237 238 # To pick up Plugins.def. 239 include_dirs = [ "$root_gen_dir/lldb/source" ] 240} 241 242group("LldbAllPlugins") { 243 deps = [ ":Plugins.def" ] 244 foreach(plugin, lldb_plugins) { 245 deps += [ plugin[0] ] 246 } 247 public_configs = [ ":AllLldbPlugins_config" ] 248} 249