Skip to content

Commit

Permalink
nlr: Add even more optional debugging logging.
Browse files Browse the repository at this point in the history
Has to be enabled by manual editing, but at least it's there, as debugging
NLR issues may be weird.
  • Loading branch information
pfalcon committed Feb 15, 2015
1 parent e89cc13 commit 3077fbf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions py/nlr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)); \
Expand All @@ -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__

0 comments on commit 3077fbf

Please sign in to comment.