#NEWLINE# def get_context( self ) : #NEWLINE# #INDENT# 'Get context from the SMT solver.\n        ' #NEWLINE# registers = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( reg_name , gen_reg ) in self . _context . registers . items ( ) : #NEWLINE# #INDENT# value = self . _solver . getvaluebyname ( self . _translator . get_curr_name ( reg_name ) ) #NEWLINE# registers [ _ ] = GenericRegister ( reg_name , gen_reg . size , value ) #NEWLINE# #UNINDENT# flags = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( flag_name , _ ) in self . _context . flags . items ( ) : #NEWLINE# #INDENT# value = self . _solver . getvaluebyname ( self . _translator . get_curr_name ( flag_name ) ) #NEWLINE# flags [ flag_name ] = GenericFlag ( flag_name , value ) #NEWLINE# #UNINDENT# memory = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# mem = self . _translator . get_memory ( ) #NEWLINE# for ( addr , _ ) in self . _context . memory . items ( ) : #NEWLINE# #INDENT# value = self . _solver . getvalue ( mem [ addr ] ) #NEWLINE# memory [ addr ] = value #NEWLINE# #UNINDENT# return GenericContext ( registers , flags , memory )