Add the ability to set python breakpoint commands from the SBBreakpoint & SBBreakpointLocation API's.
You can either provide the function name, or function body text.
Also propagate the compilation error up from where it is checked so we can report compilation errors.
<rdar://problem/9898371>
llvm-svn: 205380
diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
index 532d6ce..0b28cc3 100644
--- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
@@ -504,16 +504,10 @@
m_interpreter.GetScriptInterpreter()->SetBreakpointCommandCallback (bp_options,
m_options.m_one_liner.c_str());
}
- // Special handling for using a Python function by name
- // instead of extending the breakpoint callback data structures, we just automatize
- // what the user would do manually: make their breakpoint command be a function call
else if (m_options.m_function_name.size())
{
- std::string oneliner("return ");
- oneliner += m_options.m_function_name;
- oneliner += "(frame, bp_loc, internal_dict)";
- m_interpreter.GetScriptInterpreter()->SetBreakpointCommandCallback (bp_options,
- oneliner.c_str());
+ m_interpreter.GetScriptInterpreter()->SetBreakpointCommandCallbackFunction (bp_options,
+ m_options.m_function_name.c_str());
}
else
{