Index: lldb/packages/Python/lldbsuite/test/lldbtest.py =================================================================== --- lldb/packages/Python/lldbsuite/test/lldbtest.py +++ lldb/packages/Python/lldbsuite/test/lldbtest.py @@ -687,6 +687,9 @@ @classmethod def setUpCommands(cls): commands = [ + # First of all, clear all settings to have clean state of global properties. + "settings clear", + # Disable Spotlight lookup. The testsuite creates # different binaries with the same UUID, because they only # differ in the debug info, which is not being hashed. Index: lldb/source/Commands/CommandObjectSettings.cpp =================================================================== --- lldb/source/Commands/CommandObjectSettings.cpp +++ lldb/source/Commands/CommandObjectSettings.cpp @@ -1049,7 +1049,8 @@ CommandObjectSettingsClear(CommandInterpreter &interpreter) : CommandObjectParsed( interpreter, "settings clear", - "Clear a debugger setting array, dictionary, or string.", nullptr) { + "Clear a debugger setting array, dictionary, or string. " + "Clear all settings if no arguments were specified.", nullptr) { CommandArgumentEntry arg; CommandArgumentData var_name_arg; @@ -1082,8 +1083,13 @@ result.SetStatus(eReturnStatusSuccessFinishNoResult); const size_t argc = command.GetArgumentCount(); + if (argc == 0) { + GetDebugger().GetValueProperties()->Clear(); + return result.Succeeded(); + } + if (argc != 1) { - result.AppendError("'settings clear' takes exactly one argument"); + result.AppendError("'settings clear' takes at most one argument"); result.SetStatus(eReturnStatusFailed); return false; }