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
This commit is contained in:
Jim Ingham
2016-09-21 01:21:19 +00:00
parent 09aa01a6f8
commit ff9a91ea98
6 changed files with 66 additions and 4 deletions

View File

@@ -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));