[Lldb-commits] [PATCH] D37154: lldb-mi: -var-update can hang when traversing complex types with pointers

Ted Woodward via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 30 14:03:33 PDT 2017


ted updated this revision to Diff 113310.
ted added reviewers: clayborg, abidh.
ted removed a subscriber: abidh.
ted added a comment.

Added check for reference types, as Greg suggested.

Simplified change.


https://reviews.llvm.org/D37154

Files:
  tools/lldb-mi/MICmdCmdVar.cpp


Index: tools/lldb-mi/MICmdCmdVar.cpp
===================================================================
--- tools/lldb-mi/MICmdCmdVar.cpp
+++ tools/lldb-mi/MICmdCmdVar.cpp
@@ -509,8 +509,6 @@
     return MIstatus::success;
   }
 
-  lldb::SBType valueType = vrwValue.GetType();
-
   const MIuint nChildren = vrwValue.GetNumChildren();
   for (MIuint i = 0; i < nChildren; ++i) {
     lldb::SBValue member = vrwValue.GetChildAtIndex(i);
@@ -520,9 +518,14 @@
     if (member.GetValueDidChange()) {
       vrwbChanged = true;
       return MIstatus::success;
-    } else if (ExamineSBValueForChange(member, vrwbChanged) && vrwbChanged)
-      // Handle composite types (i.e. struct or arrays)
-      return MIstatus::success;
+    }
+
+    // Handle composite types (i.e. struct or arrays)
+    // Don't go down into pointers or references, to avoid a loop
+    lldb::SBType valueType = member.GetType();
+    if (!valueType.IsPointerType() && !valueType.IsReferenceType())
+      if (ExamineSBValueForChange(member, vrwbChanged) && vrwbChanged)
+        return MIstatus::success;
   }
   vrwbChanged = false;
   return MIstatus::success;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37154.113310.patch
Type: text/x-patch
Size: 1137 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170830/7c052e63/attachment.bin>


More information about the lldb-commits mailing list