summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2004-06-23 10:15:58 +0000
committerJose Antonio Ortega Ruiz <jao@gnu.org>2004-06-23 10:15:58 +0000
commitcca26aa755d79bf765d9151673ff7c6a6e825ebc (patch)
tree86a851a20738cd64229b5030d7ac2bebb899cdc4
parentac4f899dcb82f07a51c70d6aab3583c3377727d0 (diff)
downloadmdk-cca26aa755d79bf765d9151673ff7c6a6e825ebc.tar.gz
mdk-cca26aa755d79bf765d9151673ff7c6a6e825ebc.tar.bz2
(vm_reset_reload_): do not delete output char devices after reload.
-rw-r--r--mixlib/mix_vm.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/mixlib/mix_vm.c b/mixlib/mix_vm.c
index 8e8a065..c73e848 100644
--- a/mixlib/mix_vm.c
+++ b/mixlib/mix_vm.c
@@ -32,40 +32,50 @@ vm_reset_reload_ (mix_vm_t *vm, gboolean is_reload)
set_rA_ (vm, MIX_WORD_ZERO);
set_rX_ (vm, MIX_WORD_ZERO);
set_rJ_ (vm, MIX_WORD_ZERO);
- for ( k = 1; k < IREG_NO_+1; ++k )
- set_rI_ (vm, k, MIX_WORD_ZERO);
+ for ( k = 1; k < IREG_NO_+1; ++k ) set_rI_ (vm, k, MIX_WORD_ZERO);
set_over_ (vm, FALSE);
set_cmp_ (vm, mix_EQ);
set_loc_ (vm, MIX_WORD_ZERO);
set_last_error_ (vm, MIX_VM_ERROR_NONE);
- for ( k = 0; k < MEM_CELLS_NO_; ++k)
- set_cell_ (vm, k, MIX_WORD_ZERO);
+ for ( k = 0; k < MEM_CELLS_NO_; ++k) set_cell_ (vm, k, MIX_WORD_ZERO);
+
if (vm->symbol_table != NULL )
{
mix_symbol_table_delete (vm->symbol_table);
vm->symbol_table = NULL;
}
+
if (vm->line_table != NULL)
{
g_tree_destroy (vm->line_table);
vm->line_table = NULL;
}
+
if (vm->address_table != NULL)
{
g_tree_destroy (vm->address_table);
vm->address_table = NULL;
}
+
if (vm->src_file != NULL)
{
mix_src_file_delete (vm->src_file);
vm->src_file = NULL;
}
+
for (k = 0; k < BD_NO_; ++k)
if (vm->devices[k] != NULL)
{
- mix_device_delete (vm->devices[k]);
- vm->devices[k] = NULL;
+ mix_device_type_t type = mix_device_type (vm->devices[k]);
+ if (!is_reload || (type != mix_dev_CONSOLE
+ && type != mix_dev_PRINTER
+ && type != mix_dev_CARD_WR))
+ {
+ mix_device_delete (vm->devices[k]);
+ vm->devices[k] = NULL;
+ }
}
+
if (!is_reload)
mix_vm_clear_all_breakpoints (vm);