[Lldb-commits] [lldb] [llvm] [lldb][lldb-dap] Implement jump to cursor (PR #130503)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 26 16:02:11 PDT 2025


================
@@ -0,0 +1,165 @@
+//===-- GoToTargetsRequestHandler.cpp -------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "DAP.h"
+
+#include "JSONUtils.h"
+
+#include <lldb/API/SBBreakpointLocation.h>
+#include <lldb/API/SBListener.h>
+#include <lldb/API/SBStream.h>
+
+namespace lldb_dap {
+
+static llvm::SmallVector<lldb::SBLineEntry>
+GetLineValidEntry(DAP &dap, const lldb::SBFileSpec &file_spec, uint32_t line) {
+  // disable breakpoint listeners so they do not send events to the DAP client.
+  lldb::SBListener listener = dap.debugger.GetListener();
+  lldb::SBBroadcaster broadcaster = dap.target.GetBroadcaster();
+  constexpr auto event_mask = lldb::SBTarget::eBroadcastBitBreakpointChanged;
+  listener.StopListeningForEvents(broadcaster, event_mask);
----------------
clayborg wrote:

A patch that adds the above APIs could be done in a separate patch. It can easily to unit tested.

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


More information about the lldb-commits mailing list