Index: lldb/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py =================================================================== --- lldb/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py +++ lldb/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py @@ -169,6 +169,13 @@ self.assertTrue(int(lldb.value(frame0.FindVariable('sinthex'))) == -526164208, 'sinthex == -526164208') + # Check value_iter works correctly. + for v in [ + lldb.value(frame0.FindVariable('uinthex')), + lldb.value(frame0.FindVariable('sinthex')) + ]: + self.assertTrue(v) + self.assertTrue( frame0.FindVariable('uinthex').GetValueAsUnsigned() == 3768803088, 'unsigned uinthex == 3768803088') Index: lldb/scripts/Python/python-extensions.swig =================================================================== --- lldb/scripts/Python/python-extensions.swig +++ lldb/scripts/Python/python-extensions.swig @@ -946,13 +946,16 @@ def __iter__(self): return self - def next(self): + def __next__(self): if self.index >= self.length: raise StopIteration() child_sbvalue = self.sbvalue.GetChildAtIndex(self.index) self.index += 1 return value(child_sbvalue) + def next(self): + return self.__next__() + def __init__(self,value): self.index = 0 self.sbvalue = value