diff options
author | Jim Ingham <jingham@apple.com> | 2014-08-29 17:34:17 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2014-08-29 17:34:17 +0000 |
commit | b5796cb40e6f7a5e504d8da41d0f31d4539d7110 (patch) | |
tree | dc2a15b5074282ded8d7907e54b42676ed35e07d /lldb/source/Interpreter/ScriptInterpreterPython.cpp | |
parent | 09366de7a3d183071400c175cb5cf7ddc2321358 (diff) | |
download | bcm5719-llvm-b5796cb40e6f7a5e504d8da41d0f31d4539d7110.tar.gz bcm5719-llvm-b5796cb40e6f7a5e504d8da41d0f31d4539d7110.zip |
Allow "breakpoint command add" to add commands to more than one breakpoint at a time.
<rdar://problem/13314462>
llvm-svn: 216747
Diffstat (limited to 'lldb/source/Interpreter/ScriptInterpreterPython.cpp')
-rw-r--r-- | lldb/source/Interpreter/ScriptInterpreterPython.cpp | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index dd5ee748938..1b24fea7c21 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -256,24 +256,30 @@ ScriptInterpreterPython::IOHandlerInputComplete (IOHandler &io_handler, std::str break; case eIOHandlerBreakpoint: { - BreakpointOptions *bp_options = (BreakpointOptions *)io_handler.GetUserData(); - std::unique_ptr<BreakpointOptions::CommandData> data_ap(new BreakpointOptions::CommandData()); - if (data_ap.get()) + std::vector<BreakpointOptions *> *bp_options_vec = (std::vector<BreakpointOptions *> *)io_handler.GetUserData(); + for (auto bp_options : *bp_options_vec) { - data_ap->user_source.SplitIntoLines(data); - - if (GenerateBreakpointCommandCallbackData (data_ap->user_source, data_ap->script_source).Success()) - { - BatonSP baton_sp (new BreakpointOptions::CommandBaton (data_ap.release())); - bp_options->SetCallback (ScriptInterpreterPython::BreakpointCallbackFunction, baton_sp); - } - else if (!batch_mode) + if (!bp_options) + continue; + + std::unique_ptr<BreakpointOptions::CommandData> data_ap(new BreakpointOptions::CommandData()); + if (data_ap.get()) { - StreamFileSP error_sp = io_handler.GetErrorStreamFile(); - if (error_sp) + data_ap->user_source.SplitIntoLines(data); + + if (GenerateBreakpointCommandCallbackData (data_ap->user_source, data_ap->script_source).Success()) { - error_sp->Printf ("Warning: No command attached to breakpoint.\n"); - error_sp->Flush(); + BatonSP baton_sp (new BreakpointOptions::CommandBaton (data_ap.release())); + bp_options->SetCallback (ScriptInterpreterPython::BreakpointCallbackFunction, baton_sp); + } + else if (!batch_mode) + { + StreamFileSP error_sp = io_handler.GetErrorStreamFile(); + if (error_sp) + { + error_sp->Printf ("Warning: No command attached to breakpoint.\n"); + error_sp->Flush(); + } } } } @@ -307,8 +313,6 @@ ScriptInterpreterPython::IOHandlerInputComplete (IOHandler &io_handler, std::str } break; } - - } @@ -1087,11 +1091,11 @@ ScriptInterpreterPython::ExecuteMultipleLines (const char *in_string, const Exec void -ScriptInterpreterPython::CollectDataForBreakpointCommandCallback (BreakpointOptions *bp_options, +ScriptInterpreterPython::CollectDataForBreakpointCommandCallback (std::vector<BreakpointOptions *> &bp_options_vec, CommandReturnObject &result) { m_active_io_handler = eIOHandlerBreakpoint; - m_interpreter.GetPythonCommandsFromIOHandler (" ", *this, true, bp_options); + m_interpreter.GetPythonCommandsFromIOHandler (" ", *this, true, &bp_options_vec); } void |