summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandObject.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-09-21 01:00:02 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-09-21 01:00:02 +0000
commit184d7a727e247b899fdc210e83792e94edd9c16a (patch)
treedd42776917664b08d35d2169901801b7ef62738a /lldb/source/Interpreter/CommandObject.cpp
parentf16d2447e1685d97d1ce97136408c86d5259fecb (diff)
downloadbcm5719-llvm-184d7a727e247b899fdc210e83792e94edd9c16a.tar.gz
bcm5719-llvm-184d7a727e247b899fdc210e83792e94edd9c16a.zip
A little refactoring of the way to add break IDs or ID ranges as command argument data
to the command argument entry. Add a static helper function: CommandObject::AddIDsArgumentData(CommandArgumentEntry &arg) to be used from CommandObjectBreakpoint.cpp. The helper function could also be useful for commands in the future to manipulate watchpoints. llvm-svn: 140221
Diffstat (limited to 'lldb/source/Interpreter/CommandObject.cpp')
-rw-r--r--lldb/source/Interpreter/CommandObject.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp
index ebfbb0fe078..0bf42799015 100644
--- a/lldb/source/Interpreter/CommandObject.cpp
+++ b/lldb/source/Interpreter/CommandObject.cpp
@@ -743,6 +743,26 @@ ExprPathHelpTextCallback()
" meaning of array slicing (taking elements n thru m inside the array or pointed-to memory).";
}
+void
+CommandObject::AddIDsArgumentData(CommandArgumentEntry &arg)
+{
+ CommandArgumentData id_arg;
+ CommandArgumentData id_range_arg;
+
+ // Create the first variant for the first (and only) argument for this command.
+ id_arg.arg_type = eArgTypeBreakpointID;
+ id_arg.arg_repetition = eArgRepeatOptional;
+
+ // Create the second variant for the first (and only) argument for this command.
+ id_range_arg.arg_type = eArgTypeBreakpointIDRange;
+ id_range_arg.arg_repetition = eArgRepeatOptional;
+
+ // The first (and only) argument for this command could be either a id or a id_range.
+ // Push both variants into the entry for the first argument for this command.
+ arg.push_back(id_arg);
+ arg.push_back(id_range_arg);
+}
+
const char *
CommandObject::GetArgumentTypeAsCString (const lldb::CommandArgumentType arg_type)
{
OpenPOWER on IntegriCloud