56
56
57
57
void mp_bytecode_print2 (const byte * ip , int len );
58
58
59
- void mp_bytecode_print (const byte * ip , int len ) {
59
+ void mp_bytecode_print (const void * descr , const byte * ip , int len ) {
60
60
const byte * ip_start = ip ;
61
61
62
62
// get code info size
@@ -66,7 +66,8 @@ void mp_bytecode_print(const byte *ip, int len) {
66
66
67
67
qstr source_file = code_info [4 ] | (code_info [5 ] << 8 ) | (code_info [6 ] << 16 ) | (code_info [7 ] << 24 );
68
68
qstr block_name = code_info [8 ] | (code_info [9 ] << 8 ) | (code_info [10 ] << 16 ) | (code_info [11 ] << 24 );
69
- printf ("File %s, code block '%s' (%d bytes)\n" , qstr_str (source_file ), qstr_str (block_name ), len );
69
+ printf ("File %s, code block '%s' (descriptor: %p, bytecode @%p %d bytes)\n" ,
70
+ qstr_str (source_file ), qstr_str (block_name ), descr , code_info , len );
70
71
71
72
// bytecode prelude: state size and exception stack size; 16 bit uints
72
73
{
@@ -434,25 +435,25 @@ void mp_bytecode_print2(const byte *ip, int len) {
434
435
435
436
case MP_BC_MAKE_FUNCTION :
436
437
DECODE_PTR ;
437
- printf ("MAKE_FUNCTION " UINT_FMT , unum );
438
+ printf ("MAKE_FUNCTION %p" , ( void * ) unum );
438
439
break ;
439
440
440
441
case MP_BC_MAKE_FUNCTION_DEFARGS :
441
442
DECODE_PTR ;
442
- printf ("MAKE_FUNCTION_DEFARGS " UINT_FMT , unum );
443
+ printf ("MAKE_FUNCTION_DEFARGS %p" , ( void * ) unum );
443
444
break ;
444
445
445
446
case MP_BC_MAKE_CLOSURE : {
446
447
DECODE_PTR ;
447
448
machine_uint_t n_closed_over = * ip ++ ;
448
- printf ("MAKE_CLOSURE " UINT_FMT " " UINT_FMT , unum , n_closed_over );
449
+ printf ("MAKE_CLOSURE %p " UINT_FMT , ( void * ) unum , n_closed_over );
449
450
break ;
450
451
}
451
452
452
453
case MP_BC_MAKE_CLOSURE_DEFARGS : {
453
454
DECODE_PTR ;
454
455
machine_uint_t n_closed_over = * ip ++ ;
455
- printf ("MAKE_CLOSURE_DEFARGS " UINT_FMT " " UINT_FMT , unum , n_closed_over );
456
+ printf ("MAKE_CLOSURE_DEFARGS %p " UINT_FMT , ( void * ) unum , n_closed_over );
456
457
break ;
457
458
}
458
459
0 commit comments