[Lldb-commits] [lldb] [lldb-dap] Refactoring lldb-dap to support running in a server mode, allowing multiple connections. (PR #114881)

John Harrison via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 5 17:03:50 PST 2024


================
@@ -12,15 +12,19 @@
 
 namespace lldb_dap {
 
-SourceBreakpoint::SourceBreakpoint(const llvm::json::Object &obj)
-    : Breakpoint(obj), logMessage(std::string(GetString(obj, "logMessage"))),
+SourceBreakpoint::SourceBreakpoint(DAP *dap, const llvm::json::Object &obj)
+    : Breakpoint(dap, obj),
+      logMessage(std::string(GetString(obj, "logMessage"))),
       line(GetUnsigned(obj, "line", 0)), column(GetUnsigned(obj, "column", 0)) {
 }
 
 void SourceBreakpoint::SetBreakpoint(const llvm::StringRef source_path) {
+  if (!dap)
----------------
ashgti wrote:

It would happen if a breakpoint outlived the dap or was incorrectly initialized. However, I replaced the `DAP*` with a `DAP&`, which means this shouldn't happen anymore.

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


More information about the lldb-commits mailing list