From 310351d94d7abab5d29e4171aca9dc61a97209cc Mon Sep 17 00:00:00 2001 From: cmtice Date: Thu, 14 Nov 2024 08:53:16 -0800 Subject: [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. --- lldb/source/Target/Target.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'lldb/source/Target/Target.cpp') 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(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(idx, {}); -- cgit v1.2.3