summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectMemory.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/CommandObjectMemory.cpp
parent3703ff41632ea5f5749f35fe380edc8872f34d6d (diff)
downloadbcm5719-llvm-405fe67f1424284173459575b1081f42935c50fd.tar.gz
bcm5719-llvm-405fe67f1424284173459575b1081f42935c50fd.zip
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/CommandObjectMemory.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectMemory.cpp49
1 files changed, 47 insertions, 2 deletions
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp
index 7b9e1cec95d..46e913587ef 100644
--- a/lldb/source/Commands/CommandObjectMemory.cpp
+++ b/lldb/source/Commands/CommandObjectMemory.cpp
@@ -180,9 +180,31 @@ public:
CommandObject (interpreter,
"memory read",
"Read from the memory of the process being debugged.",
- "memory read [<cmd-options>] <start-addr> [<end-addr>]",
+ NULL,
eFlagProcessMustBeLaunched)
{
+ CommandArgumentEntry arg1;
+ CommandArgumentEntry arg2;
+ CommandArgumentData start_addr_arg;
+ CommandArgumentData end_addr_arg;
+
+ // Define the first (and only) variant of this arg.
+ start_addr_arg.arg_type = eArgTypeStartAddress;
+ start_addr_arg.arg_repetition = eArgRepeatPlain;
+
+ // There is only one variant this argument could be; put it into the argument entry.
+ arg1.push_back (start_addr_arg);
+
+ // Define the first (and only) variant of this arg.
+ end_addr_arg.arg_type = eArgTypeEndAddress;
+ end_addr_arg.arg_repetition = eArgRepeatOptional;
+
+ // There is only one variant this argument could be; put it into the argument entry.
+ arg2.push_back (end_addr_arg);
+
+ // Push the data for the first argument into the m_arguments vector.
+ m_arguments.push_back (arg1);
+ m_arguments.push_back (arg2);
}
virtual
@@ -398,9 +420,32 @@ public:
CommandObject (interpreter,
"memory write",
"Write to the memory of the process being debugged.",
- "memory write [<cmd-options>] <addr> [value1 value2 ...]",
+ //"memory write [<cmd-options>] <addr> [value1 value2 ...]",
+ NULL,
eFlagProcessMustBeLaunched)
{
+ CommandArgumentEntry arg1;
+ CommandArgumentEntry arg2;
+ CommandArgumentData addr_arg;
+ CommandArgumentData value_arg;
+
+ // Define the first (and only) variant of this arg.
+ addr_arg.arg_type = eArgTypeAddress;
+ addr_arg.arg_repetition = eArgRepeatPlain;
+
+ // There is only one variant this argument could be; put it into the argument entry.
+ arg1.push_back (addr_arg);
+
+ // Define the first (and only) variant of this arg.
+ value_arg.arg_type = eArgTypeValue;
+ value_arg.arg_repetition = eArgRepeatPlus;
+
+ // 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
OpenPOWER on IntegriCloud