1 --- libstdc++-v3/python/libstdcxx/v6/printers.py (revision 163281)
2 +++ libstdc++-v3/python/libstdcxx/v6/printers.py (revision 163282)
7 - def __init__ (self, start, finish):
10 + def __init__ (self, start, finish, bitvec):
11 + self.bitvec = bitvec
13 + self.item = start['_M_p']
14 + self.so = start['_M_offset']
15 + self.finish = finish['_M_p']
16 + self.fo = finish['_M_offset']
17 + itype = self.item.dereference().type
18 + self.isize = 8 * itype.sizeof
21 + self.finish = finish
28 - if self.item == self.finish:
31 self.count = self.count + 1
32 - elt = self.item.dereference()
33 - self.item = self.item + 1
34 - return ('[%d]' % count, elt)
36 + if self.item == self.finish and self.so >= self.fo:
38 + elt = self.item.dereference()
39 + obit = 1 if elt & (1 << self.so) else 0
40 + self.so = self.so + 1
41 + if self.so >= self.isize:
42 + self.item = self.item + 1
44 + return ('[%d]' % count, obit)
46 + if self.item == self.finish:
48 + elt = self.item.dereference()
49 + self.item = self.item + 1
50 + return ('[%d]' % count, elt)
52 def __init__(self, typename, val):
53 self.typename = typename
55 + self.is_bool = val.type.template_argument(0).code == gdb.TYPE_CODE_BOOL
58 return self._iterator(self.val['_M_impl']['_M_start'],
59 - self.val['_M_impl']['_M_finish'])
60 + self.val['_M_impl']['_M_finish'],
64 start = self.val['_M_impl']['_M_start']
65 finish = self.val['_M_impl']['_M_finish']
66 end = self.val['_M_impl']['_M_end_of_storage']
67 - return ('%s of length %d, capacity %d'
68 - % (self.typename, int (finish - start), int (end - start)))
70 + start = self.val['_M_impl']['_M_start']['_M_p']
71 + so = self.val['_M_impl']['_M_start']['_M_offset']
72 + finish = self.val['_M_impl']['_M_finish']['_M_p']
73 + fo = self.val['_M_impl']['_M_finish']['_M_offset']
74 + itype = start.dereference().type
75 + bl = 8 * itype.sizeof
76 + length = (bl - so) + bl * ((finish - start) - 1) + fo
77 + capacity = bl * (end - start)
78 + return ('%s<bool> of length %d, capacity %d'
79 + % (self.typename, int (length), int (capacity)))
81 + return ('%s of length %d, capacity %d'
82 + % (self.typename, int (finish - start), int (end - start)))
84 def display_hint(self):