Fix a bug in OptionGroupWatchpoint.cpp where the '-w' option arg parsing result was not checked
to effect an early error return.
Plus add logic to 'frame variable' command object to check that when watchpoint option is on,
only one variable with exact name (no regex) is specified as the sole command arg.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139524 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Interpreter/OptionGroupWatchpoint.cpp b/source/Interpreter/OptionGroupWatchpoint.cpp
index 3616ccb..4f9f2c1 100644
--- a/source/Interpreter/OptionGroupWatchpoint.cpp
+++ b/source/Interpreter/OptionGroupWatchpoint.cpp
@@ -55,9 +55,10 @@
switch (short_option)
{
case 'w': {
- watch_variable = false;
OptionEnumValueElement *enum_values = g_option_table[option_idx].enum_values;
watch_mode = (WatchMode) Args::StringToOptionEnum(option_arg, enum_values, 0, &watch_variable);
+ if (!watch_variable)
+ error.SetErrorStringWithFormat("Invalid option arg for '-w': '%s'.\n", option_arg);
break;
}
default: