# HG changeset patch # User Sameer Sheorey # Date 1299077537 21600 # Node ID a239f018c59bd2b0445a67a97d497c7f41d44091 # Parent 7090675b5e1558742ce5f12a7fa8872e7194290b printers.py now correctly displays variable sized matrices, since the size is now -0x1 instead of 10000. diff --git a/debug/gdb/printers.py b/debug/gdb/printers.py --- a/debug/gdb/printers.py +++ b/debug/gdb/printers.py @@ -50,31 +50,33 @@ class EigenMatrixPrinter: if type.code == gdb.TYPE_CODE_REF: type = type.target() self.type = type.unqualified().strip_typedefs() tag = self.type.tag regex = re.compile('\<.*\>') m = regex.findall(tag)[0][1:-1] template_params = m.split(',') template_params = map(lambda x:x.replace(" ", ""), template_params) - - self.rows = int(template_params[1]) - self.cols = int(template_params[2]) + + if template_params[1] == '-0x00000000000000001': + self.rows = val['m_storage']['m_rows'] + else: + self.rows = int(template_params[1]) + + if template_params[1] == '-0x00000000000000001': + self.cols = val['m_storage']['m_rows'] + else: + self.cols = int(template_params[2]) + self.options = 0 # default value if len(template_params) > 3: self.options = template_params[3]; self.rowMajor = (int(self.options) & 0x1) - if self.rows == 10000: - self.rows = val['m_storage']['m_rows'] - - if self.cols == 10000: - self.cols = val['m_storage']['m_cols'] - self.innerType = self.type.template_argument(0) self.val = val # Fixed size matrices have a struct as their storage, so we need to walk through this self.data = self.val['m_storage']['m_data'] if self.data.type.code == gdb.TYPE_CODE_STRUCT: self.data = self.data['array']