@memoized
def format_reference_chain(chain):
 v = t = vn = None
 text = ''
 if (not chain):
  text += 'Cannot access memory address'
 else:
  first = True
  for (v, t, vn) in chain:
   if (t != 'value'):
    text += ('%s%s ' % (('--> ' if (not first) else ''), format_address(v, t)))
   else:
    text += ('%s%s ' % (('--> ' if (not first) else ''), v))
   first = False
  if vn:
   text += ('(%s)' % vn)
  elif (v != '0x0'):
   s = hex2str(v)
   if is_printable(s, '\x00'):
    text += ('(%s)' % string_repr(s.split('\x00')[0]))
 return text

@ memoized def format_reference_chain ( chain ) : v = t = vn = None text = '' if ( not chain ) : text += 'Cannot access memory address' else : first = True for ( v , t , vn ) in chain : if ( t != 'value' ) : text += ( '%s%s ' % ( ( '--> ' if ( not first ) else '' ) , format_address ( v , t ) ) ) else : text += ( '%s%s ' % ( ( '--> ' if ( not first ) else '' ) , v ) ) first = False if vn : text += ( '(%s)' % vn ) elif ( v != '0x0' ) : s = hex2str ( v ) if is_printable ( s , '\x00' ) : text += ( '(%s)' % string_repr ( s . split ( '\x00' ) [ 0 ] ) ) return text
colorize a chain of references .