Commits

Mark Shannon  committed e7c90a9 Draft

Fix up debug output from DOC

  • Participants
  • Parent commits c43d71d

Comments (0)

Files changed (1)

File Python/trace_D_O_C.c

 
 #define LOCAL(n) (opt->top_frame->locals[n])
 
-#define VERBOSE
+/* #define VERBOSE */
 #ifdef VERBOSE
 #define COMMENT(txt) x->next->comment(x->next, txt)
 #else
 
 #ifdef VERBOSE
 #define SHOW_STACK() show_stack(x)
-#define SHOW_FRAME() show_frames(x);
+#define SHOW_FRAME(f) show_frame(x, f)
+#define SHOW_FRAMES() show_frames(x)
 
 static char *
 show_blocks(char *buf, DeferredFrame *f)
 
 #else
 #define SHOW_STACK() ((void)0)
-#define SHOW_FRAME() ((void)0)
+#define SHOW_FRAME(f) ((void)0)
+#define SHOW_FRAMES() ((void)0)
 #endif
 
 #define CHECK_OK if (opt->err_occurred) return
         PyBytes_FromStringAndSize((char *)buffer.base, buffer.next - buffer.base);
     PyMem_Free(buffer.base);
     context->cf_constants = const_writer_close(buffer.consts);
-    SHOW_FRAME();
+    SHOW_FRAMES();
 }
 
 #define read_byte(code) (*((*code)++))
     Py_DECREF(bytes);
     Py_DECREF(consts);
     x->next->opcode_with_arg(x->next, MATERIALISE_FRAME, real_depth);
-    show_frame(x, f);
+    SHOW_FRAME(f);
 }
 
 static void
     HotPy_DOC *opt = (HotPy_DOC *)x;
     int i;
     int reg_index;
-    SHOW_FRAME();
+    SHOW_FRAMES();
     if (index >= opt->top_frame->lcount) {
         assert(opt->top_frame->allocated);
         v = POP();
         x->next->store_fast(x->next, index);
     }
     SHOW_STACK();
-    SHOW_FRAME();
+    SHOW_FRAMES();
 }
 
 static void
         materialise(x, v);
         x->next->enter_frame(x->next, code);
     }
-    SHOW_FRAME();
+    SHOW_FRAMES();
 }
 
 static int min(int a, int b)
     push_frame(x, f);
     materialise(x, v);
     x->next->gen_enter(x->next, code);
-    SHOW_FRAME();
+    SHOW_FRAMES();
 }
 
 static void leave_frame(HotPyOptimiser *x)
         opt->top_frame = NULL;
     assert(opt->frame_depth >= 0);
     Py_CLEAR(opt->frame_stack[opt->frame_depth]);
-    SHOW_FRAME();
+    SHOW_FRAMES();
 }
 
 
         opt->top_frame = NULL;
     assert(opt->frame_depth >= 0);
     Py_CLEAR(opt->frame_stack[opt->frame_depth]);
-    SHOW_FRAME();
+    SHOW_FRAMES();
 }
 
 static void set_lasti(HotPyOptimiser *x, int index)
         context = x->next->opcode_with_exit(x->next, op);
         if (context)
             save_state_to_context(x, context);
-        SHOW_FRAME();
+        SHOW_FRAMES();
         break;
     case POP_EXIT_IF_FALSE: case POP_EXIT_IF_TRUE:
         /* Value must be an int or bool */
     }
     else
         create_state_from_frozen(x, c);
-    SHOW_FRAME();
+    SHOW_FRAMES();
     return x->next->start(x->next, trace, f, c, reason);
 }