blob: e7fe5db66d9651af3b9d38eb74d25cfdeaed42eb [file] [log] [blame]
Zachary Turnere6e2bb32015-03-31 21:03:22 +00001//===-- SystemInitializerFull.cpp -------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
Zachary Turner2c1f46d2015-07-30 20:28:07 +000010#if !defined(LLDB_DISABLE_PYTHON)
11#include "Plugins/ScriptInterpreter/Python/lldb-python.h"
12#endif
13
Zachary Turnere6e2bb32015-03-31 21:03:22 +000014#include "lldb/API/SystemInitializerFull.h"
15
Zachary Turner2c1f46d2015-07-30 20:28:07 +000016#include "lldb/API/SBCommandInterpreter.h"
17
18#if !defined(LLDB_DISABLE_PYTHON)
19#include "Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h"
20#endif
21
Zachary Turnere6e2bb32015-03-31 21:03:22 +000022#include "lldb/Core/Debugger.h"
23#include "lldb/Core/Timer.h"
24#include "lldb/Host/Host.h"
25#include "lldb/Initialization/SystemInitializerCommon.h"
Zachary Turner2c1f46d2015-07-30 20:28:07 +000026#include "lldb/Interpreter/CommandInterpreter.h"
Greg Clayton56939cb2015-09-17 22:23:34 +000027#include "lldb/Symbol/ClangASTContext.h"
28#include "lldb/Symbol/GoASTContext.h"
Tamas Berghammer87a97692016-02-26 14:21:23 +000029#include "lldb/Symbol/JavaASTContext.h"
Tamas Berghammer00adc412016-08-02 11:15:55 +000030#include "lldb/Symbol/OCamlASTContext.h"
Zachary Turnere6e2bb32015-03-31 21:03:22 +000031
Zachary Turnere6e2bb32015-03-31 21:03:22 +000032#include "Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h"
33#include "Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h"
Zachary Turner74e08ca2016-03-02 22:05:52 +000034#include "Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h"
Omair Javaid52f825b2015-04-29 10:49:45 +000035#include "Plugins/ABI/SysV-arm/ABISysV_arm.h"
Omair Javaidb78e05f2015-04-29 11:52:35 +000036#include "Plugins/ABI/SysV-arm64/ABISysV_arm64.h"
Ted Woodwardbff0a212015-12-10 17:53:07 +000037#include "Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h"
Greg Claytonb289cba2015-06-25 17:50:15 +000038#include "Plugins/ABI/SysV-i386/ABISysV_i386.h"
Bhushan D. Attardea8219f22015-06-18 07:02:10 +000039#include "Plugins/ABI/SysV-mips/ABISysV_mips.h"
Bhushan D. Attarde13f54252015-06-19 04:25:07 +000040#include "Plugins/ABI/SysV-mips64/ABISysV_mips64.h"
Zachary Turner74e08ca2016-03-02 22:05:52 +000041#include "Plugins/ABI/SysV-ppc/ABISysV_ppc.h"
42#include "Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h"
Ulrich Weigandbb00d0b2016-04-14 14:28:34 +000043#include "Plugins/ABI/SysV-s390x/ABISysV_s390x.h"
Zachary Turner74e08ca2016-03-02 22:05:52 +000044#include "Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h"
Zachary Turnere6e2bb32015-03-31 21:03:22 +000045#include "Plugins/Disassembler/llvm/DisassemblerLLVMC.h"
Pavel Labath773c3b02016-03-29 15:00:26 +000046#include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h"
Jason Molenda9ab5dc22016-07-21 08:30:55 +000047#include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h"
Pavel Labath773c3b02016-03-29 15:00:26 +000048#include "Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h"
Pavel Labathf1763532016-06-29 13:58:27 +000049#include "Plugins/DynamicLoader/Static/DynamicLoaderStatic.h"
Pavel Labath773c3b02016-03-29 15:00:26 +000050#include "Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h"
Zachary Turnere6e2bb32015-03-31 21:03:22 +000051#include "Plugins/Instruction/ARM64/EmulateInstructionARM64.h"
Zachary Turnere6e2bb32015-03-31 21:03:22 +000052#include "Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.h"
Kuba Brecka6a831432016-03-23 15:36:22 +000053#include "Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.h"
Zachary Turnere6e2bb32015-03-31 21:03:22 +000054#include "Plugins/JITLoader/GDB/JITLoaderGDB.h"
Enrico Granata980c0482015-09-01 18:22:39 +000055#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
Ryan Brown2dd84882015-11-05 00:24:36 +000056#include "Plugins/Language/Go/GoLanguage.h"
Tamas Berghammer87a97692016-02-26 14:21:23 +000057#include "Plugins/Language/Java/JavaLanguage.h"
Enrico Granata980c0482015-09-01 18:22:39 +000058#include "Plugins/Language/ObjC/ObjCLanguage.h"
59#include "Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h"
Tamas Berghammer00adc412016-08-02 11:15:55 +000060#include "Plugins/Language/OCaml/OCamlLanguage.h"
Zachary Turnere6e2bb32015-03-31 21:03:22 +000061#include "Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h"
Ryan Brown07a1c452015-10-06 20:29:31 +000062#include "Plugins/LanguageRuntime/Go/GoLanguageRuntime.h"
Tamas Berghammer87a97692016-02-26 14:21:23 +000063#include "Plugins/LanguageRuntime/Java/JavaLanguageRuntime.h"
Zachary Turner74e08ca2016-03-02 22:05:52 +000064#include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h"
65#include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h"
Colin Riley5ec532a2015-04-09 16:49:25 +000066#include "Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h"
Zachary Turnere6e2bb32015-03-31 21:03:22 +000067#include "Plugins/MemoryHistory/asan/MemoryHistoryASan.h"
Pavel Labatha7760cb2016-03-16 08:48:56 +000068#include "Plugins/OperatingSystem/Go/OperatingSystemGo.h"
Pavel Labathf1763532016-06-29 13:58:27 +000069#include "Plugins/OperatingSystem/Python/OperatingSystemPython.h"
70#include "Plugins/Platform/Android/PlatformAndroid.h"
71#include "Plugins/Platform/FreeBSD/PlatformFreeBSD.h"
72#include "Plugins/Platform/Kalimba/PlatformKalimba.h"
73#include "Plugins/Platform/Linux/PlatformLinux.h"
74#include "Plugins/Platform/MacOSX/PlatformMacOSX.h"
75#include "Plugins/Platform/MacOSX/PlatformRemoteiOS.h"
76#include "Plugins/Platform/NetBSD/PlatformNetBSD.h"
77#include "Plugins/Platform/Windows/PlatformWindows.h"
Zachary Turnere6e2bb32015-03-31 21:03:22 +000078#include "Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h"
79#include "Plugins/Process/elf-core/ProcessElfCore.h"
80#include "Plugins/Process/gdb-remote/ProcessGDBRemote.h"
Zachary Turner2c1f46d2015-07-30 20:28:07 +000081#include "Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h"
Zachary Turnere6e2bb32015-03-31 21:03:22 +000082#include "Plugins/SymbolFile/DWARF/SymbolFileDWARF.h"
83#include "Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h"
Zachary Turner74e08ca2016-03-02 22:05:52 +000084#include "Plugins/SymbolFile/PDB/SymbolFilePDB.h"
Zachary Turnere6e2bb32015-03-31 21:03:22 +000085#include "Plugins/SymbolFile/Symtab/SymbolFileSymtab.h"
86#include "Plugins/SymbolVendor/ELF/SymbolVendorELF.h"
87#include "Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h"
Zachary Turnere6e2bb32015-03-31 21:03:22 +000088#include "Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h"
Zachary Turner74e08ca2016-03-02 22:05:52 +000089#include "Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h"
Zachary Turnere6e2bb32015-03-31 21:03:22 +000090
91#if defined(__APPLE__)
Pavel Labathf1763532016-06-29 13:58:27 +000092#include "Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h"
Jason Molenda5e88be92015-11-06 00:22:53 +000093#include "Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h"
94#include "Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h"
Pavel Labathf1763532016-06-29 13:58:27 +000095#include "Plugins/Platform/MacOSX/PlatformDarwinKernel.h"
Jason Molenda5e88be92015-11-06 00:22:53 +000096#include "Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h"
97#include "Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h"
Pavel Labathf1763532016-06-29 13:58:27 +000098#include "Plugins/Platform/MacOSX/PlatformiOSSimulator.h"
99#include "Plugins/Process/MacOSX-Kernel/ProcessKDP.h"
100#include "Plugins/Process/mach-core/ProcessMachCore.h"
101#include "Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h"
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000102#endif
103
104#if defined(__FreeBSD__)
105#include "Plugins/Process/FreeBSD/ProcessFreeBSD.h"
106#endif
107
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000108#if defined(_MSC_VER)
109#include "lldb/Host/windows/windows.h"
Adrian McCarthy18a9135d2015-10-28 18:21:45 +0000110#include "Plugins/Process/Windows/Live/ProcessWindowsLive.h"
Adrian McCarthy27785dd2015-08-24 16:00:51 +0000111#include "Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.h"
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000112#endif
113
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000114#include "llvm/Support/TargetSelect.h"
115
116#include <string>
117
118using namespace lldb_private;
119
120#ifndef LLDB_DISABLE_PYTHON
121
122// Defined in the SWIG source file
Zachary Turnerc5b41d62015-10-16 17:52:03 +0000123#if PY_MAJOR_VERSION >= 3
124extern "C" PyObject*
125PyInit__lldb(void);
126
127#define LLDBSwigPyInit PyInit__lldb
128
129#else
Ed Maste81b4c5f2016-01-04 01:43:47 +0000130extern "C" void
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000131init_lldb(void);
132
Zachary Turnerc5b41d62015-10-16 17:52:03 +0000133#define LLDBSwigPyInit init_lldb
134#endif
135
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000136// these are the Pythonic implementations of the required callbacks
137// these are scripting-language specific, which is why they belong here
138// we still need to use function pointers to them instead of relying
139// on linkage-time resolution because the SWIG stuff and this file
140// get built at different times
141extern "C" bool
142LLDBSwigPythonBreakpointCallbackFunction (const char *python_function_name,
143 const char *session_dictionary_name,
144 const lldb::StackFrameSP& sb_frame,
145 const lldb::BreakpointLocationSP& sb_bp_loc);
146
147extern "C" bool
148LLDBSwigPythonWatchpointCallbackFunction (const char *python_function_name,
149 const char *session_dictionary_name,
150 const lldb::StackFrameSP& sb_frame,
151 const lldb::WatchpointSP& sb_wp);
152
153extern "C" bool
154LLDBSwigPythonCallTypeScript (const char *python_function_name,
155 void *session_dictionary,
156 const lldb::ValueObjectSP& valobj_sp,
157 void** pyfunct_wrapper,
158 const lldb::TypeSummaryOptionsSP& options_sp,
159 std::string& retval);
160
161extern "C" void*
162LLDBSwigPythonCreateSyntheticProvider (const char *python_class_name,
163 const char *session_dictionary_name,
164 const lldb::ValueObjectSP& valobj_sp);
165
166extern "C" void*
167LLDBSwigPythonCreateCommandObject (const char *python_class_name,
168 const char *session_dictionary_name,
169 const lldb::DebuggerSP debugger_sp);
170
171extern "C" void*
172LLDBSwigPythonCreateScriptedThreadPlan (const char *python_class_name,
173 const char *session_dictionary_name,
174 const lldb::ThreadPlanSP& thread_plan_sp);
175
176extern "C" bool
177LLDBSWIGPythonCallThreadPlan (void *implementor,
178 const char *method_name,
179 Event *event_sp,
180 bool &got_error);
181
182extern "C" size_t
Siva Chandra9ac7a6c2015-10-21 19:28:08 +0000183LLDBSwigPython_CalculateNumChildren (void *implementor, uint32_t max);
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000184
185extern "C" void *
186LLDBSwigPython_GetChildAtIndex (void *implementor, uint32_t idx);
187
188extern "C" int
189LLDBSwigPython_GetIndexOfChildWithName (void *implementor, const char* child_name);
190
191extern "C" void *
192LLDBSWIGPython_CastPyObjectToSBValue (void* data);
193
194extern lldb::ValueObjectSP
195LLDBSWIGPython_GetValueObjectSPFromSBValue (void* data);
196
197extern "C" bool
198LLDBSwigPython_UpdateSynthProviderInstance (void* implementor);
199
200extern "C" bool
201LLDBSwigPython_MightHaveChildrenSynthProviderInstance (void* implementor);
202
203extern "C" void *
204LLDBSwigPython_GetValueSynthProviderInstance (void* implementor);
205
206extern "C" bool
207LLDBSwigPythonCallCommand (const char *python_function_name,
208 const char *session_dictionary_name,
209 lldb::DebuggerSP& debugger,
210 const char* args,
211 lldb_private::CommandReturnObject &cmd_retobj,
212 lldb::ExecutionContextRefSP exe_ctx_ref_sp);
213
214extern "C" bool
215LLDBSwigPythonCallCommandObject (void *implementor,
216 lldb::DebuggerSP& debugger,
217 const char* args,
218 lldb_private::CommandReturnObject& cmd_retobj,
219 lldb::ExecutionContextRefSP exe_ctx_ref_sp);
220
221extern "C" bool
222LLDBSwigPythonCallModuleInit (const char *python_module_name,
223 const char *session_dictionary_name,
224 lldb::DebuggerSP& debugger);
225
226extern "C" void*
227LLDBSWIGPythonCreateOSPlugin (const char *python_class_name,
228 const char *session_dictionary_name,
229 const lldb::ProcessSP& process_sp);
230
231extern "C" bool
232LLDBSWIGPythonRunScriptKeywordProcess (const char* python_function_name,
233 const char* session_dictionary_name,
234 lldb::ProcessSP& process,
235 std::string& output);
236
237extern "C" bool
238LLDBSWIGPythonRunScriptKeywordThread (const char* python_function_name,
239 const char* session_dictionary_name,
240 lldb::ThreadSP& thread,
241 std::string& output);
242
243extern "C" bool
244LLDBSWIGPythonRunScriptKeywordTarget (const char* python_function_name,
245 const char* session_dictionary_name,
246 lldb::TargetSP& target,
247 std::string& output);
248
249extern "C" bool
250LLDBSWIGPythonRunScriptKeywordFrame (const char* python_function_name,
251 const char* session_dictionary_name,
252 lldb::StackFrameSP& frame,
253 std::string& output);
254
255extern "C" bool
256LLDBSWIGPythonRunScriptKeywordValue (const char* python_function_name,
257 const char* session_dictionary_name,
258 lldb::ValueObjectSP& value,
259 std::string& output);
260
261extern "C" void*
262LLDBSWIGPython_GetDynamicSetting (void* module,
263 const char* setting,
264 const lldb::TargetSP& target_sp);
265
266
267#endif
268
269SystemInitializerFull::SystemInitializerFull()
270{
271}
272
273SystemInitializerFull::~SystemInitializerFull()
274{
275}
276
277void
278SystemInitializerFull::Initialize()
279{
Zachary Turner2c1f46d2015-07-30 20:28:07 +0000280 SystemInitializerCommon::Initialize();
Keno Fischer6e776772015-08-23 09:05:29 +0000281 ScriptInterpreterNone::Initialize();
Zachary Turner2c1f46d2015-07-30 20:28:07 +0000282
Pavel Labatha7760cb2016-03-16 08:48:56 +0000283#ifndef LLDB_DISABLE_PYTHON
284 OperatingSystemPython::Initialize();
285#endif
286 OperatingSystemGo::Initialize();
287
Zachary Turner2c1f46d2015-07-30 20:28:07 +0000288#if !defined(LLDB_DISABLE_PYTHON)
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000289 InitializeSWIG();
290
Zachary Turner2c1f46d2015-07-30 20:28:07 +0000291 // ScriptInterpreterPython::Initialize() depends on things like HostInfo being initialized
292 // so it can compute the python directory etc, so we need to do this after
293 // SystemInitializerCommon::Initialize().
Zachary Turner2c1f46d2015-07-30 20:28:07 +0000294 ScriptInterpreterPython::Initialize();
295#endif
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000296
Pavel Labathf1763532016-06-29 13:58:27 +0000297 platform_freebsd::PlatformFreeBSD::Initialize();
298 platform_linux::PlatformLinux::Initialize();
299 platform_netbsd::PlatformNetBSD::Initialize();
300 PlatformWindows::Initialize();
301 PlatformKalimba::Initialize();
302 platform_android::PlatformAndroid::Initialize();
303 PlatformRemoteiOS::Initialize();
304 PlatformMacOSX::Initialize();
305#if defined(__APPLE__)
306 PlatformiOSSimulator::Initialize();
307 PlatformDarwinKernel::Initialize();
308#endif
309
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000310 // Initialize LLVM and Clang
311 llvm::InitializeAllTargets();
312 llvm::InitializeAllAsmPrinters();
313 llvm::InitializeAllTargetMCs();
314 llvm::InitializeAllDisassemblers();
315
Greg Clayton56939cb2015-09-17 22:23:34 +0000316 ClangASTContext::Initialize();
317 GoASTContext::Initialize();
Tamas Berghammer87a97692016-02-26 14:21:23 +0000318 JavaASTContext::Initialize();
Tamas Berghammer00adc412016-08-02 11:15:55 +0000319 OCamlASTContext::Initialize();
Greg Clayton56939cb2015-09-17 22:23:34 +0000320
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000321 ABIMacOSX_i386::Initialize();
322 ABIMacOSX_arm::Initialize();
323 ABIMacOSX_arm64::Initialize();
Omair Javaid52f825b2015-04-29 10:49:45 +0000324 ABISysV_arm::Initialize();
Omair Javaidb78e05f2015-04-29 11:52:35 +0000325 ABISysV_arm64::Initialize();
Ted Woodwardbff0a212015-12-10 17:53:07 +0000326 ABISysV_hexagon::Initialize();
Greg Claytonb289cba2015-06-25 17:50:15 +0000327 ABISysV_i386::Initialize();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000328 ABISysV_x86_64::Initialize();
329 ABISysV_ppc::Initialize();
330 ABISysV_ppc64::Initialize();
Bhushan D. Attardea8219f22015-06-18 07:02:10 +0000331 ABISysV_mips::Initialize();
Bhushan D. Attarde13f54252015-06-19 04:25:07 +0000332 ABISysV_mips64::Initialize();
Ulrich Weigandbb00d0b2016-04-14 14:28:34 +0000333 ABISysV_s390x::Initialize();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000334 DisassemblerLLVMC::Initialize();
335
336 JITLoaderGDB::Initialize();
337 ProcessElfCore::Initialize();
Adrian McCarthyc96516f2015-08-03 23:01:51 +0000338#if defined(_MSC_VER)
339 ProcessWinMiniDump::Initialize();
340#endif
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000341 MemoryHistoryASan::Initialize();
342 AddressSanitizerRuntime::Initialize();
Kuba Brecka6a831432016-03-23 15:36:22 +0000343 ThreadSanitizerRuntime::Initialize();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000344
345 SymbolVendorELF::Initialize();
346 SymbolFileDWARF::Initialize();
Zachary Turner74e08ca2016-03-02 22:05:52 +0000347 SymbolFilePDB::Initialize();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000348 SymbolFileSymtab::Initialize();
349 UnwindAssemblyInstEmulation::Initialize();
350 UnwindAssembly_x86::Initialize();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000351 EmulateInstructionARM64::Initialize();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000352 SymbolFileDWARFDebugMap::Initialize();
353 ItaniumABILanguageRuntime::Initialize();
354 AppleObjCRuntimeV2::Initialize();
355 AppleObjCRuntimeV1::Initialize();
356 SystemRuntimeMacOSX::Initialize();
Colin Riley5ec532a2015-04-09 16:49:25 +0000357 RenderScriptRuntime::Initialize();
Ryan Brown07a1c452015-10-06 20:29:31 +0000358 GoLanguageRuntime::Initialize();
Tamas Berghammer87a97692016-02-26 14:21:23 +0000359 JavaLanguageRuntime::Initialize();
Ed Maste81b4c5f2016-01-04 01:43:47 +0000360
Enrico Granata980c0482015-09-01 18:22:39 +0000361 CPlusPlusLanguage::Initialize();
Ryan Brown2dd84882015-11-05 00:24:36 +0000362 GoLanguage::Initialize();
Tamas Berghammer87a97692016-02-26 14:21:23 +0000363 JavaLanguage::Initialize();
Enrico Granata980c0482015-09-01 18:22:39 +0000364 ObjCLanguage::Initialize();
365 ObjCPlusPlusLanguage::Initialize();
Tamas Berghammer00adc412016-08-02 11:15:55 +0000366 OCamlLanguage::Initialize();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000367
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000368#if defined(_MSC_VER)
Adrian McCarthy18a9135d2015-10-28 18:21:45 +0000369 ProcessWindowsLive::Initialize();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000370#endif
371#if defined(__FreeBSD__)
372 ProcessFreeBSD::Initialize();
373#endif
374#if defined(__APPLE__)
375 SymbolVendorMacOSX::Initialize();
376 ProcessKDP::Initialize();
377 ProcessMachCore::Initialize();
Jason Molenda5e88be92015-11-06 00:22:53 +0000378 PlatformAppleTVSimulator::Initialize();
379 PlatformAppleWatchSimulator::Initialize();
380 PlatformRemoteAppleTV::Initialize();
381 PlatformRemoteAppleWatch::Initialize();
Pavel Labath773c3b02016-03-29 15:00:26 +0000382 DynamicLoaderDarwinKernel::Initialize();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000383#endif
384 //----------------------------------------------------------------------
385 // Platform agnostic plugins
386 //----------------------------------------------------------------------
387 platform_gdb_server::PlatformRemoteGDBServer::Initialize();
388
389 process_gdb_remote::ProcessGDBRemote::Initialize();
Pavel Labath773c3b02016-03-29 15:00:26 +0000390 DynamicLoaderMacOSXDYLD::Initialize();
Jason Molenda9ab5dc22016-07-21 08:30:55 +0000391 DynamicLoaderMacOS::Initialize();
Pavel Labath773c3b02016-03-29 15:00:26 +0000392 DynamicLoaderPOSIXDYLD::Initialize();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000393 DynamicLoaderStatic::Initialize();
Pavel Labath773c3b02016-03-29 15:00:26 +0000394 DynamicLoaderWindowsDYLD::Initialize();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000395
396 // Scan for any system or user LLDB plug-ins
397 PluginManager::Initialize();
398
399 // The process settings need to know about installed plug-ins, so the Settings must be initialized
400 // AFTER PluginManager::Initialize is called.
401
402 Debugger::SettingsInitialize();
403}
404
405void SystemInitializerFull::InitializeSWIG()
406{
407#if !defined(LLDB_DISABLE_PYTHON)
408 ScriptInterpreterPython::InitializeInterpreter(
Zachary Turnerc5b41d62015-10-16 17:52:03 +0000409 LLDBSwigPyInit,
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000410 LLDBSwigPythonBreakpointCallbackFunction,
411 LLDBSwigPythonWatchpointCallbackFunction,
412 LLDBSwigPythonCallTypeScript,
413 LLDBSwigPythonCreateSyntheticProvider,
414 LLDBSwigPythonCreateCommandObject,
415 LLDBSwigPython_CalculateNumChildren,
416 LLDBSwigPython_GetChildAtIndex,
417 LLDBSwigPython_GetIndexOfChildWithName,
418 LLDBSWIGPython_CastPyObjectToSBValue,
419 LLDBSWIGPython_GetValueObjectSPFromSBValue,
420 LLDBSwigPython_UpdateSynthProviderInstance,
421 LLDBSwigPython_MightHaveChildrenSynthProviderInstance,
422 LLDBSwigPython_GetValueSynthProviderInstance,
423 LLDBSwigPythonCallCommand,
424 LLDBSwigPythonCallCommandObject,
425 LLDBSwigPythonCallModuleInit,
426 LLDBSWIGPythonCreateOSPlugin,
427 LLDBSWIGPythonRunScriptKeywordProcess,
428 LLDBSWIGPythonRunScriptKeywordThread,
429 LLDBSWIGPythonRunScriptKeywordTarget,
430 LLDBSWIGPythonRunScriptKeywordFrame,
431 LLDBSWIGPythonRunScriptKeywordValue,
432 LLDBSWIGPython_GetDynamicSetting,
433 LLDBSwigPythonCreateScriptedThreadPlan,
434 LLDBSWIGPythonCallThreadPlan);
435#endif
436}
437
438void
439SystemInitializerFull::Terminate()
440{
441 Timer scoped_timer(__PRETTY_FUNCTION__, __PRETTY_FUNCTION__);
442
443 Debugger::SettingsTerminate();
444
445 // Terminate and unload and loaded system or user LLDB plug-ins
446 PluginManager::Terminate();
Greg Clayton56939cb2015-09-17 22:23:34 +0000447
448 ClangASTContext::Terminate();
449 GoASTContext::Terminate();
Tamas Berghammer87a97692016-02-26 14:21:23 +0000450 JavaASTContext::Terminate();
Tamas Berghammer00adc412016-08-02 11:15:55 +0000451 OCamlASTContext::Terminate();
Greg Clayton56939cb2015-09-17 22:23:34 +0000452
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000453 ABIMacOSX_i386::Terminate();
454 ABIMacOSX_arm::Terminate();
455 ABIMacOSX_arm64::Terminate();
Omair Javaid52f825b2015-04-29 10:49:45 +0000456 ABISysV_arm::Terminate();
Omair Javaidb78e05f2015-04-29 11:52:35 +0000457 ABISysV_arm64::Terminate();
Ted Woodwardbff0a212015-12-10 17:53:07 +0000458 ABISysV_hexagon::Terminate();
Greg Claytonb289cba2015-06-25 17:50:15 +0000459 ABISysV_i386::Terminate();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000460 ABISysV_x86_64::Terminate();
461 ABISysV_ppc::Terminate();
462 ABISysV_ppc64::Terminate();
Bhushan D. Attardea8219f22015-06-18 07:02:10 +0000463 ABISysV_mips::Terminate();
Bhushan D. Attarde13f54252015-06-19 04:25:07 +0000464 ABISysV_mips64::Terminate();
Ulrich Weigandbb00d0b2016-04-14 14:28:34 +0000465 ABISysV_s390x::Terminate();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000466 DisassemblerLLVMC::Terminate();
467
468 JITLoaderGDB::Terminate();
469 ProcessElfCore::Terminate();
Adrian McCarthyc96516f2015-08-03 23:01:51 +0000470#if defined(_MSC_VER)
471 ProcessWinMiniDump::Terminate();
472#endif
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000473 MemoryHistoryASan::Terminate();
474 AddressSanitizerRuntime::Terminate();
Kuba Brecka6a831432016-03-23 15:36:22 +0000475 ThreadSanitizerRuntime::Terminate();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000476 SymbolVendorELF::Terminate();
477 SymbolFileDWARF::Terminate();
Zachary Turner74e08ca2016-03-02 22:05:52 +0000478 SymbolFilePDB::Terminate();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000479 SymbolFileSymtab::Terminate();
480 UnwindAssembly_x86::Terminate();
481 UnwindAssemblyInstEmulation::Terminate();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000482 EmulateInstructionARM64::Terminate();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000483 SymbolFileDWARFDebugMap::Terminate();
484 ItaniumABILanguageRuntime::Terminate();
485 AppleObjCRuntimeV2::Terminate();
486 AppleObjCRuntimeV1::Terminate();
487 SystemRuntimeMacOSX::Terminate();
Colin Riley5ec532a2015-04-09 16:49:25 +0000488 RenderScriptRuntime::Terminate();
Tamas Berghammer87a97692016-02-26 14:21:23 +0000489 JavaLanguageRuntime::Terminate();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000490
Enrico Granata980c0482015-09-01 18:22:39 +0000491 CPlusPlusLanguage::Terminate();
Ryan Brown2dd84882015-11-05 00:24:36 +0000492 GoLanguage::Terminate();
Tamas Berghammer87a97692016-02-26 14:21:23 +0000493 JavaLanguage::Terminate();
Enrico Granata980c0482015-09-01 18:22:39 +0000494 ObjCLanguage::Terminate();
495 ObjCPlusPlusLanguage::Terminate();
Tamas Berghammer00adc412016-08-02 11:15:55 +0000496 OCamlLanguage::Terminate();
Ed Maste81b4c5f2016-01-04 01:43:47 +0000497
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000498#if defined(__APPLE__)
Pavel Labath773c3b02016-03-29 15:00:26 +0000499 DynamicLoaderDarwinKernel::Terminate();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000500 ProcessMachCore::Terminate();
501 ProcessKDP::Terminate();
502 SymbolVendorMacOSX::Terminate();
Jason Molenda5e88be92015-11-06 00:22:53 +0000503 PlatformAppleTVSimulator::Terminate();
504 PlatformAppleWatchSimulator::Terminate();
505 PlatformRemoteAppleTV::Terminate();
506 PlatformRemoteAppleWatch::Terminate();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000507#endif
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000508
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000509#if defined(__FreeBSD__)
510 ProcessFreeBSD::Terminate();
511#endif
512 Debugger::SettingsTerminate();
513
514 platform_gdb_server::PlatformRemoteGDBServer::Terminate();
515 process_gdb_remote::ProcessGDBRemote::Terminate();
Pavel Labath773c3b02016-03-29 15:00:26 +0000516 DynamicLoaderMacOSXDYLD::Terminate();
Jason Molenda9ab5dc22016-07-21 08:30:55 +0000517 DynamicLoaderMacOS::Terminate();
Pavel Labath773c3b02016-03-29 15:00:26 +0000518 DynamicLoaderPOSIXDYLD::Terminate();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000519 DynamicLoaderStatic::Terminate();
Pavel Labath773c3b02016-03-29 15:00:26 +0000520 DynamicLoaderWindowsDYLD::Terminate();
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000521
Pavel Labatha7760cb2016-03-16 08:48:56 +0000522#ifndef LLDB_DISABLE_PYTHON
523 OperatingSystemPython::Terminate();
524#endif
525 OperatingSystemGo::Terminate();
526
Pavel Labathf1763532016-06-29 13:58:27 +0000527 platform_freebsd::PlatformFreeBSD::Terminate();
528 platform_linux::PlatformLinux::Terminate();
529 platform_netbsd::PlatformNetBSD::Terminate();
530 PlatformWindows::Terminate();
531 PlatformKalimba::Terminate();
532 platform_android::PlatformAndroid::Terminate();
533 PlatformMacOSX::Terminate();
534 PlatformRemoteiOS::Terminate();
535#if defined(__APPLE__)
536 PlatformiOSSimulator::Terminate();
537 PlatformDarwinKernel::Terminate();
538#endif
539
Zachary Turnere6e2bb32015-03-31 21:03:22 +0000540 // Now shutdown the common parts, in reverse order.
541 SystemInitializerCommon::Terminate();
542}