[docs]defdata_ref_type_str(dref_enum):""" Translate an ``enum DataRefTypes`` value into a string representation. """ifdref_enum==0x9000:return"unknown"elifdref_enum==0x9001:return"integer"elifdref_enum==0x9002:return"fp"elifdref_enum==0x9003:return"integer(store)"else:return"INVALID"
[docs]classDataRef:""" A data reference object. Indicates a data access in an IRSB. :ivar data_addr: The address of the data being accessed :ivar data_size: The size of the data being accessed, in bytes :ivar data_type: The type of the data, a DataRefTypes enum. :ivar stmt_idx: The IRSB statement index containing the data access :ivar ins_addr: The address of the instruction performing the data access """__slots__=("data_addr","data_size","data_type","stmt_idx","ins_addr")
@propertydefdata_type_str(self):""" The data ref type as a string, "unknown" "integer" "fp" or "INVALID" """returndata_ref_type_str(self.data_type)def__repr__(self):return"<DataRef accessing %#x%s:%d at %#x:%d>"%(self.data_addr,data_ref_type_str(self.data_type),self.data_size,self.ins_addr,self.stmt_idx,)