diff options
| author | Jim Ingham <jingham@apple.com> | 2016-07-06 01:27:33 +0000 |
|---|---|---|
| committer | Jim Ingham <jingham@apple.com> | 2016-07-06 01:27:33 +0000 |
| commit | 8b57dcf829ddb3940d9703edc0a071c1c99f768e (patch) | |
| tree | 78c3b40488ceb7dfbaf709f69946870d699feaf2 /lldb/source/Interpreter | |
| parent | e191996a577548cb81a9e6b5ae3fe5359d795594 (diff) | |
| download | bcm5719-llvm-8b57dcf829ddb3940d9703edc0a071c1c99f768e.tar.gz bcm5719-llvm-8b57dcf829ddb3940d9703edc0a071c1c99f768e.zip | |
Allows "experimental" settings that will either route to their containing
settings or raise no error if not found.
From time to time it is useful to add some setting to work around or enable
a transitory feature. We've been reluctant to remove them later because then
we will break folks .lldbinit files. With this change you can add an "experimental"
node to the settings. If you later decide you want to keep the option, just move
it to the level that contained the "experimental" setting and it will still be
found. Or just remove it - setting it will then silently fail and won't halt
the .lldbinit file execution.
llvm-svn: 274593
Diffstat (limited to 'lldb/source/Interpreter')
| -rw-r--r-- | lldb/source/Interpreter/OptionValueProperties.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lldb/source/Interpreter/OptionValueProperties.cpp b/lldb/source/Interpreter/OptionValueProperties.cpp index a3c28f70270..7024c3601d9 100644 --- a/lldb/source/Interpreter/OptionValueProperties.cpp +++ b/lldb/source/Interpreter/OptionValueProperties.cpp @@ -164,8 +164,23 @@ OptionValueProperties::GetSubValue (const ExecutionContext *exe_ctx, switch (sub_name[0]) { case '.': - return value_sp->GetSubValue (exe_ctx, sub_name + 1, will_modify, error); - + { + lldb::OptionValueSP return_val_sp; + return_val_sp = value_sp->GetSubValue (exe_ctx, sub_name + 1, will_modify, error); + if (!return_val_sp) + { + if (Properties::IsSettingExperimental(sub_name + 1)) + { + size_t experimental_len = strlen(Properties::GetExperimentalSettingsName()); + if (*(sub_name + experimental_len + 1) == '.') + return_val_sp = value_sp->GetSubValue(exe_ctx, sub_name + experimental_len + 2, will_modify, error); + // It isn't an error if an experimental setting is not present. + if (!return_val_sp) + error.Clear(); + } + } + return return_val_sp; + } case '{': // Predicate matching for predicates like // "<setting-name>{<predicate>}" |

