[Lldb-commits] [lldb] [lldb-dap] assembly breakpoints (PR #139969)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Tue May 20 08:10:46 PDT 2025


================
@@ -72,21 +99,31 @@ BreakpointLocationsRequestHandler::Run(
     }
   }
 
-  // The line entries are sorted by addresses, but we must return the list
-  // ordered by line / column position.
-  std::sort(locations.begin(), locations.end());
-  locations.erase(llvm::unique(locations), locations.end());
+  return locations;
+}
 
-  std::vector<protocol::BreakpointLocation> breakpoint_locations;
-  for (auto &l : locations) {
-    protocol::BreakpointLocation lc;
-    lc.line = l.first;
-    lc.column = l.second;
-    breakpoint_locations.push_back(std::move(lc));
+std::vector<std::pair<uint32_t, uint32_t>>
+BreakpointLocationsRequestHandler::GetAssemblyBreakpointLocations(
+    int64_t source_reference, uint32_t start_line, uint32_t end_line) const {
+  std::vector<std::pair<uint32_t, uint32_t>> locations;
+  lldb::SBAddress address(source_reference, dap.target);
+  if (!address.IsValid())
+    return locations;
+
+  lldb::SBSymbol symbol = address.GetSymbol();
+  if (!symbol.IsValid())
+    return locations;
+
+  // start_line is relative to the symbol's start address
----------------
JDevlieghere wrote:

```suggestion
  // start_line is relative to the symbol's start address.
```

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


More information about the lldb-commits mailing list