summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/UserSettingsController.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2010-10-20 01:03:00 +0000
committerJohnny Chen <johnny.chen@apple.com>2010-10-20 01:03:00 +0000
commit73b4f71125d160e79a6c61306bbe1ec20d921bff (patch)
tree8411d2dc77fca0a665e36c44ac12206587a32f71 /lldb/source/Core/UserSettingsController.cpp
parent1f32ebe89229920e85a197bdf2c76a2c48ebfb8c (diff)
downloadbcm5719-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.cpp6
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)
OpenPOWER on IntegriCloud