(self, token)
Execute traces and watches on a program step.
Execute traces and watches on a program step.
Execute traces and watches on a program step .
def _debug_step(self, token):
        """Execute traces and watches on a program step."""
        outstr = u''
        if self._do_trace:
            linum = struct.unpack_from('<H', token, 2)
            outstr += u'[%i]' % linum
        for (expr, outs) in self._watch_list:
            outstr += u' %r = ' % (expr,)
            outs.seek(2)
            try:
                val = self._impl.parser.expression_parser.parse(outs)
                if isinstance(val, values.String):
                    outstr += u'"%s"' % self._impl.codepage.bytes_to_unicode(val.to_str())
                else:
                    outstr += (
                        values.to_repr(val, leading_space=False, type_sign=True)
                        .decode('ascii', 'ignore')
                    )
            except Exception as e:
                self._handle_exception(e)
        if outstr:
            logging.debug(outstr)
def _debug_step ( self , token ) : outstr = u'' if self . _do_trace : linum = struct . unpack_from ( '<H' , token , 2 ) outstr += u'[%i]' % linum for ( expr , outs ) in self . _watch_list : outstr += u' %r = ' % ( expr , ) outs . seek ( 2 ) try : val = self . _impl . parser . expression_parser . parse ( outs ) if isinstance ( val , values . String ) : outstr += u'"%s"' % self . _impl . codepage . bytes_to_unicode ( val . to_str ( ) ) else : outstr += ( values . to_repr ( val , leading_space = False , type_sign = True ) . decode ( 'ascii' , 'ignore' ) ) except Exception as e : self . _handle_exception ( e ) if outstr : logging . debug ( outstr )