aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectRegister.cpp
diff options
context:
space:
mode:
authorCaroline Tice <ctice@apple.com>2010-10-04 22:28:36 +0000
committerCaroline Tice <ctice@apple.com>2010-10-04 22:28:36 +0000
commit405fe67f1424284173459575b1081f42935c50fd (patch)
tree5110616e8a6ebcd9138f08209dbacf041b50a37a /lldb/source/Commands/CommandObjectRegister.cpp
parent3703ff41632ea5f5749f35fe380edc8872f34d6d (diff)
downloadllvm-405fe67f1424284173459575b1081f42935c50fd.zip
llvm-405fe67f1424284173459575b1081f42935c50fd.tar.gz
llvm-405fe67f1424284173459575b1081f42935c50fd.tar.bz2
Modify existing commands with arguments to use the new argument mechanism
(for standardized argument names, argument help, etc.) llvm-svn: 115570
Diffstat (limited to 'lldb/source/Commands/CommandObjectRegister.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectRegister.cpp42
1 files changed, 39 insertions, 3 deletions
diff --git a/lldb/source/Commands/CommandObjectRegister.cpp b/lldb/source/Commands/CommandObjectRegister.cpp
index 6182509..4bcf681f 100644
--- a/lldb/source/Commands/CommandObjectRegister.cpp
+++ b/lldb/source/Commands/CommandObjectRegister.cpp
@@ -34,10 +34,23 @@ public:
CommandObjectRegisterRead (CommandInterpreter &interpreter) :
CommandObject (interpreter,
"register read",
- "Dump the contents of one or more register values from the current frame.",
- "register read [<reg-name1> [<reg-name2> [...]]]",
+ "Dump the contents of one or more register values from the current frame. If no register is specified, dumps them all.",
+ //"register read [<reg-name1> [<reg-name2> [...]]]",
+ NULL,
eFlagProcessMustBeLaunched | eFlagProcessMustBePaused)
{
+ CommandArgumentEntry arg;
+ CommandArgumentData register_arg;
+
+ // Define the first (and only) variant of this arg.
+ register_arg.arg_type = eArgTypeRegisterName;
+ register_arg.arg_repetition = eArgRepeatStar;
+
+ // There is only one variant this argument could be; put it into the argument entry.
+ arg.push_back (register_arg);
+
+ // Push the data for the first argument into the m_arguments vector.
+ m_arguments.push_back (arg);
}
virtual
@@ -143,9 +156,32 @@ public:
CommandObject (interpreter,
"register write",
"Modify a single register value.",
- "register write <reg-name> <value>",
+ //"register write <reg-name> <value>",
+ NULL,
eFlagProcessMustBeLaunched | eFlagProcessMustBePaused)
{
+ CommandArgumentEntry arg1;
+ CommandArgumentEntry arg2;
+ CommandArgumentData register_arg;
+ CommandArgumentData value_arg;
+
+ // Define the first (and only) variant of this arg.
+ register_arg.arg_type = eArgTypeRegisterName;
+ register_arg.arg_repetition = eArgRepeatPlain;
+
+ // There is only one variant this argument could be; put it into the argument entry.
+ arg1.push_back (register_arg);
+
+ // Define the first (and only) variant of this arg.
+ value_arg.arg_type = eArgTypeValue;
+ value_arg.arg_repetition = eArgRepeatPlain;
+
+ // There is only one variant this argument could be; put it into the argument entry.
+ arg2.push_back (value_arg);
+
+ // Push the data for the first argument into the m_arguments vector.
+ m_arguments.push_back (arg1);
+ m_arguments.push_back (arg2);
}
virtual