diff options
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpoint.cpp | 16 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpointCommand.cpp | 20 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectMultiword.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectProcess.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectRegister.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectThread.cpp | 4 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectVersion.cpp | 3 |
7 files changed, 22 insertions, 27 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index 4dff1420c4e..e291d93df56 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -34,7 +34,7 @@ using namespace lldb; using namespace lldb_private; static void -AddBreakpointDescription (StreamString *s, Breakpoint *bp, lldb::DescriptionLevel level) +AddBreakpointDescription (Stream *s, Breakpoint *bp, lldb::DescriptionLevel level) { s->IndentMore(); bp->GetDescription (s, level, true); @@ -370,8 +370,8 @@ CommandObjectBreakpointSet::Execute m_options.m_check_inlines).get(); if (bp) { - StreamString &output_stream = result.GetOutputStream(); - output_stream.Printf ("Breakpoint created: "); + Stream &output_stream = result.GetOutputStream(); + result.AppendMessage ("Breakpoint created: "); bp->GetDescription(&output_stream, lldb::eDescriptionLevelBrief); output_stream.EOL(); if (bp->GetNumLocations() == 0) @@ -417,7 +417,7 @@ CommandObjectBreakpointSet::Execute Breakpoint::Exact).get(); if (bp) { - StreamString &output_stream = result.GetOutputStream(); + Stream &output_stream = result.GetOutputStream(); output_stream.Printf ("Breakpoint created: "); bp->GetDescription(&output_stream, lldb::eDescriptionLevelBrief); output_stream.EOL(); @@ -450,7 +450,7 @@ CommandObjectBreakpointSet::Execute bp = target->CreateBreakpoint (&module_spec, regexp).get(); if (bp) { - StreamString &output_stream = result.GetOutputStream(); + Stream &output_stream = result.GetOutputStream(); output_stream.Printf ("Breakpoint created: "); bp->GetDescription(&output_stream, lldb::eDescriptionLevelBrief); output_stream.EOL(); @@ -497,7 +497,7 @@ CommandObjectBreakpointSet::Execute if (bp && !use_module) { - StreamString &output_stream = result.GetOutputStream(); + Stream &output_stream = result.GetOutputStream(); output_stream.Printf ("Breakpoint created: "); bp->GetDescription(&output_stream, lldb::eDescriptionLevelBrief); output_stream.EOL(); @@ -775,7 +775,7 @@ CommandObjectBreakpointList::Execute return true; } - StreamString &output_stream = result.GetOutputStream(); + Stream &output_stream = result.GetOutputStream(); if (args.GetArgumentCount() == 0) { @@ -1212,7 +1212,7 @@ CommandObjectBreakpointClear::Execute if (num_cleared > 0) { - StreamString &output_stream = result.GetOutputStream(); + Stream &output_stream = result.GetOutputStream(); output_stream.Printf ("%d breakpoints cleared:\n", num_cleared); output_stream << ss.GetData(); output_stream.EOL(); 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; diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp index db500a7f66c..e5435fc648a 100644 --- a/lldb/source/Commands/CommandObjectMultiword.cpp +++ b/lldb/source/Commands/CommandObjectMultiword.cpp @@ -187,7 +187,7 @@ CommandObjectMultiword::GenerateHelpText (CommandReturnObject &result) // First time through here, generate the help text for the object and // push it to the return result object as well - StreamString &output_stream = result.GetOutputStream(); + Stream &output_stream = result.GetOutputStream(); output_stream.PutCString ("The following subcommands are supported:\n\n"); CommandMap::iterator pos; diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index 7329ccbb1d9..22fd6c2406b 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -1483,7 +1483,7 @@ public: CommandReturnObject &result ) { - StreamString &output_stream = result.GetOutputStream(); + Stream &output_stream = result.GetOutputStream(); result.SetStatus (eReturnStatusSuccessFinishNoResult); ExecutionContext exe_ctx(m_interpreter.GetDebugger().GetExecutionContext()); if (exe_ctx.process) diff --git a/lldb/source/Commands/CommandObjectRegister.cpp b/lldb/source/Commands/CommandObjectRegister.cpp index 4bcf681f633..d9cb5de6fe6 100644 --- a/lldb/source/Commands/CommandObjectRegister.cpp +++ b/lldb/source/Commands/CommandObjectRegister.cpp @@ -65,7 +65,7 @@ public: CommandReturnObject &result ) { - StreamString &output_stream = result.GetOutputStream(); + Stream &output_stream = result.GetOutputStream(); DataExtractor reg_data; ExecutionContext exe_ctx(m_interpreter.GetDebugger().GetExecutionContext()); RegisterContext *reg_context = exe_ctx.GetRegisterContext (); diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index af11fa7bf6f..487cfc96b56 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -131,7 +131,7 @@ lldb_private::DisplayThreadsInfo if (num_thread_infos_dumped < num_threads) result.GetOutputStream().Printf("%u of %u threads stopped with reasons:\n", num_thread_infos_dumped, num_threads); - result.GetOutputStream().GetString().append(strm.GetString()); + result.AppendMessage (strm.GetString().c_str()); result.SetStatus (eReturnStatusSuccessFinishNoResult); } return num_thread_infos_dumped; @@ -1379,7 +1379,7 @@ public: CommandReturnObject &result ) { - StreamString &strm = result.GetOutputStream(); + Stream &strm = result.GetOutputStream(); result.SetStatus (eReturnStatusSuccessFinishNoResult); ExecutionContext exe_ctx(m_interpreter.GetDebugger().GetExecutionContext()); if (exe_ctx.process) diff --git a/lldb/source/Commands/CommandObjectVersion.cpp b/lldb/source/Commands/CommandObjectVersion.cpp index 5e159e1cbc8..99b92e7a407 100644 --- a/lldb/source/Commands/CommandObjectVersion.cpp +++ b/lldb/source/Commands/CommandObjectVersion.cpp @@ -40,8 +40,7 @@ CommandObjectVersion::Execute CommandReturnObject &result ) { - StreamString &output_stream = result.GetOutputStream(); - output_stream.Printf ("%s\n", lldb_private::GetVersion()); + result.AppendMessageWithFormat ("%s\n", lldb_private::GetVersion()); result.SetStatus (eReturnStatusSuccessFinishResult); return true; } |