Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
bc44d06c
Commit
bc44d06c
authored
Feb 17, 2013
by
Yuichiro MASUI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created hook at VM code fetch. It's for debugger
parent
92cf2a0c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
3 deletions
+17
-3
include/mrbconf.h
include/mrbconf.h
+4
-0
include/mruby.h
include/mruby.h
+4
-0
src/vm.c
src/vm.c
+9
-3
No files found.
include/mrbconf.h
View file @
bc44d06c
...
@@ -50,6 +50,7 @@
...
@@ -50,6 +50,7 @@
//#define DISABLE_TIME /* Time class */
//#define DISABLE_TIME /* Time class */
//#define DISABLE_STRUCT /* Struct class */
//#define DISABLE_STRUCT /* Struct class */
//#define DISABLE_STDIO /* use of stdio */
//#define DISABLE_STDIO /* use of stdio */
//#define DISABLE_DEBUG /* hooks for debugger */
/* Now DISABLE_GEMS is added as a command line flag in Rakefile, */
/* Now DISABLE_GEMS is added as a command line flag in Rakefile, */
/* we do not need to set it here. */
/* we do not need to set it here. */
...
@@ -118,6 +119,9 @@ typedef short mrb_sym;
...
@@ -118,6 +119,9 @@ typedef short mrb_sym;
#ifndef DISABLE_STDIO
#ifndef DISABLE_STDIO
#define ENABLE_STDIO
#define ENABLE_STDIO
#endif
#endif
#ifndef DISABLE_DEBUG
#define ENABLE_DEBUG
#endif
#ifndef FALSE
#ifndef FALSE
# define FALSE 0
# define FALSE 0
...
...
include/mruby.h
View file @
bc44d06c
...
@@ -133,6 +133,10 @@ typedef struct mrb_state {
...
@@ -133,6 +133,10 @@ typedef struct mrb_state {
struct
RNode
*
local_svar
;
/* regexp */
struct
RNode
*
local_svar
;
/* regexp */
#endif
#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
*
eException_class
;
struct
RClass
*
eStandardError_class
;
struct
RClass
*
eStandardError_class
;
...
...
src/vm.c
View file @
bc44d06c
...
@@ -480,13 +480,19 @@ argnum_error(mrb_state *mrb, int num)
...
@@ -480,13 +480,19 @@ argnum_error(mrb_state *mrb, int num)
mrb
->
exc
=
(
struct
RObject
*
)
mrb_object
(
exc
);
mrb
->
exc
=
(
struct
RObject
*
)
mrb_object
(
exc
);
}
}
#ifdef ENABLE_DEBUG
#define HOOK_MRB_VM_FETCH_CODE(mrb, irep, pc, regs) ((mrb)->hook_vm_fetch_code ? (mrb)->hook_vm_fetch_code((mrb), (irep), (pc), (regs)) : NULL)
#else
#define HOOK_MRB_VM_FETCH_CODE(mrb, irep, pc, regs)
#endif
#ifdef __GNUC__
#ifdef __GNUC__
#define DIRECT_THREADED
#define DIRECT_THREADED
#endif
#endif
#ifndef DIRECT_THREADED
#ifndef DIRECT_THREADED
#define INIT_DISPATCH for (;;) { i = *pc; switch (GET_OPCODE(i)) {
#define INIT_DISPATCH for (;;) { i = *pc;
HOOK_MRB_VM_FETCH_CODE(mrb, irep, pc, regs);
switch (GET_OPCODE(i)) {
#define CASE(op) case op:
#define CASE(op) case op:
#define NEXT pc++; break
#define NEXT pc++; break
#define JUMP break
#define JUMP break
...
@@ -496,8 +502,8 @@ argnum_error(mrb_state *mrb, int num)
...
@@ -496,8 +502,8 @@ argnum_error(mrb_state *mrb, int num)
#define INIT_DISPATCH JUMP; return mrb_nil_value();
#define INIT_DISPATCH JUMP; return mrb_nil_value();
#define CASE(op) L_ ## op:
#define CASE(op) L_ ## op:
#define NEXT i=*++pc; goto *optable[GET_OPCODE(i)]
#define NEXT i=*++pc;
HOOK_MRB_VM_FETCH_CODE(mrb, irep, pc, regs);
goto *optable[GET_OPCODE(i)]
#define JUMP i=*pc; goto *optable[GET_OPCODE(i)]
#define JUMP i=*pc;
HOOK_MRB_VM_FETCH_CODE(mrb, irep, pc, regs);
goto *optable[GET_OPCODE(i)]
#define END_DISPATCH
#define END_DISPATCH
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment