[Lldb-commits] [lldb] r114894 - /lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp
Caroline Tice
ctice at apple.com
Mon Sep 27 14:35:15 PDT 2010
Author: ctice
Date: Mon Sep 27 16:35:15 2010
New Revision: 114894
URL: http://llvm.org/viewvc/llvm-project?rev=114894&view=rev
Log:
Fix one-liner Python breakpoint commands to be wrapped up in an automatically
generated Python function, and passed the stoppoint context frame and
bp_loc as parameters.
Modified:
lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp
Modified: lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp?rev=114894&r1=114893&r2=114894&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp (original)
+++ lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp Mon Sep 27 16:35:15 2010
@@ -627,7 +627,7 @@
}
}
else
- ::fprintf (out_fh, "Warning: No command attached to breakpoint.\n");
+ ::fprintf (out_fh, "Warning: No command attached to breakpoint.\n");
}
else
{
@@ -684,12 +684,18 @@
// It's necessary to set both user_source and script_source to the oneliner.
// The former is used to generate callback description (as in breakpoint command list)
// while the latter is used for Python to interpret during the actual callback.
- data_ap->user_source.AppendString (oneliner);
- data_ap->script_source.AppendString (oneliner);
- BatonSP baton_sp (new BreakpointOptions::CommandBaton (data_ap.release()));
- bp_options->SetCallback (ScriptInterpreterPython::BreakpointCallbackFunction, baton_sp);
+ data_ap->user_source.AppendString (oneliner);
+ if (GenerateBreakpointCommandCallbackData (data_ap->user_source, data_ap->script_source))
+ {
+ if (data_ap->script_source.GetSize() == 1)
+ {
+ BatonSP baton_sp (new BreakpointOptions::CommandBaton (data_ap.release()));
+ bp_options->SetCallback (ScriptInterpreterPython::BreakpointCallbackFunction, baton_sp);
+ }
+ }
+
return;
}
More information about the lldb-commits
mailing list