py: Fix label printing in showbc; print sp in vm trace.
This commit is contained in:
parent
1ca28bd570
commit
7764f163fa
@ -299,22 +299,22 @@ void mp_bytecode_print2(const byte *ip, mp_uint_t len) {
|
|||||||
|
|
||||||
case MP_BC_POP_JUMP_IF_TRUE:
|
case MP_BC_POP_JUMP_IF_TRUE:
|
||||||
DECODE_SLABEL;
|
DECODE_SLABEL;
|
||||||
printf("POP_JUMP_IF_TRUE " UINT_FMT, ip + unum - ip_start);
|
printf("POP_JUMP_IF_TRUE " INT_FMT, ip + unum - ip_start);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MP_BC_POP_JUMP_IF_FALSE:
|
case MP_BC_POP_JUMP_IF_FALSE:
|
||||||
DECODE_SLABEL;
|
DECODE_SLABEL;
|
||||||
printf("POP_JUMP_IF_FALSE " UINT_FMT, ip + unum - ip_start);
|
printf("POP_JUMP_IF_FALSE " INT_FMT, ip + unum - ip_start);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MP_BC_JUMP_IF_TRUE_OR_POP:
|
case MP_BC_JUMP_IF_TRUE_OR_POP:
|
||||||
DECODE_SLABEL;
|
DECODE_SLABEL;
|
||||||
printf("JUMP_IF_TRUE_OR_POP " UINT_FMT, ip + unum - ip_start);
|
printf("JUMP_IF_TRUE_OR_POP " INT_FMT, ip + unum - ip_start);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MP_BC_JUMP_IF_FALSE_OR_POP:
|
case MP_BC_JUMP_IF_FALSE_OR_POP:
|
||||||
DECODE_SLABEL;
|
DECODE_SLABEL;
|
||||||
printf("JUMP_IF_FALSE_OR_POP " UINT_FMT, ip + unum - ip_start);
|
printf("JUMP_IF_FALSE_OR_POP " INT_FMT, ip + unum - ip_start);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MP_BC_SETUP_WITH:
|
case MP_BC_SETUP_WITH:
|
||||||
|
2
py/vm.c
2
py/vm.c
@ -41,7 +41,7 @@
|
|||||||
#include "objgenerator.h"
|
#include "objgenerator.h"
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
#define TRACE(ip) mp_bytecode_print2(ip, 1);
|
#define TRACE(ip) printf("sp=" INT_FMT " ", sp - code_state->sp); mp_bytecode_print2(ip, 1);
|
||||||
#else
|
#else
|
||||||
#define TRACE(ip)
|
#define TRACE(ip)
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user