8000 py/showbc: Make printf's go to the platform print stream. · sparkfun/circuitpython@fbddea9 · GitHub
[go: up one dir, main page]

Skip to content

Commit fbddea9

Browse files
committed
py/showbc: Make printf's go to the platform print stream.
The system printf is no longer used by the core uPy code. Instead, the platform print stream or DEBUG_printf is used. Using DEBUG_printf in the showbc functions would mean that the code can't be tested by the test suite, so use the normal output instead. This patch also fixes parsing of bytecode-line-number mappings.
1 parent 60592fd commit fbddea9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

py/showbc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232

3333
#if MICROPY_DEBUG_PRINTERS
3434

35+
// redirect all printfs in this file to the platform print stream
36+
#define printf(...) mp_printf(&mp_plat_print, __VA_ARGS__)
37+
3538
#define DECODE_UINT { \
3639
unum = 0; \
3740
do { \
@@ -96,6 +99,7 @@ void mp_bytecode_print(const void *descr, const byte *ip, mp_uint_t len, const m
9699
#if MICROPY_PERSISTENT_CODE
97100
qstr block_name = code_info[0] | (code_info[1] << 8);
98101
qstr source_file = code_info[2] | (code_info[3] << 8);
102+
code_info += 4;
99103
#else
100104
qstr block_name = mp_decode_uint(&code_info);
101105
qstr source_file = mp_decode_uint(&code_info);

0 commit comments

Comments
 (0)
0