================
@@ -106,6 +110,30 @@ ScriptedFrame::Create(ThreadSP thread_sp,
   if (maybe_sym_ctx)
     sc = *maybe_sym_ctx;
 
+  // If we have any variables from the scripted interface, pull them out and 
add
+  // them to the ScriptedFrame object.
+  std::optional<ValueObjectListSP> maybe_variables =
+      scripted_frame_interface->GetVariables();
+  lldb::VariableListSP variable_list_sp = nullptr;
+  if (maybe_variables && *maybe_variables) {
+    variable_list_sp = std::make_shared<VariableList>();
+    ValueObjectListSP value_list_sp = *maybe_variables;
+
+    for (uint32_t i = 0, e = value_list_sp->GetSize(); i < e; ++i) {
+      ValueObjectSP v = value_list_sp->GetValueObjectAtIndex(i);
+      if (!v)
+        continue;
+
+      VariableSP var = v->GetVariable();
+      // TODO: We could in theory ask the scripted frame to *produce* a
+      //       variable for this value object.
+      if (!var)
+        continue;
+
+      variable_list_sp->AddVariable(var);
+    }
+  }
+
----------------
medismailben wrote:

I believe this could be done lazily instead of doing it at the construction of 
the ScriptedFrame

https://github.com/llvm/llvm-project/pull/178575
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to