summaryrefslogtreecommitdiffstats
path: root/lldb/source/API
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2016-09-21 01:21:19 +0000
committerJim Ingham <jingham@apple.com>2016-09-21 01:21:19 +0000
commitff9a91ea98e2093887220cf08081036b638e92ef (patch)
tree16a6cec1d52d049b618f62d87e1df0daf22c3c23 /lldb/source/API
parent09aa01a6f86e348800d76d7e7008eba9b2d5803f (diff)
downloadbcm5719-llvm-ff9a91ea98e2093887220cf08081036b638e92ef.tar.gz
bcm5719-llvm-ff9a91ea98e2093887220cf08081036b638e92ef.zip
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
Diffstat (limited to 'lldb/source/API')
-rw-r--r--lldb/source/API/SBTarget.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index 7cf9215aab8..9449e9aff2d 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -1079,6 +1079,23 @@ SBBreakpoint SBTarget::FindBreakpointByID(break_id_t bp_id) {
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) {
OpenPOWER on IntegriCloud