#include "SystemInitializerFull.h"
#include "lldb/API/SBCommandInterpreter.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/Progress.h"
#include "lldb/Host/Config.h"
#include "lldb/Host/Host.h"
#include "lldb/Initialization/SystemInitializerCommon.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Target/ProcessTrace.h"
#include "lldb/Utility/Timer.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/TargetSelect.h"
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wglobal-constructors"
#include "llvm/ExecutionEngine/MCJIT.h"
#pragma clang diagnostic pop
#include <string>
#define LLDB_PLUGIN(p) LLDB_PLUGIN_DECLARE(p)
#include "Plugins/Plugins.def"
#if LLDB_ENABLE_PYTHON
#include "Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h"
constexpr lldb_private::HostInfo::SharedLibraryDirectoryHelper
*g_shlib_dir_helper =
lldb_private::ScriptInterpreterPython::SharedLibraryDirectoryHelper;
#else
constexpr lldb_private::HostInfo::SharedLibraryDirectoryHelper
*g_shlib_dir_helper = nullptr;
#endif
using namespace lldb_private;
SystemInitializerFull::SystemInitializerFull()
: SystemInitializerCommon(g_shlib_dir_helper) {}
SystemInitializerFull::~SystemInitializerFull() = default;
llvm::Error SystemInitializerFull::Initialize() {
llvm::Error error = SystemInitializerCommon::Initialize();
if (error)
return error;
llvm::InitializeAllTargets();
llvm::InitializeAllAsmPrinters();
llvm::InitializeAllTargetMCs();
llvm::InitializeAllDisassemblers();
const char *arg0 = "lldb";
llvm::cl::ParseCommandLineOptions(1, &arg0);
ProgressManager::Initialize();
#define LLDB_PLUGIN(p) LLDB_PLUGIN_INITIALIZE(p);
#include "Plugins/Plugins.def"
PluginManager::Initialize();
Debugger::SettingsInitialize();
SetLLDBAssertCallback(Debugger::AssertCallback);
return llvm::Error::success();
}
void SystemInitializerFull::Terminate() {
Debugger::SettingsTerminate();
ProcessTrace::Terminate();
PluginManager::Terminate();
#define LLDB_PLUGIN(p) LLDB_PLUGIN_TERMINATE(p);
#include "Plugins/Plugins.def"
ProgressManager::Terminate();
SystemInitializerCommon::Terminate();
}