From d30b9f7e16a39fc297605f530a07c41cdcc2563f Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 16 Sep 2001 22:29:30 +0000 Subject: maintain virtual machine status --- mixlib/mix_vm.h | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'mixlib/mix_vm.h') diff --git a/mixlib/mix_vm.h b/mixlib/mix_vm.h index d3f4e3f..b7412bf 100644 --- a/mixlib/mix_vm.h +++ b/mixlib/mix_vm.h @@ -153,25 +153,33 @@ mix_vm_get_lineno_address (const mix_vm_t *vm, guint lineno); /* continue execution of instructions in memory */ /* Possible outcomes */ -enum { - MIX_VM_ERROR, /* error executing instructions */ - MIX_VM_BREAK, /* breakpoint found */ - MIX_VM_COND_BREAK, /* conditional breakpoint found */ - MIX_VM_HALT, /* end of execution */ - MIX_VM_OK /* successful instruction execution */ -}; - -extern int +typedef enum { + MIX_VM_ERROR, /* error executing instructions */ + MIX_VM_BREAK, /* breakpoint found */ + MIX_VM_COND_BREAK, /* conditional breakpoint found */ + MIX_VM_HALT, /* end of execution */ + MIX_VM_RUNNING, /* successful instruction execution */ + MIX_VM_LOADED, /* program loaded */ + MIX_VM_EMPTY /* no program loaded */ +} mix_vm_status_t; + +/* run until next breakpoint or end of execution */ +extern mix_vm_status_t mix_vm_run (mix_vm_t *vm); /* execute next memory instruction */ -extern int +extern mix_vm_status_t mix_vm_exec_next (mix_vm_t *vm); +/* get the current execution status */ +extern mix_vm_status_t +mix_vm_get_run_status (const mix_vm_t *vm); + /* get the line no. of the last break or 0 if not found */ extern gulong mix_vm_get_break_lineno (const mix_vm_t *vm); + /* Breakpoints */ /* possible error outcomes */ enum { @@ -210,6 +218,9 @@ mix_vm_clear_conditional_breakpoint (mix_vm_t *vm, mix_predicate_t *pred); extern const gchar * mix_vm_get_last_breakpoint_message (const mix_vm_t *vm); +extern mix_predicate_type_t +mix_vm_get_last_conditional_breakpoint_type (const mix_vm_t *vm); + /* Get the vm uptime, defined as the time spent executing instructions */ extern mix_time_t mix_vm_get_uptime (const mix_vm_t *vm); -- cgit v1.2.3