[Lldb-commits] [lldb] [lldb-dap] Refactor lldb-dap.cpp to not use global DAP variable. (PR #116272)

John Harrison via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 15 04:24:25 PST 2024


================
@@ -5046,30 +5026,48 @@ int main(int argc, char *argv[]) {
     pause();
   }
 #endif
+
+  // Initialize LLDB first before we do anything.
+  lldb::SBDebugger::Initialize();
+
+  // Terminate the debugger before the C++ destructor chain kicks in.
+  auto terminate_debugger =
+      llvm::make_scope_exit([] { lldb::SBDebugger::Terminate(); });
+
+  DAP dap = DAP(program_path.str(), default_repl_mode);
----------------
ashgti wrote:

I can follow up with a delete of the copy constructor 

https://github.com/llvm/llvm-project/pull/116272


More information about the lldb-commits mailing list