From 85e8b8149243052c721c97ad97ebda82867071a4 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Sat, 19 Feb 2011 02:53:09 +0000 Subject: - Changed all the places where CommandObjectReturn was exporting a StreamString to just exporting a Stream, and then added GetOutputData & GetErrorData to get the accumulated data. - Added a StreamTee that will tee output to two provided lldb::StreamSP's. - Made the CommandObjectReturn use this so you can Tee the results immediately to the debuggers output file, as well as saving up the results to return when the command is done executing. - HandleCommands now uses this so that if you have a set of commands that continue the target you will see the commands come out as they are processed. - The Driver now uses this to output the command results as you go, which makes the interface more reactive seeming. llvm-svn: 126015 --- .../Commands/CommandObjectBreakpointCommand.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'lldb/source/Commands/CommandObjectBreakpointCommand.cpp') diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp index edca869e48a..f88264b6c1b 100644 --- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp @@ -790,15 +790,19 @@ CommandObjectBreakpointCommand::BreakpointOptionsCallbackFunction BreakpointOptions::CommandData *data = (BreakpointOptions::CommandData *) baton; StringList &commands = data->user_source; - + if (commands.GetSize() > 0) { - CommandReturnObject result; if (context->exe_ctx.target) { - + CommandReturnObject result; Debugger &debugger = context->exe_ctx.target->GetDebugger(); - + // Rig up the results secondary output stream to the debugger's, so the output will come out synchronously + // if the debugger is set up that way. + + result.SetImmediateOutputFile (debugger.GetOutputFile().GetStream()); + result.SetImmediateErrorFile (debugger.GetErrorFile().GetStream()); + bool stop_on_continue = true; bool echo_commands = false; bool print_results = true; @@ -810,14 +814,6 @@ CommandObjectBreakpointCommand::BreakpointOptionsCallbackFunction echo_commands, print_results, result); - // Now dump the commands to the debugger's output: - if (!result.Succeeded()) - { - debugger.GetErrorFile().Printf ("%s", result.GetErrorStream().GetData()); - } - - debugger.GetOutputFile().Printf ("%s", result.GetOutputStream().GetData()); - } } return ret_value; -- cgit v1.2.3