[Lldb-commits] [lldb] [lldb-dap] assembly breakpoints (PR #139969)
Ely Ronnen via lldb-commits
lldb-commits at lists.llvm.org
Mon May 19 16:04:17 PDT 2025
================
@@ -35,29 +36,34 @@ SourceBreakpoint::SourceBreakpoint(DAP &dap,
m_line(breakpoint.line),
m_column(breakpoint.column.value_or(LLDB_INVALID_COLUMN_NUMBER)) {}
-void SourceBreakpoint::SetBreakpoint(const protocol::Source &source) {
+llvm::Error SourceBreakpoint::SetBreakpoint(const protocol::Source &source) {
lldb::SBMutex lock = m_dap.GetAPIMutex();
std::lock_guard<lldb::SBMutex> guard(lock);
if (m_line == 0)
- return;
+ 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;
+ return llvm::createStringError(llvm::inconvertibleErrorCode(),
----------------
eronnen wrote:
I think for this specific case it shouldn't make it to the handler because in the same `setBreakpoints` requests there could be other successful breakpoints set. According to the protocol seems that the `message` field is the way to return errors for specific breakpoints:
```javascript
/**
* A message about the state of the breakpoint.
* This is shown to the user and can be used to explain why a breakpoint could
* not be verified.
*/
message?: string;
```
https://github.com/llvm/llvm-project/pull/139969
More information about the lldb-commits
mailing list