mirror of
https://github.com/intel/llvm.git
synced 2026-01-22 07:01:03 +08:00
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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user