[Lldb-commits] [lldb] r132289 - /lldb/trunk/source/Core/UserSettingsController.cpp
Greg Clayton
gclayton at apple.com
Sun May 29 12:21:38 PDT 2011
Author: gclayton
Date: Sun May 29 14:21:37 2011
New Revision: 132289
URL: http://llvm.org/viewvc/llvm-project?rev=132289&view=rev
Log:
Make sure if an enumeration "settings" value has a valid default setting in
its definition, that the first enumeration doesn't always get used as the
default.
Modified:
lldb/trunk/source/Core/UserSettingsController.cpp
Modified: lldb/trunk/source/Core/UserSettingsController.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/UserSettingsController.cpp?rev=132289&r1=132288&r2=132289&view=diff
==============================================================================
--- lldb/trunk/source/Core/UserSettingsController.cpp (original)
+++ lldb/trunk/source/Core/UserSettingsController.cpp Sun May 29 14:21:37 2011
@@ -727,21 +727,23 @@
UserSettingsController::CreateDefaultInstanceSettings ()
{
Error err;
- const ConstString &default_name = InstanceSettings::GetDefaultName();
+ const ConstString &default_instance_name = InstanceSettings::GetDefaultName();
for (int i = 0; i < m_settings.instance_settings.size(); ++i)
{
SettingEntry &entry = m_settings.instance_settings[i];
ConstString var_name (entry.var_name);
- const char *value = entry.default_value;
+ const char *default_value = entry.default_value;
- if (entry.var_type == eSetVarTypeEnum)
- value = entry.enum_values[0].string_value;
+ // If there is no default value, then use the first enumeration value
+ // as the default value
+ if (default_value == NULL && entry.var_type == eSetVarTypeEnum)
+ default_value = entry.enum_values[0].string_value;
- if (value != NULL)
+ if (default_value != NULL)
m_default_settings->UpdateInstanceSettingsVariable (var_name,
NULL,
- value,
- default_name,
+ default_value,
+ default_instance_name,
entry,
eVarSetOperationAssign,
err,
More information about the lldb-commits
mailing list