From 94038c570fbc991c03fe68793c576314c231d4ee Mon Sep 17 00:00:00 2001 From: Venkata Ramanaiah Nalamothu Date: Fri, 26 Nov 2021 15:34:57 +0530 Subject: [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 --- lldb/source/Interpreter/CommandObject.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lldb/source/Interpreter/CommandObject.cpp') 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)) { -- cgit v1.1