[llvm-branch-commits] [lldb] [lldb] Add synthetic variable support to Get*VariableList. (PR #181501)

Med Ismail Bennani via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Apr 16 11:35:41 PDT 2026


================
@@ -688,8 +697,22 @@ lldb::SBValueList SBFrame::GetVariables(bool arguments, bool locals,
 
 /// Returns true if the variable is in any of the requested scopes.
 static bool IsInRequestedScope(bool statics, bool arguments, bool locals,
-                               Variable &var) {
-  switch (var.GetScope()) {
+                               bool synthetic, Variable &var) {
+  auto value_type = var.GetScope();
+  // Check if the variable is synthetic first.
+  bool is_synthetic = IsSyntheticValueType(value_type);
+  if (is_synthetic) {
+    // If the variable is extended but we don't want those, then it's
+    // automatically out of scope.
+    if (!synthetic)
+      return false;
+
+    // Clear the ValueTypeExtendedMask bit so the rest of the switch works
+    // correctly.
----------------
medismailben wrote:

```suggestion
    // If the variable is synthetic but we don't want those, then it's
    // automatically out of scope.
    if (!synthetic)
      return false;

    // Clear the ValueTypeSyntheticMask bit so the rest of the switch works
    // correctly.
```

https://github.com/llvm/llvm-project/pull/181501


More information about the llvm-branch-commits mailing list