================
@@ -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:

Seems like we are using the breakpoint API just so we can answer the questions 
"tell me all of the locations that map to source file and line". I would prefer 
to expose the source file + line resolving code in a `SBTarget` API so we can 
avoid having to use breakpoints just so we can get all of the locations. The 
API I am thinking would be:
```
lldb::SBSymbolContextList lldb::SBTarget::ResolveContexts(lldb::SBFileSpec 
&file_spec, uint32_t line);
```
And this returns the same info as the breakpoint location contexts. LLDB 
breakpoint code uses address resolvers and search filters, and we can just use 
the same APIs as the breakpoints. 


https://github.com/llvm/llvm-project/pull/130503
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to