[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


================
@@ -33,16 +36,51 @@ SourceBreakpoint::SourceBreakpoint(DAP &dap,
       m_line(breakpoint.line),
       m_column(breakpoint.column.value_or(LLDB_INVALID_COLUMN_NUMBER)) {}
 
-void SourceBreakpoint::SetBreakpoint(const llvm::StringRef source_path) {
+llvm::Error SourceBreakpoint::SetBreakpoint(const protocol::Source &source) {
   lldb::SBMutex lock = m_dap.GetAPIMutex();
   std::lock_guard<lldb::SBMutex> guard(lock);
 
-  lldb::SBFileSpecList module_list;
-  m_bp = m_dap.target.BreakpointCreateByLocation(
-      source_path.str().c_str(), m_line, m_column, 0, module_list);
+  if (m_line == 0)
+    return llvm::createStringError(llvm::inconvertibleErrorCode(),
+                                   "Invalid line number.");
+
+  if (source.sourceReference) {
+    // breakpoint set by assembly source.
+    lldb::SBAddress source_address(*source.sourceReference, m_dap.target);
+    if (!source_address.IsValid())
+      return llvm::createStringError(llvm::inconvertibleErrorCode(),
+                                     "Invalid sourceReference.");
+
+    lldb::SBSymbol symbol = source_address.GetSymbol();
+    if (!symbol.IsValid()) {
+      // Not yet supporting breakpoints in assembly without a valid symbol.
----------------
JDevlieghere wrote:

```suggestion
      // FIXME: Support assembly breakpoints without a valid symbol.
```

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


More information about the lldb-commits mailing list