Skip to content

Commit

Permalink
Make gdb pretty printer Python3-compatible (bug 800).
Browse files Browse the repository at this point in the history
  • Loading branch information
Kolja Brix committed Apr 28, 2014
1 parent e4ba52a commit c9e9db1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions debug/gdb/printers.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(self, variety, val):
regex = re.compile('\<.*\>')
m = regex.findall(tag)[0][1:-1]
template_params = m.split(',')
template_params = map(lambda x:x.replace(" ", ""), template_params)
template_params = [x.replace(" ", "") for x in template_params]

if template_params[1] == '-0x00000000000000001' or template_params[1] == '-0x000000001' or template_params[1] == '-1':
self.rows = val['m_storage']['m_rows']
Expand Down Expand Up @@ -88,8 +88,11 @@ def __init__ (self, rows, cols, dataPtr, rowMajor):

def __iter__ (self):
return self

def next(self):
return self.__next__() # Python 2.x compatibility

def __next__(self):

row = self.currentRow
col = self.currentCol
Expand Down Expand Up @@ -151,8 +154,11 @@ def __init__ (self, dataPtr):

def __iter__ (self):
return self

def next(self):
return self.__next__() # Python 2.x compatibility

def __next__(self):
element = self.currentElement

if self.currentElement >= 4: #there are 4 elements in a quanternion
Expand Down

0 comments on commit c9e9db1

Please sign in to comment.