add callback invocation from OP_DEBUG

parent 92570a96
......@@ -156,6 +156,7 @@ typedef struct mrb_state {
#ifdef ENABLE_DEBUG
void (*code_fetch_hook)(struct mrb_state* mrb, struct mrb_irep *irep, mrb_code *pc, mrb_value *regs);
void (*debug_op_hook)(struct mrb_state* mrb, struct mrb_irep *irep, mrb_code *pc, mrb_value *regs);
#endif
struct RClass *eException_class;
......
......@@ -2113,10 +2113,14 @@ mrb_context_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int
CASE(OP_DEBUG) {
/* A debug print R(A),R(B),R(C) */
#ifdef ENABLE_DEBUG
mrb->debug_op_hook(mrb, irep, pc, regs);
#else
#ifdef ENABLE_STDIO
printf("OP_DEBUG %d %d %d\n", GETARG_A(i), GETARG_B(i), GETARG_C(i));
#else
abort();
#endif
#endif
NEXT;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment