summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2014-02-05 21:03:22 +0000
committerGreg Clayton <gclayton@apple.com>2014-02-05 21:03:22 +0000
commite4e462c42c8feb9ae85ca30415dd3a60fde22797 (patch)
treedb233ba6f5bb1cb493b74fa95acf5a65ca00682f /lldb/source/Interpreter
parent67a28136ad7b54e4d188d903dd9ff86a05f7e74f (diff)
downloadbcm5719-llvm-e4e462c42c8feb9ae85ca30415dd3a60fde22797.tar.gz
bcm5719-llvm-e4e462c42c8feb9ae85ca30415dd3a60fde22797.zip
Fixed output to display correctly for "command source" by fixing the correct flags being set.
Also emit the "Executing commands" message so it properly only comes out when desired and so it comes out in the right place. <rdar://problem/15992208> llvm-svn: 200875
Diffstat (limited to 'lldb/source/Interpreter')
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index 2e29e16c527..58c535540bd 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -2582,7 +2582,7 @@ CommandInterpreter::HandleCommandsFromFile (FileSpec &cmd_file,
{
if (m_command_source_flags.empty())
{
- // Echo command by default
+ // Stop on continue by default
flags |= eHandleCommandFlagStopOnContinue;
}
else if (m_command_source_flags.back() & eHandleCommandFlagStopOnContinue)
@@ -2633,26 +2633,32 @@ CommandInterpreter::HandleCommandsFromFile (FileSpec &cmd_file,
{
if (m_command_source_flags.empty())
{
- // Echo command by default
- flags |= eHandleCommandFlagEchoCommand;
+ // Print output by default
+ flags |= eHandleCommandFlagPrintResult;
}
- else if (m_command_source_flags.back() & eHandleCommandFlagEchoCommand)
+ else if (m_command_source_flags.back() & eHandleCommandFlagPrintResult)
{
- flags |= eHandleCommandFlagEchoCommand;
+ flags |= eHandleCommandFlagPrintResult;
}
}
else if (print_result == eLazyBoolYes)
{
- flags |= eHandleCommandFlagEchoCommand;
+ flags |= eHandleCommandFlagPrintResult;
+ }
+
+ if (flags & eHandleCommandFlagPrintResult)
+ {
+ m_debugger.GetOutputFile()->Printf("Executing commands in '%s'.\n", cmd_file_path.c_str());
}
// Used for inheriting the right settings when "command source" might have
// nested "command source" commands
+ lldb::StreamFileSP empty_stream_sp;
m_command_source_flags.push_back(flags);
IOHandlerSP io_handler_sp (new IOHandlerEditline (debugger,
input_file_sp,
- debugger.GetOutputFile(),
- debugger.GetErrorFile(),
+ empty_stream_sp, // Pass in an empty stream so we inherit the top input reader output stream
+ empty_stream_sp, // Pass in an empty stream so we inherit the top input reader error stream
flags,
NULL, // Pass in NULL for "editline_name" so no history is saved, or written
m_debugger.GetPrompt(),
OpenPOWER on IntegriCloud