Index: source/Commands/CommandObjectSettings.cpp =================================================================== --- source/Commands/CommandObjectSettings.cpp +++ source/Commands/CommandObjectSettings.cpp @@ -38,7 +38,9 @@ public: CommandObjectSettingsSet(CommandInterpreter &interpreter) : CommandObjectRaw(interpreter, "settings set", - "Set the value of the specified debugger setting."), + "Set the value of the specified debugger setting. " + "Providing no value is equivalent to \"settings " + "clear\"."), m_options() { CommandArgumentEntry arg1; CommandArgumentEntry arg2; @@ -185,7 +187,7 @@ return false; const size_t argc = cmd_args.GetArgumentCount(); - if ((argc < 2) && (!m_options.m_global)) { + if ((argc < 1) && (!m_options.m_global)) { result.AppendError("'settings set' takes more arguments"); result.SetStatus(eReturnStatusFailed); return false; @@ -199,6 +201,18 @@ return false; } + // A missing value corresponds to clearing the setting. + if (argc == 1) { + Status error(m_interpreter.GetDebugger().SetPropertyValue( + &m_exe_ctx, eVarSetOperationClear, var_name, llvm::StringRef())); + if (error.Fail()) { + result.AppendError(error.AsCString()); + result.SetStatus(eReturnStatusFailed); + return false; + } + return result.Succeeded(); + } + // Split the raw command into var_name and value pair. llvm::StringRef raw_str(command); std::string var_value_string = raw_str.split(var_name).second.str();