diff options
author | Venkata Ramanaiah Nalamothu <ramana.venkat83@gmail.com> | 2021-11-26 15:34:57 +0530 |
---|---|---|
committer | Venkata Ramanaiah Nalamothu <ramana.venkat83@gmail.com> | 2021-11-26 15:50:36 +0530 |
commit | 94038c570fbc991c03fe68793c576314c231d4ee (patch) | |
tree | e1baf35c0a1b1768753409cacc7b99741109e4b4 /lldb/source/Interpreter/CommandObject.cpp | |
parent | d8f3cdfed03fe73c152d7fbf509f34f4b502f384 (diff) | |
download | llvm-94038c570fbc991c03fe68793c576314c231d4ee.zip llvm-94038c570fbc991c03fe68793c576314c231d4ee.tar.gz llvm-94038c570fbc991c03fe68793c576314c231d4ee.tar.bz2 |
[lldb] Fix 'memory write' to not allow specifying values when writing file contents
Currently the 'memory write' command allows specifying the values when
writing the file contents to memory but the values are actually ignored. This
patch fixes that by erroring out when values are specified in such cases.
Reviewed By: DavidSpickett
Differential Revision: https://reviews.llvm.org/D114544
Diffstat (limited to 'lldb/source/Interpreter/CommandObject.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandObject.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp index 64b23d0..dcae27f 100644 --- a/lldb/source/Interpreter/CommandObject.cpp +++ b/lldb/source/Interpreter/CommandObject.cpp @@ -454,6 +454,9 @@ void CommandObject::GetFormattedCommandArguments(Stream &str, opt_set_mask == LLDB_OPT_SET_ALL ? m_arguments[i] : OptSetFiltered(opt_set_mask, m_arguments[i]); + // This argument is not associated with the current option set, so skip it. + if (arg_entry.empty()) + continue; int num_alternatives = arg_entry.size(); if ((num_alternatives == 2) && IsPairType(arg_entry[0].arg_repetition)) { |