aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/API/SBDebugger.cpp
diff options
context:
space:
mode:
authorDmitry Vasilyev <dvassiliev@accesssoftek.com>2025-04-08 22:24:59 +0400
committerGitHub <noreply@github.com>2025-04-08 22:24:59 +0400
commit7e70d708a39470397a8df9aa5842d0875b471def (patch)
tree94d1fd9e461b402bda9191e5fc13f5214b8c0684 /lldb/source/API/SBDebugger.cpp
parent3b84b1e1635cc6af9ff745d0542ebee151394c42 (diff)
downloadllvm-7e70d708a39470397a8df9aa5842d0875b471def.zip
llvm-7e70d708a39470397a8df9aa5842d0875b471def.tar.gz
llvm-7e70d708a39470397a8df9aa5842d0875b471def.tar.bz2
[LLDB][NFC] Remove Debugger dependency in SystemLifetimeManager (#134383)
It reduces the memory usage in lldb-server.
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;