Add the ability to deserialize only breakpoints matching a given name.

Also tests for this and the ThreadSpec serialization.

llvm-svn: 282207
This commit is contained in:
Jim Ingham
2016-09-22 22:20:28 +00:00
parent fcee2d8001
commit 3acdf38519
9 changed files with 264 additions and 12 deletions

View File

@@ -1128,6 +1128,13 @@ bool SBTarget::DeleteAllBreakpoints() {
lldb::SBError SBTarget::BreakpointsCreateFromFile(SBFileSpec &source_file,
SBBreakpointList &new_bps) {
SBStringList empty_name_list;
return BreakpointsCreateFromFile(source_file, empty_name_list, new_bps);
}
lldb::SBError SBTarget::BreakpointsCreateFromFile(SBFileSpec &source_file,
SBStringList &matching_names,
SBBreakpointList &new_bps) {
SBError sberr;
TargetSP target_sp(GetSP());
if (!target_sp) {
@@ -1138,7 +1145,14 @@ lldb::SBError SBTarget::BreakpointsCreateFromFile(SBFileSpec &source_file,
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
BreakpointIDList bp_ids;
sberr.ref() = target_sp->CreateBreakpointsFromFile(source_file.ref(), bp_ids);
std::vector<std::string> name_vector;
size_t num_names = matching_names.GetSize();
for (size_t i = 0; i < num_names; i++)
name_vector.push_back(matching_names.GetStringAtIndex(i));
sberr.ref() = target_sp->CreateBreakpointsFromFile(source_file.ref(),
name_vector, bp_ids);
if (sberr.Fail())
return sberr;