aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/API/SBDebugger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/API/SBDebugger.cpp')
-rw-r--r--lldb/source/API/SBDebugger.cpp41
1 files changed, 1 insertions, 40 deletions
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp
index e646b09..2cfcdc7 100644
--- a/lldb/source/API/SBDebugger.cpp
+++ b/lldb/source/API/SBDebugger.cpp
@@ -179,48 +179,9 @@ void SBDebugger::Initialize() {
lldb::SBError SBDebugger::InitializeWithErrorHandling() {
LLDB_INSTRUMENT();
- auto LoadPlugin = [](const lldb::DebuggerSP &debugger_sp,
- const FileSpec &spec,
- Status &error) -> llvm::sys::DynamicLibrary {
- llvm::sys::DynamicLibrary dynlib =
- llvm::sys::DynamicLibrary::getPermanentLibrary(spec.GetPath().c_str());
- if (dynlib.isValid()) {
- typedef bool (*LLDBCommandPluginInit)(lldb::SBDebugger debugger);
-
- lldb::SBDebugger debugger_sb(debugger_sp);
- // This calls the bool lldb::PluginInitialize(lldb::SBDebugger debugger)
- // function.
- // TODO: mangle this differently for your system - on OSX, the first
- // underscore needs to be removed and the second one stays
- LLDBCommandPluginInit init_func =
- (LLDBCommandPluginInit)(uintptr_t)dynlib.getAddressOfSymbol(
- "_ZN4lldb16PluginInitializeENS_10SBDebuggerE");
- if (init_func) {
- if (init_func(debugger_sb))
- return dynlib;
- else
- error = Status::FromErrorString(
- "plug-in refused to load "
- "(lldb::PluginInitialize(lldb::SBDebugger) "
- "returned false)");
- } else {
- error = Status::FromErrorString(
- "plug-in is missing the required initialization: "
- "lldb::PluginInitialize(lldb::SBDebugger)");
- }
- } else {
- if (FileSystem::Instance().Exists(spec))
- error = Status::FromErrorString(
- "this file does not represent a loadable dylib");
- else
- error = Status::FromErrorString("no such file");
- }
- return llvm::sys::DynamicLibrary();
- };
-
SBError error;
if (auto e = g_debugger_lifetime->Initialize(
- std::make_unique<SystemInitializerFull>(), LoadPlugin)) {
+ std::make_unique<SystemInitializerFull>())) {
error.SetError(Status::FromError(std::move(e)));
}
return error;