Skip to content

Commit ace9fb5

Browse files
naumsdpgeorge
authored andcommitted
py: Add verbose debug compile-time flag MICROPY_DEBUG_VERBOSE.
It enables all the DEBUG_printf outputs in the py/ source code.
1 parent a14ce77 commit ace9fb5

13 files changed

Lines changed: 17 additions & 12 deletions

File tree

py/bc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "py/bc0.h"
3636
#include "py/bc.h"
3737

38-
#if 0 // print debugging info
38+
#if MICROPY_DEBUG_VERBOSE // print debugging info
3939
#define DEBUG_PRINT (1)
4040
#else // don't print debugging info
4141
#define DEBUG_PRINT (0)

py/builtinimport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include "py/builtin.h"
3838
#include "py/frozenmod.h"
3939

40-
#if 0 // print debugging info
40+
#if MICROPY_DEBUG_VERBOSE // print debugging info
4141
#define DEBUG_PRINT (1)
4242
#define DEBUG_printf DEBUG_printf
4343
#else // don't print debugging info

py/emitglue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "py/runtime0.h"
3636
#include "py/bc.h"
3737

38-
#if 0 // print debugging info
38+
#if MICROPY_DEBUG_VERBOSE // print debugging info
3939
#define DEBUG_PRINT (1)
4040
#define WRITE_CODE (1)
4141
#define DEBUG_printf DEBUG_printf

py/emitnative.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
#include "py/emit.h"
5151
#include "py/bc.h"
5252

53-
#if 0 // print debugging info
53+
#if MICROPY_DEBUG_VERBOSE // print debugging info
5454
#define DEBUG_PRINT (1)
5555
#define DEBUG_printf DEBUG_printf
5656
#else // don't print debugging info

py/gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
#if MICROPY_ENABLE_GC
3737

38-
#if 0 // print debugging info
38+
#if MICROPY_DEBUG_VERBOSE // print debugging info
3939
#define DEBUG_PRINT (1)
4040
#define DEBUG_printf DEBUG_printf
4141
#else // don't print debugging info

py/malloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "py/misc.h"
3333
#include "py/mpstate.h"
3434

35-
#if 0 // print debugging info
35+
#if MICROPY_DEBUG_VERBOSE // print debugging info
3636
#define DEBUG_printf DEBUG_printf
3737
#else // don't print debugging info
3838
#define DEBUG_printf(...) (void)0

py/modthread.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
#include "py/mpthread.h"
3636

37-
#if 0 // print debugging info
37+
#if MICROPY_DEBUG_VERBOSE // print debugging info
3838
#define DEBUG_PRINT (1)
3939
#define DEBUG_printf DEBUG_printf
4040
#else // don't print debugging info

py/mpconfig.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,11 @@
373373
#define MICROPY_DEBUG_PRINTERS (0)
374374
#endif
375375

376+
// Whether to enable all debugging outputs (it will be extremely verbose)
377+
#ifndef MICROPY_DEBUG_VERBOSE
378+
#define MICROPY_DEBUG_VERBOSE (0)
379+
#endif
380+
376381
/*****************************************************************************/
377382
/* Optimisations */
378383

py/nativeglue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include "py/emitglue.h"
3535
#include "py/bc.h"
3636

37-
#if 0 // print debugging info
37+
#if MICROPY_DEBUG_VERBOSE // print debugging info
3838
#define DEBUG_printf DEBUG_printf
3939
#else // don't print debugging info
4040
#define DEBUG_printf(...) (void)0

py/objfun.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#include "py/bc.h"
3737
#include "py/stackctrl.h"
3838

39-
#if 0 // print debugging info
39+
#if MICROPY_DEBUG_VERBOSE // print debugging info
4040
#define DEBUG_PRINT (1)
4141
#else // don't print debugging info
4242
#define DEBUG_PRINT (0)

0 commit comments

Comments
 (0)