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;
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;
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits