--- trunk/src/emul.c 2007/10/08 16:19:37 22 +++ trunk/src/emul.c 2007/10/08 16:19:56 24 @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $Id: emul.c,v 1.247 2006/02/04 12:27:12 debug Exp $ + * $Id: emul.c,v 1.254 2006/06/22 13:22:40 debug Exp $ * * Emulation startup and misc. routines. */ @@ -39,7 +39,6 @@ #include #include "arcbios.h" -#include "bintrans.h" #include "cpu.h" #include "emul.h" #include "console.h" @@ -105,12 +104,12 @@ uint64_t addr; int res = get_symbol_addr(&m->symbol_context, m->breakpoint_string[i], &addr); - if (!res) + if (!res) { fprintf(stderr, - "WARNING! Breakpoint '%s' could not be" + "ERROR! Breakpoint '%s' could not be" " parsed\n", m->breakpoint_string[i]); - else { + } else { dp = addr; string_flag = 1; } @@ -940,9 +939,6 @@ if (m->arch == ARCH_ALPHA) m->arch_pagesize = 8192; - if (m->arch != ARCH_MIPS) - m->bintrans_enable = 0; - machine_memsize_fix(m); /* @@ -990,18 +986,17 @@ } memset(m->cpus, 0, sizeof(struct cpu *) * m->ncpus); - /* Initialize dynamic binary translation, if available: */ - if (m->bintrans_enable) - bintrans_init(m, m->memory); - debug("cpu0"); if (m->ncpus > 1) debug(" .. cpu%i", m->ncpus - 1); debug(": "); for (i=0; incpus; i++) { m->cpus[i] = cpu_new(m->memory, m, i, m->cpu_name); - if (m->bintrans_enable) - bintrans_init_cpu(m->cpus[i]); + if (m->cpus[i] == NULL) { + fprintf(stderr, "Unable to create CPU object. " + "Aborting."); + exit(1); + } } debug("\n"); @@ -1012,8 +1007,6 @@ m->cpus[m->ncpus] = cpu_new(m->memory, m, 0 /* use 0 here to show info with debug() */, "Allegrex" /* TODO */); - if (m->bintrans_enable) - bintrans_init_cpu(m->cpus[m->ncpus]); debug("\n"); m->ncpus ++; } @@ -1355,10 +1348,6 @@ symbol_recalc_sizes(&m->symbol_context); - if (m->max_random_cycles_per_chunk > 0) - debug("using random cycle chunks (1 to %i cycles)\n", - m->max_random_cycles_per_chunk); - /* Special hack for ARC/SGI emulation: */ if ((m->machine_type == MACHINE_ARC || m->machine_type == MACHINE_SGI) && m->prom_emulation) @@ -1493,32 +1482,12 @@ { int iadd = DEBUG_INDENTATION; struct emul *e = emul_new(fname); - FILE *f; - char buf[128]; - size_t len; debug("Creating emulation from configfile \"%s\":\n", fname); debug_indentation(iadd); - f = fopen(fname, "r"); - if (f == NULL) { - perror(fname); - exit(1); - } - - /* Read header: (must be !!gxemul) */ - len = fread(buf, 1, 8, f); - if (len != 8 || strncmp(buf, "!!gxemul", 8) != 0) { - fprintf(stderr, "%s: must start with '!!gxemul'\n", fname); - exit(1); - } + emul_parse_config(e, fname); - /* Restart from beginning: */ - rewind(f); - - emul_parse_config(e, f); - - fclose(f); debug_indentation(-iadd); return e; } @@ -1616,6 +1585,10 @@ continue; for (j=0; jn_machines; j++) { + if (e->machines[j]->gdb.port > 0) + debugger_gdb_check_incoming( + e->machines[j]); + /* TODO: cpu_run() is a strange name, since there can be multiple cpus in a machine */ anything = cpu_run(e, e->machines[j]);