diff options
author | Johnny Chen <johnny.chen@apple.com> | 2010-10-20 01:03:00 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2010-10-20 01:03:00 +0000 |
commit | 73b4f71125d160e79a6c61306bbe1ec20d921bff (patch) | |
tree | 8411d2dc77fca0a665e36c44ac12206587a32f71 /lldb/source/Core/UserSettingsController.cpp | |
parent | 1f32ebe89229920e85a197bdf2c76a2c48ebfb8c (diff) | |
download | bcm5719-llvm-73b4f71125d160e79a6c61306bbe1ec20d921bff.tar.gz bcm5719-llvm-73b4f71125d160e79a6c61306bbe1ec20d921bff.zip |
For UserSettingsController::UpdateDictionaryVariable(), clear the dictionary
if passed in a NULL new_value and the operation intended is eVarSetOperationAssign.
This fixed a bug where in TestSettings.py:
# Set the run-args and the env-vars.
self.runCmd('settings set target.process.run-args A B C')
self.runCmd('settings set target.process.env-vars ["MY_ENV_VAR"]=YES')
# And add hooks to restore the settings during tearDown().
self.addTearDownHook(
lambda: self.runCmd("settings set -r target.process.run-args"))
self.addTearDownHook(
lambda: self.runCmd("settings set -r target.process.env-vars"))
"settings set -r target.process.env-vars" was not restoring the original env-vars
setting.
llvm-svn: 116895
Diffstat (limited to 'lldb/source/Core/UserSettingsController.cpp')
-rw-r--r-- | lldb/source/Core/UserSettingsController.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lldb/source/Core/UserSettingsController.cpp b/lldb/source/Core/UserSettingsController.cpp index 6df92490dc5..4d807c36868 100644 --- a/lldb/source/Core/UserSettingsController.cpp +++ b/lldb/source/Core/UserSettingsController.cpp @@ -2079,6 +2079,12 @@ UserSettingsController::UpdateDictionaryVariable (lldb::VarSetOperationType op, case lldb::eVarSetOperationAppend: case lldb::eVarSetOperationAssign: { + // Clear the dictionary if it's an assign with new_value as NULL. + if (new_value == NULL && op == lldb::eVarSetOperationAssign) + { + dictionary.clear (); + break; + } Args args (new_value); size_t num_args = args.GetArgumentCount(); for (size_t i = 0; i < num_args; ++i) |