summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-02-17 23:11:49 -0800
committerYukihiro "Matz" Matsumoto <[email protected]>2013-02-17 23:11:49 -0800
commit66a7b04b251aa33d557f9515f8cac16560266c3c (patch)
tree5b9f1336456543bb5533ac108d7599b9d49cbc96 /include
parent9b06a4506ed2ae222b19cafd184c66521b720581 (diff)
parentbc44d06c7374d5b925d8936227e6976622365a3e (diff)
downloadmruby-66a7b04b251aa33d557f9515f8cac16560266c3c.tar.gz
mruby-66a7b04b251aa33d557f9515f8cac16560266c3c.zip
Merge pull request #845 from masuidrive/hook_fetch
Added a hook at VM code fetch.
Diffstat (limited to 'include')
-rw-r--r--include/mrbconf.h4
-rw-r--r--include/mruby.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/include/mrbconf.h b/include/mrbconf.h
index da60086bf..62cc73a74 100644
--- a/include/mrbconf.h
+++ b/include/mrbconf.h
@@ -50,6 +50,7 @@
//#define DISABLE_TIME /* Time class */
//#define DISABLE_STRUCT /* Struct class */
//#define DISABLE_STDIO /* use of stdio */
+//#define DISABLE_DEBUG /* hooks for debugger */
/* Now DISABLE_GEMS is added as a command line flag in Rakefile, */
/* we do not need to set it here. */
@@ -118,6 +119,9 @@ typedef short mrb_sym;
#ifndef DISABLE_STDIO
#define ENABLE_STDIO
#endif
+#ifndef DISABLE_DEBUG
+#define ENABLE_DEBUG
+#endif
#ifndef FALSE
# define FALSE 0
diff --git a/include/mruby.h b/include/mruby.h
index fb73b60b9..bebbf6b04 100644
--- a/include/mruby.h
+++ b/include/mruby.h
@@ -133,6 +133,10 @@ typedef struct mrb_state {
struct RNode *local_svar;/* regexp */
#endif
+#ifdef ENABLE_DEBUG
+ void (*hook_vm_fetch_code)(struct mrb_state* mrb, struct mrb_irep *irep, mrb_code *pc, mrb_value *regs);
+#endif
+
struct RClass *eException_class;
struct RClass *eStandardError_class;