From 3077fbff262fd64b5e71c8f7a4e33e0c0c949ca5 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 15 Feb 2015 20:28:18 +0300 Subject: [PATCH] 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. --- py/nlr.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/py/nlr.h b/py/nlr.h index 58e3fa23f5..2c09de0ba4 100644 --- a/py/nlr.h +++ b/py/nlr.h @@ -91,6 +91,8 @@ void nlr_jump_fail(void *val); #include "mpstate.h" #define nlr_raise(val) \ do { \ + /*printf("nlr_raise: nlr_top=%p\n", MP_STATE_VM(nlr_top)); \ + fflush(stdout);*/ \ void *_val = val; \ assert(_val != NULL); \ assert(mp_obj_is_exception_instance(_val)); \ @@ -100,6 +102,12 @@ void nlr_jump_fail(void *val); #define nlr_push(val) \ assert(MP_STATE_VM(nlr_top) != val),nlr_push(val) +/* +#define nlr_push(val) \ + 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) +#endif +*/ + #endif #endif // __MICROPY_INCLUDED_PY_NLR_H__