-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.
Or even cleaner:
bool CMICmdCmdVarUpdate::ExamineSBValueForChange(lldb::SBValue &vrwValue, bool &vrwbChanged) { vrwbChanged = vrwValue.GetValueDidChange(); if (vrwbChanged) return MIstatus::success; // Skip children of pointers and references to avoid infinite loop if (vrwValue.GetType().GetTypeFlags() & (lldb::eTypeIsPointer | lldb::eTypeIsReference)) { return MIstatus::success; } const MIuint nChildren = vrwValue.GetNumChildren(); for (MIuint i = 0; i < nChildren && !vrwbChanged; ++i) { ExamineSBValueForChange(vrwValue.GetChildAtIndex(i), vrwbChanged); } return MIstatus::success; }