Don't limit StreamTee to just two streams. It now can contain
N streams by making the stream a vector of stream shared pointers
that is protected by a mutex. Streams can be get/set by index which
allows indexes to be defined as stream indentifiers. If a stream is
set at index 3 and there are now streams in the collection, then
empty stream objects are inserted to ensure that stream at index 3
has a valid stream. There is also an append method that allows a stream
to be pushed onto the stack. This will allow our streams to be very
flexible in where the output goes.
Modified the CommandReturnObject to use the new StreamTee functionality.
This class now defines two StreamTee indexes: 0 for the stream string
stream, and 1 for the immediate stream. This is used both on the output
and error streams.
Added the ability to get argument types as strings or as descriptions.
This is exported through the SBCommandInterpreter API to allow external
access.
Modified the Driver class to use the newly exported argument names from
SBCommandInterpreter::GetArgumentTypeAsCString().
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@126067 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Interpreter/CommandInterpreter.cpp b/source/Interpreter/CommandInterpreter.cpp
index a690670..fbe47d2 100644
--- a/source/Interpreter/CommandInterpreter.cpp
+++ b/source/Interpreter/CommandInterpreter.cpp
@@ -92,27 +92,27 @@
LoadCommandDictionary ();
// Set up some initial aliases.
- result.Clear(); HandleCommand ("command alias q quit", false, result);
- result.Clear(); HandleCommand ("command alias run process launch --", false, result);
- result.Clear(); HandleCommand ("command alias r process launch --", false, result);
- result.Clear(); HandleCommand ("command alias c process continue", false, result);
- result.Clear(); HandleCommand ("command alias continue process continue", false, result);
- result.Clear(); HandleCommand ("command alias expr expression", false, result);
- result.Clear(); HandleCommand ("command alias exit quit", false, result);
- result.Clear(); HandleCommand ("command alias b regexp-break", false, result);
- result.Clear(); HandleCommand ("command alias bt thread backtrace", false, result);
- result.Clear(); HandleCommand ("command alias si thread step-inst", false, result);
- result.Clear(); HandleCommand ("command alias step thread step-in", false, result);
- result.Clear(); HandleCommand ("command alias s thread step-in", false, result);
- result.Clear(); HandleCommand ("command alias next thread step-over", false, result);
- result.Clear(); HandleCommand ("command alias n thread step-over", false, result);
- result.Clear(); HandleCommand ("command alias finish thread step-out", false, result);
- result.Clear(); HandleCommand ("command alias x memory read", false, result);
- result.Clear(); HandleCommand ("command alias l source list", false, result);
- result.Clear(); HandleCommand ("command alias list source list", false, result);
- result.Clear(); HandleCommand ("command alias p frame variable", false, result);
- result.Clear(); HandleCommand ("command alias print frame variable", false, result);
- result.Clear(); HandleCommand ("command alias po expression -o --", false, result);
+ HandleCommand ("command alias q quit", false, result);
+ HandleCommand ("command alias run process launch --", false, result);
+ HandleCommand ("command alias r process launch --", false, result);
+ HandleCommand ("command alias c process continue", false, result);
+ HandleCommand ("command alias continue process continue", false, result);
+ HandleCommand ("command alias expr expression", false, result);
+ HandleCommand ("command alias exit quit", false, result);
+ HandleCommand ("command alias b regexp-break", false, result);
+ HandleCommand ("command alias bt thread backtrace", false, result);
+ HandleCommand ("command alias si thread step-inst", false, result);
+ HandleCommand ("command alias step thread step-in", false, result);
+ HandleCommand ("command alias s thread step-in", false, result);
+ HandleCommand ("command alias next thread step-over", false, result);
+ HandleCommand ("command alias n thread step-over", false, result);
+ HandleCommand ("command alias finish thread step-out", false, result);
+ HandleCommand ("command alias x memory read", false, result);
+ HandleCommand ("command alias l source list", false, result);
+ HandleCommand ("command alias list source list", false, result);
+ HandleCommand ("command alias p frame variable", false, result);
+ HandleCommand ("command alias print frame variable", false, result);
+ HandleCommand ("command alias po expression -o --", false, result);
}
const char *
@@ -1517,9 +1517,6 @@
CommandReturnObject &result)
{
size_t num_lines = commands.GetSize();
- CommandReturnObject tmp_result;
- tmp_result.SetImmediateOutputStream (result.GetImmediateOutputStream ());
- tmp_result.SetImmediateErrorStream (result.GetImmediateErrorStream ());
// If we are going to continue past a "continue" then we need to run the commands synchronously.
// Make sure you reset this value anywhere you return from the function.
@@ -1543,7 +1540,6 @@
if (cmd[0] == '\0')
continue;
- tmp_result.Clear();
if (echo_commands)
{
result.AppendMessageWithFormat ("%s %s\n",
@@ -1551,6 +1547,9 @@
cmd);
}
+ CommandReturnObject tmp_result;
+ tmp_result.SetImmediateOutputStream (result.GetImmediateOutputStream ());
+ tmp_result.SetImmediateErrorStream (result.GetImmediateErrorStream ());
bool success = HandleCommand(cmd, false, tmp_result, NULL);
if (print_results)