diff options
author | Greg Clayton <gclayton@apple.com> | 2011-02-20 02:15:07 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-02-20 02:15:07 +0000 |
commit | 9d0402b1eb50024df06cc521102e86278d43c8c2 (patch) | |
tree | 4868f76d296f67b507cd1a0bc5d9b91e81d87cb9 /lldb/source/Interpreter/CommandObject.cpp | |
parent | 6d90e8937cf561e67d7a56967cb379bf55748e5f (diff) | |
download | bcm5719-llvm-9d0402b1eb50024df06cc521102e86278d43c8c2.tar.gz bcm5719-llvm-9d0402b1eb50024df06cc521102e86278d43c8c2.zip |
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().
llvm-svn: 126067
Diffstat (limited to 'lldb/source/Interpreter/CommandObject.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandObject.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp index 2f88a4893c0..b0446d05a45 100644 --- a/lldb/source/Interpreter/CommandObject.cpp +++ b/lldb/source/Interpreter/CommandObject.cpp @@ -600,6 +600,23 @@ BreakpointIDRangeHelpTextCallback () return "A 'breakpoint id list' is a manner of specifying multiple breakpoints. This can be done through several mechanisms. The easiest way is to just enter a space-separated list of breakpoint ids. To specify all the breakpoint locations under a major breakpoint, you can use the major breakpoint number followed by '.*', eg. '5.*' means all the locations under breakpoint 5. You can also indicate a range of breakpoints by using <start-bp-id> - <end-bp-id>. The start-bp-id and end-bp-id for a range can be any valid breakpoint ids. It is not legal, however, to specify a range using specific locations that cross major breakpoint numbers. I.e. 3.2 - 3.7 is legal; 2 - 5 is legal; but 3.2 - 4.4 is not legal."; } +const char * +CommandObject::GetArgumentTypeAsCString (const lldb::CommandArgumentType arg_type) +{ + if (arg_type >=0 && arg_type < eArgTypeLastArg) + return g_arguments_data[arg_type].arg_name; + return NULL; + +} + +const char * +CommandObject::GetArgumentDescriptionAsCString (const lldb::CommandArgumentType arg_type) +{ + if (arg_type >=0 && arg_type < eArgTypeLastArg) + return g_arguments_data[arg_type].help_text; + return NULL; +} + CommandObject::ArgumentTableEntry CommandObject::g_arguments_data[] = { @@ -667,6 +684,8 @@ CommandObject::g_arguments_data[] = const CommandObject::ArgumentTableEntry* CommandObject::GetArgumentTable () { + // If this assertion fires, then the table above is out of date with the CommandArgumentType enumeration + assert ((sizeof (CommandObject::g_arguments_data) / sizeof (CommandObject::ArgumentTableEntry)) == eArgTypeLastArg); return CommandObject::g_arguments_data; } |