mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 09:50:15 +01:00
py: Fix compiling with debug enabled and make more use of DEBUG_printf.
DEBUG_printf and MICROPY_DEBUG_PRINTER is now used instead of normal printf, and a fault is fixed in mp_obj_class_lookup with debugging enabled; see issue #3999. Debugging can now be enabled on all ports including when nan-boxing is used.
This commit is contained in:
8
py/map.c
8
py/map.c
@@ -423,13 +423,13 @@ void mp_set_clear(mp_set_t *set) {
|
||||
#if defined(DEBUG_PRINT) && DEBUG_PRINT
|
||||
void mp_map_dump(mp_map_t *map) {
|
||||
for (size_t i = 0; i < map->alloc; i++) {
|
||||
if (map->table[i].key != NULL) {
|
||||
if (map->table[i].key != MP_OBJ_NULL) {
|
||||
mp_obj_print(map->table[i].key, PRINT_REPR);
|
||||
} else {
|
||||
printf("(nil)");
|
||||
DEBUG_printf("(nil)");
|
||||
}
|
||||
printf(": %p\n", map->table[i].value);
|
||||
DEBUG_printf(": %p\n", map->table[i].value);
|
||||
}
|
||||
printf("---\n");
|
||||
DEBUG_printf("---\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user