|
43 | 43 | #include "lldb/Symbol/ObjectFile.h"
|
44 | 44 | #include "lldb/Symbol/Symbol.h"
|
45 | 45 | #include "lldb/Target/ABI.h"
|
| 46 | +#include "lldb/Target/ExecutionContext.h" |
46 | 47 | #include "lldb/Target/Language.h"
|
47 | 48 | #include "lldb/Target/LanguageRuntime.h"
|
48 | 49 | #include "lldb/Target/Process.h"
|
@@ -4227,28 +4228,21 @@ void TargetProperties::UpdateLaunchInfoFromProperties() {
|
4227 | 4228 | DisableSTDIOValueChangedCallback();
|
4228 | 4229 | }
|
4229 | 4230 |
|
4230 |
| -bool TargetProperties::GetInjectLocalVariables( |
4231 |
| - ExecutionContext *exe_ctx) const { |
| 4231 | +std::optional<bool> TargetProperties::GetExperimentalPropertyValue( |
| 4232 | + size_t prop_idx, ExecutionContext *exe_ctx) const { |
4232 | 4233 | const Property *exp_property =
|
4233 | 4234 | m_collection_sp->GetPropertyAtIndex(ePropertyExperimental, exe_ctx);
|
4234 | 4235 | OptionValueProperties *exp_values =
|
4235 | 4236 | exp_property->GetValue()->GetAsProperties();
|
4236 | 4237 | if (exp_values)
|
4237 |
| - return exp_values |
4238 |
| - ->GetPropertyAtIndexAs<bool>(ePropertyInjectLocalVars, exe_ctx) |
4239 |
| - .value_or(true); |
4240 |
| - else |
4241 |
| - return true; |
| 4238 | + return exp_values->GetPropertyAtIndexAs<bool>(prop_idx, exe_ctx); |
| 4239 | + return std::nullopt; |
4242 | 4240 | }
|
4243 | 4241 |
|
4244 |
| -void TargetProperties::SetInjectLocalVariables(ExecutionContext *exe_ctx, |
4245 |
| - bool b) { |
4246 |
| - const Property *exp_property = |
4247 |
| - m_collection_sp->GetPropertyAtIndex(ePropertyExperimental, exe_ctx); |
4248 |
| - OptionValueProperties *exp_values = |
4249 |
| - exp_property->GetValue()->GetAsProperties(); |
4250 |
| - if (exp_values) |
4251 |
| - exp_values->SetPropertyAtIndex(ePropertyInjectLocalVars, true, exe_ctx); |
| 4242 | +bool TargetProperties::GetInjectLocalVariables( |
| 4243 | + ExecutionContext *exe_ctx) const { |
| 4244 | + return GetExperimentalPropertyValue(ePropertyInjectLocalVars, exe_ctx) |
| 4245 | + .value_or(true); |
4252 | 4246 | }
|
4253 | 4247 |
|
4254 | 4248 | ArchSpec TargetProperties::GetDefaultArchitecture() const {
|
|
0 commit comments