Skip to content

Commit 3077fbf

Browse files
committed
nlr: Add even more optional debugging logging.
Has to be enabled by manual editing, but at least it's there, as debugging NLR issues may be weird.
1 parent e89cc13 commit 3077fbf

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

py/nlr.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ void nlr_jump_fail(void *val);
9191
#include "mpstate.h"
9292
#define nlr_raise(val) \
9393
do { \
94+
/*printf("nlr_raise: nlr_top=%p\n", MP_STATE_VM(nlr_top)); \
95+
fflush(stdout);*/ \
9496
void *_val = val; \
9597
assert(_val != NULL); \
9698
assert(mp_obj_is_exception_instance(_val)); \
@@ -100,6 +102,12 @@ void nlr_jump_fail(void *val);
100102
#define nlr_push(val) \
101103
assert(MP_STATE_VM(nlr_top) != val),nlr_push(val)
102104

105+
/*
106+
#define nlr_push(val) \
107+
printf("nlr_push: before: nlr_top=%p, val=%p\n", MP_STATE_VM(nlr_top), val),assert(MP_STATE_VM(nlr_top) != val),nlr_push(val)
108+
#endif
109+
*/
110+
103111
#endif
104112

105113
#endif // __MICROPY_INCLUDED_PY_NLR_H__

0 commit comments

Comments
 (0)