================
@@ -300,34 +300,39 @@ void ScriptedFrame::PopulateVariableListFromInterface(
 
   // Convert what we can into a variable.
   m_variable_list_sp = std::make_shared<VariableList>();
+
   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();
-    if (!var && include_synthetic_vars) {
-      // Construct the value type as an synthetic verison of what the value 
type
-      // is. That'll allow the user to tell the scope and the 'synthetic-ness'
-      // of the variable.
-      lldb::ValueType vt = GetSyntheticValueType(v->GetValueType());
-
-      // Just make up a variable - the frame variable dumper just passes it
-      // back in to GetValueObjectForFrameVariable, so we really just need to
-      // make sure the name and type are correct. We create IDs based on
-      // value_list_sp in order to make sure they're unique.
-      var = std::make_shared<lldb_private::Variable>(
-          (lldb::user_id_t)value_list_sp->GetSize() + i,
-          v->GetName().GetCString(), v->GetName().GetCString(), nullptr, vt,
-          /*owner_scope=*/nullptr,
-          /*scope_range=*/Variable::RangeList{},
-          /*decl=*/nullptr, DWARFExpressionList{}, /*external=*/false,
-          /*artificial=*/true, /*location_is_constant_data=*/false);
-    }
+    // Ask the interface about the value type of this variable. If it doesn't
+    // specify any, use the original value type. If we encounter a variable, 
use
----------------
bzcheeseman wrote:

"if we encounter a variable, use a non-synthetic type unless it's overwritten" 

Can you clarify this, please? I'm not sure I understand where the extra 
complexity is coming from - I would expect something like
```
lldb::ValueType vt = GetSyntheticValueType(v->getValueType());
if (auto desired = GetInterface()->GetValueTypeForVariable(v))
  vt = GetSyntheticValueType(*desired);

var = std::make_shared // ...
```

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

Reply via email to