diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vm.c | 9 | ||||
-rw-r--r-- | src/vm.h | 15 | ||||
-rw-r--r-- | src/vm_engine.h | 1 | ||||
-rw-r--r-- | src/vm_system.c | 6 |
4 files changed, 24 insertions, 7 deletions
@@ -395,6 +395,15 @@ SCM_DEFINE (scm_vm_next_hook, "vm-next-hook", 1, 0, 0, } #undef FUNC_NAME +SCM_DEFINE (scm_vm_break_hook, "vm-break-hook", 1, 0, 0, + (SCM vm), + "") +#define FUNC_NAME s_scm_vm_break_hook +{ + VM_DEFINE_HOOK (SCM_VM_BREAK_HOOK); +} +#undef FUNC_NAME + SCM_DEFINE (scm_vm_enter_hook, "vm-enter-hook", 1, 0, 0, (SCM vm), "") @@ -4,12 +4,12 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -48,11 +48,12 @@ #define SCM_VM_BOOT_HOOK 0 #define SCM_VM_HALT_HOOK 1 #define SCM_VM_NEXT_HOOK 2 -#define SCM_VM_ENTER_HOOK 3 -#define SCM_VM_APPLY_HOOK 4 -#define SCM_VM_EXIT_HOOK 5 -#define SCM_VM_RETURN_HOOK 6 -#define SCM_VM_NUM_HOOKS 7 +#define SCM_VM_BREAK_HOOK 3 +#define SCM_VM_ENTER_HOOK 4 +#define SCM_VM_APPLY_HOOK 5 +#define SCM_VM_EXIT_HOOK 6 +#define SCM_VM_RETURN_HOOK 7 +#define SCM_VM_NUM_HOOKS 8 struct scm_vm { scm_byte_t *ip; /* instruction pointer */ diff --git a/src/vm_engine.h b/src/vm_engine.h index 095fb4217..c4ce6b40f 100644 --- a/src/vm_engine.h +++ b/src/vm_engine.h @@ -183,6 +183,7 @@ #define BOOT_HOOK() RUN_HOOK (SCM_VM_BOOT_HOOK) #define HALT_HOOK() RUN_HOOK (SCM_VM_HALT_HOOK) #define NEXT_HOOK() RUN_HOOK (SCM_VM_NEXT_HOOK) +#define BREAK_HOOK() RUN_HOOK (SCM_VM_BREAK_HOOK) #define ENTER_HOOK() RUN_HOOK (SCM_VM_ENTER_HOOK) #define APPLY_HOOK() RUN_HOOK (SCM_VM_APPLY_HOOK) #define EXIT_HOOK() RUN_HOOK (SCM_VM_EXIT_HOOK) diff --git a/src/vm_system.c b/src/vm_system.c index 70df6fa64..894c74643 100644 --- a/src/vm_system.c +++ b/src/vm_system.c @@ -63,6 +63,12 @@ VM_DEFINE_INSTRUCTION (halt, "halt", 0, 0, 0) return ret; } +VM_DEFINE_INSTRUCTION (break, "break", 0, 0, 0) +{ + BREAK_HOOK (); + NEXT; +} + VM_DEFINE_INSTRUCTION (drop, "drop", 0, 0, 0) { DROP (); |