diff options
| author | cmtice <cmtice@google.com> | 2024-11-14 08:53:16 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-14 08:53:16 -0800 |
| commit | 310351d94d7abab5d29e4171aca9dc61a97209cc (patch) | |
| tree | ced7d57a71bf8dc3bfc21461da96fd3ab1135f4b /lldb/source/Target/Target.cpp | |
| parent | 8ed3b05582e504c545fbadcc384f474220e42d3f (diff) | |
[LLDB] Add framework for Data Inspection Language (DIL) work. (#115666)
Add the framework code for hooking up and calling the Data Inspection
Language (DIL) implementation, as an alternate implementation for the
'frame variable' command. For now, this is an opt-in option, via a
target setting 'target.experimental.use-DIL'. See
https://discourse.llvm.org/t/rfc-data-inspection-language/69893 for more
information about this project.
This PR does not actually call any of the DIL code; instead the piece
that will eventually call the DIL code
(StackFrame::DILEvaluateVariableExpression) calls back into the original
'frame variable' implementation.
Diffstat (limited to 'lldb/source/Target/Target.cpp')
| -rw-r--r-- | lldb/source/Target/Target.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index a788bad88b29..300dca163c41 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -4385,6 +4385,27 @@ bool TargetProperties::GetInjectLocalVariables( .value_or(true); } +bool TargetProperties::GetUseDIL(ExecutionContext *exe_ctx) const { + const Property *exp_property = + m_collection_sp->GetPropertyAtIndex(ePropertyExperimental, exe_ctx); + OptionValueProperties *exp_values = + exp_property->GetValue()->GetAsProperties(); + if (exp_values) + return exp_values->GetPropertyAtIndexAs<bool>(ePropertyUseDIL, exe_ctx) + .value_or(false); + else + return true; +} + +void TargetProperties::SetUseDIL(ExecutionContext *exe_ctx, bool b) { + const Property *exp_property = + m_collection_sp->GetPropertyAtIndex(ePropertyExperimental, exe_ctx); + OptionValueProperties *exp_values = + exp_property->GetValue()->GetAsProperties(); + if (exp_values) + exp_values->SetPropertyAtIndex(ePropertyUseDIL, true, exe_ctx); +} + ArchSpec TargetProperties::GetDefaultArchitecture() const { const uint32_t idx = ePropertyDefaultArch; return GetPropertyAtIndexAs<ArchSpec>(idx, {}); |
