summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/UserSettingsController.cpp
diff options
context:
space:
mode:
authorCaroline Tice <ctice@apple.com>2010-09-27 00:30:10 +0000
committerCaroline Tice <ctice@apple.com>2010-09-27 00:30:10 +0000
commit1559a46b3eae1f941a67937abfafaf7d12f5ec1c (patch)
treed1de2061dc9a9fd0dfb0ffd0f8c73a1baa036a02 /lldb/source/Core/UserSettingsController.cpp
parentc8a4973389b8d6b75c06c02112873e823a82a27b (diff)
downloadbcm5719-llvm-1559a46b3eae1f941a67937abfafaf7d12f5ec1c.tar.gz
bcm5719-llvm-1559a46b3eae1f941a67937abfafaf7d12f5ec1c.zip
Create more useful instance names for target, process and thread instances.
Change default 'set' behavior so that all instance settings for the specified variable will be updated, unless the "-n" ("--no_override") command options is specified. llvm-svn: 114808
Diffstat (limited to 'lldb/source/Core/UserSettingsController.cpp')
-rw-r--r--lldb/source/Core/UserSettingsController.cpp32
1 files changed, 19 insertions, 13 deletions
diff --git a/lldb/source/Core/UserSettingsController.cpp b/lldb/source/Core/UserSettingsController.cpp
index a42dab00db8..6df92490dc5 100644
--- a/lldb/source/Core/UserSettingsController.cpp
+++ b/lldb/source/Core/UserSettingsController.cpp
@@ -347,14 +347,14 @@ UserSettingsController::SetVariable (const char *full_dot_name,
OverrideAllInstances (const_var_name, value, op, index_value, err);
// Update all pending records as well.
- std::map<std::string, lldb::InstanceSettingsSP>::iterator pos, end = m_pending_settings.end();
- for (pos = m_pending_settings.begin(); pos != end; end++)
- {
- const ConstString instance_name (pos->first.c_str());
- lldb::InstanceSettingsSP setting_sp = pos->second;
- setting_sp->UpdateInstanceSettingsVariable (const_var_name, index_value, value,
- instance_name, *entry, op, err, true);
- }
+// std::map<std::string, lldb::InstanceSettingsSP>::iterator pos, end = m_pending_settings.end();
+// for (pos = m_pending_settings.begin(); pos != end; end++)
+// {
+// const ConstString instance_name (pos->first.c_str());
+// lldb::InstanceSettingsSP setting_sp = pos->second;
+// setting_sp->UpdateInstanceSettingsVariable (const_var_name, index_value, value,
+// instance_name, *entry, op, err, true);
+// }
}
}
}
@@ -2164,18 +2164,24 @@ UserSettingsController::RenameInstanceSettings (const char *old_name, const char
// list, then this is not a setting that can be renamed.
if ((old_name_key[0] != '[') || (old_name_key[old_name_key.size() -1] != ']'))
- {
+ {
StreamString tmp_str;
tmp_str.Printf ("[%s]", old_name);
old_name_key = tmp_str.GetData();
- }
+ }
if ((new_name_key[0] != '[') || (new_name_key[new_name_key.size() -1] != ']'))
- {
+ {
StreamString tmp_str;
tmp_str.Printf ("[%s]", new_name);
new_name_key = tmp_str.GetData();
- }
+ }
+
+ if (old_name_key.compare (new_name_key) == 0)
+ return;
+
+ size_t len = new_name_key.length();
+ std::string stripped_new_name = new_name_key.substr (1, len-2); // new name without the '[ ]'
std::map<std::string, InstanceSettings *>::iterator pos;
@@ -2185,7 +2191,7 @@ UserSettingsController::RenameInstanceSettings (const char *old_name, const char
InstanceSettings *live_settings = pos->second;
// Rename the settings.
- live_settings->ChangeInstanceName (new_name_key);
+ live_settings->ChangeInstanceName (stripped_new_name);
// Now see if there are any pending settings for the new name; if so, copy them into live_settings.
std::map<std::string, lldb::InstanceSettingsSP>::iterator pending_pos;
OpenPOWER on IntegriCloud