summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter
diff options
context:
space:
mode:
authorCaroline Tice <ctice@apple.com>2010-09-27 21:35:15 +0000
committerCaroline Tice <ctice@apple.com>2010-09-27 21:35:15 +0000
commit988efc1ba2548311ea823fc5c1f821581bdb74f0 (patch)
tree993716216185a3af044a865aee42e29675cfb76a /lldb/source/Interpreter
parent1083573796d2f988537e18cfc71e35f11b02725b (diff)
downloadbcm5719-llvm-988efc1ba2548311ea823fc5c1f821581bdb74f0.tar.gz
bcm5719-llvm-988efc1ba2548311ea823fc5c1f821581bdb74f0.zip
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. llvm-svn: 114894
Diffstat (limited to 'lldb/source/Interpreter')
-rw-r--r--lldb/source/Interpreter/ScriptInterpreterPython.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp
index b5ef735a875..a7e34d28414 100644
--- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp
+++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp
@@ -627,7 +627,7 @@ ScriptInterpreterPython::GenerateBreakpointOptionsCommandCallback
}
}
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 @@ ScriptInterpreterPython::SetBreakpointCommandCallback (BreakpointOptions *bp_opt
// 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;
}
OpenPOWER on IntegriCloud