summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2012-12-13 20:20:11 +0000
committerEnrico Granata <egranata@apple.com>2012-12-13 20:20:11 +0000
commitaa0c8fffc73b993628b7e0f6fcd14758c719694a (patch)
treec60bfec85ac8d3a159e56276ee87ab19c9944f0d /lldb
parentf77e57055709a6442bfcee848da848de516095b4 (diff)
downloadbcm5719-llvm-aa0c8fffc73b993628b7e0f6fcd14758c719694a.tar.gz
bcm5719-llvm-aa0c8fffc73b993628b7e0f6fcd14758c719694a.zip
<rdar://problem/12700464>
Fixing an issue where errors in command files sourced as arguments to command-line lldb (e.g. ./lldb -s foo.cmd) would not be shown to the user llvm-svn: 170146
Diffstat (limited to 'lldb')
-rw-r--r--lldb/tools/driver/Driver.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp
index 38f2a34d5e5..3c62a65ff8e 100644
--- a/lldb/tools/driver/Driver.cpp
+++ b/lldb/tools/driver/Driver.cpp
@@ -1334,6 +1334,7 @@ Driver::MainLoop ()
// Now we handle options we got from the command line
char command_string[PATH_MAX * 2];
const size_t num_source_command_files = GetNumSourceCommandFiles();
+ const bool dump_stream_only_if_no_immediate = true;
if (num_source_command_files > 0)
{
for (size_t i=0; i < num_source_command_files; ++i)
@@ -1346,6 +1347,18 @@ Driver::MainLoop ()
result.PutError (m_debugger.GetErrorFileHandle());
result.PutOutput (m_debugger.GetOutputFileHandle());
}
+
+ // if the command sourcing generated an error - dump the result object
+ const size_t error_size = result.GetErrorSize();
+ if (error_size > 0)
+ {
+ const size_t output_size = result.GetOutputSize();
+ if (output_size > 0)
+ m_io_channel_ap->OutWrite (result.GetOutput(dump_stream_only_if_no_immediate), output_size, NO_ASYNC);
+ m_io_channel_ap->OutWrite (result.GetError(dump_stream_only_if_no_immediate), error_size, NO_ASYNC);
+ }
+
+ result.Clear();
}
}
OpenPOWER on IntegriCloud