diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2021-12-02 21:49:08 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2022-05-14 11:43:49 +0000 |
commit | 4824e7fd18a1223177218d4aec1b3c6c5c4a444e (patch) | |
tree | 5ca6493b1b0bf6a41f257794c0116d5e50fbf37c /contrib/llvm-project/lldb/source/Commands/CommandObjectMemory.cpp | |
parent | 5e801ac66d24704442eba426ed13c3effb8a34e7 (diff) | |
parent | f65dcba83ce5035ab88a85fe17628b447eb56e1b (diff) |
Diffstat (limited to 'contrib/llvm-project/lldb/source/Commands/CommandObjectMemory.cpp')
-rw-r--r-- | contrib/llvm-project/lldb/source/Commands/CommandObjectMemory.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/contrib/llvm-project/lldb/source/Commands/CommandObjectMemory.cpp b/contrib/llvm-project/lldb/source/Commands/CommandObjectMemory.cpp index f27d4bd7e4b2..094ce6f8558f 100644 --- a/contrib/llvm-project/lldb/source/Commands/CommandObjectMemory.cpp +++ b/contrib/llvm-project/lldb/source/Commands/CommandObjectMemory.cpp @@ -1222,7 +1222,15 @@ public: interpreter, "memory write", "Write to the memory of the current target process.", nullptr, eCommandRequiresProcess | eCommandProcessMustBeLaunched), - m_option_group(), m_format_options(eFormatBytes, 1, UINT64_MAX), + m_option_group(), + m_format_options( + eFormatBytes, 1, UINT64_MAX, + {std::make_tuple( + eArgTypeFormat, + "The format to use for each of the value to be written."), + std::make_tuple( + eArgTypeByteSize, + "The size in bytes to write from input file or each value.")}), m_memory_options() { CommandArgumentEntry arg1; CommandArgumentEntry arg2; @@ -1240,6 +1248,7 @@ public: // Define the first (and only) variant of this arg. value_arg.arg_type = eArgTypeValue; value_arg.arg_repetition = eArgRepeatPlus; + value_arg.arg_opt_set_association = LLDB_OPT_SET_1; // There is only one variant this argument could be; put it into the // argument entry. @@ -1278,6 +1287,12 @@ protected: m_cmd_name.c_str()); return false; } + if (argc > 1) { + result.AppendErrorWithFormat( + "%s takes only a destination address when writing file contents.\n", + m_cmd_name.c_str()); + return false; + } } else if (argc < 2) { result.AppendErrorWithFormat( "%s takes a destination address and at least one value.\n", |