diff --git a/py/showbc.c b/py/showbc.c
index 0f335ffeff87656a7d2b69a1d20b3f540f95da87..684d9af0c0b0269c37cf71ec769e56d1f54b391a 100644
--- a/py/showbc.c
+++ b/py/showbc.c
@@ -32,6 +32,9 @@
 
 #if MICROPY_DEBUG_PRINTERS
 
+// redirect all printfs in this file to the platform print stream
+#define printf(...) mp_printf(&mp_plat_print, __VA_ARGS__)
+
 #define DECODE_UINT { \
     unum = 0; \
     do { \
@@ -96,6 +99,7 @@ void mp_bytecode_print(const void *descr, const byte *ip, mp_uint_t len, const m
     #if MICROPY_PERSISTENT_CODE
     qstr block_name = code_info[0] | (code_info[1] << 8);
     qstr source_file = code_info[2] | (code_info[3] << 8);
+    code_info += 4;
     #else
     qstr block_name = mp_decode_uint(&code_info);
     qstr source_file = mp_decode_uint(&code_info);