ted created this revision.

-var-update calls CMICmdCmdVarUpdate::ExamineSBValueForChange to check if a 
varObj has been updated. It checks that the varObj is updated, then recurses on 
all of its children. If a child is a pointer pointing back to a parent node, 
this will result in an infinite loop, and lldb-mi hanging.

The problem is exposed by 
packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py, but this 
test is skipped everywhere.

This patch changes ExamineSBValueForChange to not traverse children of varObjs 
that are pointers.


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
@@ -516,6 +516,13 @@
     lldb::SBValue member = vrwValue.GetChildAtIndex(i);
     if (!member.IsValid())
       continue;
+    if (member.TypeIsPointerType()) {
+      if (member.GetValueDidChange()) {
+        vrwbChanged = true;
+        return MIstatus::success;
+      }
+      continue;
+    }
 
     if (member.GetValueDidChange()) {
       vrwbChanged = true;


Index: tools/lldb-mi/MICmdCmdVar.cpp
===================================================================
--- tools/lldb-mi/MICmdCmdVar.cpp
+++ tools/lldb-mi/MICmdCmdVar.cpp
@@ -516,6 +516,13 @@
     lldb::SBValue member = vrwValue.GetChildAtIndex(i);
     if (!member.IsValid())
       continue;
+    if (member.TypeIsPointerType()) {
+      if (member.GetValueDidChange()) {
+        vrwbChanged = true;
+        return MIstatus::success;
+      }
+      continue;
+    }
 
     if (member.GetValueDidChange()) {
       vrwbChanged = true;
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to