mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
add callback invocation from OP_DEBUG
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user