parameters: (self, variety, val)
docstring: Extract all the necessary information
docstring_summary: Extract all the necessary information
docstring_tokens: Extract all the necessary information
function: def __init__(self, variety, val):
  		"Extract all the necessary information"
  		
  		# Save the variety (presumably "Matrix" or "Array") for later usage
  		self.variety = variety
  		
  		# The gdb extension does not support value template arguments - need to extract them by hand
  		type = val.type
  		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)
  		
  		if template_params[1] == '-0x00000000000000001' or template_params[1] == '-0x000000001' or template_params[1] == '-1':
  			self.rows = val['m_storage']['m_rows']
  		else:
  			self.rows = int(template_params[1])
  		
  		if template_params[2] == '-0x00000000000000001' or template_params[2] == '-0x000000001' or template_params[2] == '-1':
  			self.cols = val['m_storage']['m_cols']
  		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)
  		
  		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())
function_tokens: def __init__ ( self , variety , val ) : # Save the variety (presumably "Matrix" or "Array") for later usage self . variety = variety # The gdb extension does not support value template arguments - need to extract them by hand type = val . type 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 ) if template_params [ 1 ] == '-0x00000000000000001' or template_params [ 1 ] == '-0x000000001' or template_params [ 1 ] == '-1' : self . rows = val [ 'm_storage' ] [ 'm_rows' ] else : self . rows = int ( template_params [ 1 ] ) if template_params [ 2 ] == '-0x00000000000000001' or template_params [ 2 ] == '-0x000000001' or template_params [ 2 ] == '-1' : self . cols = val [ 'm_storage' ] [ 'm_cols' ] 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 ) 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 ( ) )