[Lldb-commits] [lldb] r132930 - in /lldb/trunk/source/Commands: CommandObjectExpression.cpp CommandObjectExpression.h
Caroline Tice
ctice at apple.com
Mon Jun 13 13:20:29 PDT 2011
Author: ctice
Date: Mon Jun 13 15:20:29 2011
New Revision: 132930
URL: http://llvm.org/viewvc/llvm-project?rev=132930&view=rev
Log:
More prompt-timing cleanups: Make multi-line expressions
use the asynchronous stream mechanism rather than writing
directly to the Debugger's output & error streams.
Modified:
lldb/trunk/source/Commands/CommandObjectExpression.cpp
lldb/trunk/source/Commands/CommandObjectExpression.h
Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.cpp?rev=132930&r1=132929&r2=132930&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectExpression.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectExpression.cpp Mon Jun 13 15:20:29 2011
@@ -234,9 +234,13 @@
case eInputReaderDone:
if (cmd_object_expr->m_expr_lines.size() > 0)
{
+ StreamSP output_stream = reader.GetDebugger().GetAsyncOutputStream();
+ StreamSP error_stream = reader.GetDebugger().GetAsyncErrorStream();
cmd_object_expr->EvaluateExpression (cmd_object_expr->m_expr_lines.c_str(),
- reader.GetDebugger().GetOutputStream(),
- reader.GetDebugger().GetErrorStream());
+ output_stream.get(),
+ error_stream.get());
+ output_stream->Flush();
+ error_stream->Flush();
}
break;
}
@@ -248,8 +252,8 @@
CommandObjectExpression::EvaluateExpression
(
const char *expr,
- Stream &output_stream,
- Stream &error_stream,
+ Stream *output_stream,
+ Stream *error_stream,
CommandReturnObject *result
)
{
@@ -307,7 +311,7 @@
if (m_options.format != eFormatDefault)
result_valobj_sp->SetFormat (m_options.format);
- ValueObject::DumpValueObject (output_stream,
+ ValueObject::DumpValueObject (*(output_stream),
result_valobj_sp.get(), // Variable object to dump
result_valobj_sp->GetName().GetCString(),// Root object name
0, // Pointer depth to traverse (zero means stop at pointers)
@@ -324,7 +328,7 @@
}
else
{
- error_stream.PutCString(result_valobj_sp->GetError().AsCString());
+ error_stream->PutCString(result_valobj_sp->GetError().AsCString());
if (result)
result->SetStatus (eReturnStatusFailed);
}
@@ -332,7 +336,7 @@
}
else
{
- error_stream.Printf ("error: invalid execution context for expression\n");
+ error_stream->Printf ("error: invalid execution context for expression\n");
return false;
}
@@ -426,7 +430,7 @@
if (expr == NULL)
expr = command;
- if (EvaluateExpression (expr, result.GetOutputStream(), result.GetErrorStream(), &result))
+ if (EvaluateExpression (expr, &(result.GetOutputStream()), &(result.GetErrorStream()), &result))
return true;
result.SetStatus (eReturnStatusFailed);
Modified: lldb/trunk/source/Commands/CommandObjectExpression.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.h?rev=132930&r1=132929&r2=132930&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectExpression.h (original)
+++ lldb/trunk/source/Commands/CommandObjectExpression.h Mon Jun 13 15:20:29 2011
@@ -89,8 +89,8 @@
bool
EvaluateExpression (const char *expr,
- Stream &output_stream,
- Stream &error_stream,
+ Stream *output_stream,
+ Stream *error_stream,
CommandReturnObject *result = NULL);
CommandOptions m_options;
More information about the lldb-commits
mailing list