[Lldb-commits] [lldb] [llvm] [lldb][lldb-dap] Implement jump to cursor (PR #130503)
via lldb-commits
lldb-commits at lists.llvm.org
Wed Mar 26 16:19:14 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);
----------------
jimingham wrote:
This seems generally useful, and it is silly to have to actually set breakpoints to do this kind of symbol search.
I think at this point we should always allow column information when we do file & line type queries along with the file & line. I almost wonder if we should have an SBLineEntrySpec to use for these sorts of queries so we don't have to repeat all the parameters. But regardless, we should allow users to also pass in column info here.
In the case of breakpoints we will allow inexact matches if the user asks for them. That's useful for setting breakpoints, but I'm not sure it's all that useful for a "ResolveContexts" type API. So I don't think you need to add a `bool exact_match` but you should document the behavior since people might be surprised if it doesn't match what `break set` of the same file & line returns.
https://github.com/llvm/llvm-project/pull/130503
More information about the lldb-commits
mailing list