This is the main part of a change to add breakpoint save and restore to lldb.

Still to come:
1) SB API's
2) Testcases
3) Loose ends:
   a) serialize Thread options
   b) serialize Exception resolvers
4) "break list --file" should list breakpoints contained in a file and
   "break read -f 1 3 5" should then read in only those breakpoints.

<rdar://problem/12611863>

llvm-svn: 281273
This commit is contained in:
Jim Ingham
2016-09-12 23:10:56 +00:00
parent 9db7948e90
commit e14dc26857
23 changed files with 1861 additions and 257 deletions

View File

@@ -36,6 +36,77 @@ BreakpointResolverFileLine::BreakpointResolverFileLine(
BreakpointResolverFileLine::~BreakpointResolverFileLine() {}
BreakpointResolver *BreakpointResolverFileLine::CreateFromStructuredData(
Breakpoint *bkpt, StructuredData::Dictionary &options_dict, Error &error) {
std::string filename;
uint32_t line_no;
bool check_inlines;
bool skip_prologue;
bool exact_match;
bool success;
lldb::addr_t offset = 0;
success = options_dict.GetValueForKeyAsString(GetKey(OptionNames::FileName),
filename);
if (!success) {
error.SetErrorString("BRFL::CFSD: Couldn't find filename entry.");
return nullptr;
}
success = options_dict.GetValueForKeyAsInteger(
GetKey(OptionNames::LineNumber), line_no);
if (!success) {
error.SetErrorString("BRFL::CFSD: Couldn't find line number entry.");
return nullptr;
}
success = options_dict.GetValueForKeyAsBoolean(GetKey(OptionNames::Inlines),
check_inlines);
if (!success) {
error.SetErrorString("BRFL::CFSD: Couldn't find check inlines entry.");
return nullptr;
}
success = options_dict.GetValueForKeyAsBoolean(
GetKey(OptionNames::SkipPrologue), skip_prologue);
if (!success) {
error.SetErrorString("BRFL::CFSD: Couldn't find skip prologue entry.");
return nullptr;
}
success = options_dict.GetValueForKeyAsBoolean(
GetKey(OptionNames::ExactMatch), exact_match);
if (!success) {
error.SetErrorString("BRFL::CFSD: Couldn't find exact match entry.");
return nullptr;
}
FileSpec file_spec(filename.c_str(), false);
return new BreakpointResolverFileLine(bkpt, file_spec, line_no, offset,
check_inlines, skip_prologue,
exact_match);
}
StructuredData::ObjectSP
BreakpointResolverFileLine::SerializeToStructuredData() {
StructuredData::DictionarySP options_dict_sp(
new StructuredData::Dictionary());
options_dict_sp->AddStringItem(GetKey(OptionNames::FileName),
m_file_spec.GetPath());
options_dict_sp->AddIntegerItem(GetKey(OptionNames::LineNumber),
m_line_number);
options_dict_sp->AddBooleanItem(GetKey(OptionNames::Inlines), m_inlines);
options_dict_sp->AddBooleanItem(GetKey(OptionNames::SkipPrologue),
m_skip_prologue);
options_dict_sp->AddBooleanItem(GetKey(OptionNames::ExactMatch),
m_exact_match);
return WrapOptionsDict(options_dict_sp);
}
Searcher::CallbackReturn
BreakpointResolverFileLine::SearchCallback(SearchFilter &filter,
SymbolContext &context,