gdb/printers: fix view offsets to start from 0

This commit is contained in:
Danny Robson 2018-12-19 17:11:46 +11:00
parent 37d68d5586
commit 499fa4d190

View File

@ -53,10 +53,12 @@ class ViewPrinter(object):
raise StopIteration raise StopIteration
val = self.cursor.dereference() val = self.cursor.dereference()
res = ("[%d]" % self.index, val)
self.cursor = self.cursor + 1 self.cursor = self.cursor + 1
self.index = self.index + 1 self.index = self.index + 1
return ("[%d]" % self.index, val) return res
def children(self): def children(self):
return self._iterator( return self._iterator(