diff options
| author | Jim Ingham <jingham@apple.com> | 2016-09-12 23:10:56 +0000 |
|---|---|---|
| committer | Jim Ingham <jingham@apple.com> | 2016-09-12 23:10:56 +0000 |
| commit | e14dc26857470f248e5fc1dd14d89314eae47fa5 (patch) | |
| tree | 4233b63c194167caeb8d013fa04bbbb88441b55d /lldb/source/Breakpoint/BreakpointResolverFileLine.cpp | |
| parent | 9db7948e90133938079bc9bdb02b16cfd22f0015 (diff) | |
| download | bcm5719-llvm-e14dc26857470f248e5fc1dd14d89314eae47fa5.tar.gz bcm5719-llvm-e14dc26857470f248e5fc1dd14d89314eae47fa5.zip | |
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
Diffstat (limited to 'lldb/source/Breakpoint/BreakpointResolverFileLine.cpp')
| -rw-r--r-- | lldb/source/Breakpoint/BreakpointResolverFileLine.cpp | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp b/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp index 482b1658251..5f0b0d20eb8 100644 --- a/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp +++ b/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp @@ -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, |

