Adds tests for breakpoint names, and a FindBreakpointsByName.
Also if you set a breakpoint with an invalid name, we'll
refuse to set the breakpoint rather than silently ignoring
the name.
llvm-svn: 282043
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index 7cf9215..9449e9a 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -1079,6 +1079,23 @@
return sb_breakpoint;
}
+bool SBTarget::FindBreakpointsByName(const char *name,
+ SBBreakpointList &bkpts) {
+ TargetSP target_sp(GetSP());
+ if (target_sp) {
+ std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
+ BreakpointList bkpt_list(false);
+ bool is_valid =
+ target_sp->GetBreakpointList().FindBreakpointsByName(name, bkpt_list);
+ if (!is_valid)
+ return false;
+ for (BreakpointSP bkpt_sp : bkpt_list.Breakpoints()) {
+ bkpts.AppendByID(bkpt_sp->GetID());
+ }
+ }
+ return true;
+}
+
bool SBTarget::EnableAllBreakpoints() {
TargetSP target_sp(GetSP());
if (target_sp) {