diff options
author | Benjamin Schindler <bschindler@inf.ethz.ch> | 2009-12-08 18:40:36 +0100 |
---|---|---|
committer | Benjamin Schindler <bschindler@inf.ethz.ch> | 2009-12-08 18:40:36 +0100 |
commit | 4da991eaa811b8e8c31253e1b00d95b0d721d8ef (patch) | |
tree | f1bb68d0b00e0f83d65c137d6ce1b4b4a6302cff | |
parent | a4c162dbdc0e59eb2dac0e6b598ac87b1341b5c4 (diff) |
Display the data ptr as part of the header
-rw-r--r-- | debug/gdb/printers.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/debug/gdb/printers.py b/debug/gdb/printers.py index 3df7535c3..0b4230498 100644 --- a/debug/gdb/printers.py +++ b/debug/gdb/printers.py @@ -68,7 +68,13 @@ class EigenMatrixPrinter: 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'] + self.data = self.data.cast(self.innerType.pointer()) + class _iterator: def __init__ (self, rows, cols, dataPtr): self.rows = rows @@ -97,15 +103,11 @@ class EigenMatrixPrinter: return ('[%d, %d]' % (row, col), item) def children(self): - data = self.val['m_storage']['m_data'] - # Fixed size matrices have a struct as their storage, so we need to walk through this - if data.type.code == gdb.TYPE_CODE_STRUCT: - data = data['array'] - data = data.cast(self.innerType.pointer()) - return self._iterator(self.rows, self.cols, data) + + return self._iterator(self.rows, self.cols, self.data) def to_string(self): - return "Eigen::Matrix<%s,%d,%d>" % (self.innerType, self.rows, self.cols) + return "Eigen::Matrix<%s,%d,%d> (data ptr: %s)" % (self.innerType, self.rows, self.cols, self.data) def build_eigen_dictionary (): pretty_printers_dict[re.compile('^Eigen::Matrix<.*>$')] = lambda val: EigenMatrixPrinter(val) |