summaryrefslogtreecommitdiff
path: root/lldb/source/Target/Target.cpp
diff options
context:
space:
mode:
authorcmtice <cmtice@google.com>2024-11-14 08:53:16 -0800
committerGitHub <noreply@github.com>2024-11-14 08:53:16 -0800
commit310351d94d7abab5d29e4171aca9dc61a97209cc (patch)
treeced7d57a71bf8dc3bfc21461da96fd3ab1135f4b /lldb/source/Target/Target.cpp
parent8ed3b05582e504c545fbadcc384f474220e42d3f (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.cpp21
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, {});