summaryrefslogtreecommitdiffstats
path: root/lldb/source/Breakpoint/BreakpointList.cpp
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/Breakpoint/BreakpointList.cpp
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/Breakpoint/BreakpointList.cpp')
-rw-r--r--lldb/source/Breakpoint/BreakpointList.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/lldb/source/Breakpoint/BreakpointList.cpp b/lldb/source/Breakpoint/BreakpointList.cpp
index a47a07d92e5..7f35588ea87 100644
--- a/lldb/source/Breakpoint/BreakpointList.cpp
+++ b/lldb/source/Breakpoint/BreakpointList.cpp
@@ -137,6 +137,23 @@ BreakpointList::FindBreakpointByID(break_id_t break_id) const {
return stop_sp;
}
+bool BreakpointList::FindBreakpointsByName(const char *name,
+ BreakpointList &matching_bps) {
+ Error error;
+ if (!name)
+ return false;
+
+ if (!BreakpointID::StringIsBreakpointName(llvm::StringRef(name), error))
+ return false;
+
+ for (BreakpointSP bkpt_sp : Breakpoints()) {
+ if (bkpt_sp->MatchesName(name)) {
+ matching_bps.Add(bkpt_sp, false);
+ }
+ }
+ return true;
+}
+
void BreakpointList::Dump(Stream *s) const {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
s->Printf("%p: ", static_cast<const void *>(this));
OpenPOWER on IntegriCloud