diff options
author | Michael Meissner <gnu@the-meissners.org> | 1996-09-04 18:50:13 +0000 |
---|---|---|
committer | Michael Meissner <gnu@the-meissners.org> | 1996-09-04 18:50:13 +0000 |
commit | 1eaaf3050ed63a769b480ba2e5ef08396567eb71 (patch) | |
tree | 1b7efe8c4991a559e01639057b35b1af189224b0 /sim/d10v/interp.c | |
parent | 7eebfc6296f0830a435a21be0ab37a076c8566bd (diff) | |
download | gdb-1eaaf3050ed63a769b480ba2e5ef08396567eb71.zip gdb-1eaaf3050ed63a769b480ba2e5ef08396567eb71.tar.gz gdb-1eaaf3050ed63a769b480ba2e5ef08396567eb71.tar.bz2 |
First cut at dealing with canadian crosses; make -t in debugger set d10v_debug if DEBUG
Diffstat (limited to 'sim/d10v/interp.c')
-rw-r--r-- | sim/d10v/interp.c | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c index 1a1ede9..38b4d4c 100644 --- a/sim/d10v/interp.c +++ b/sim/d10v/interp.c @@ -291,26 +291,38 @@ sim_open (args) { struct simops *s; struct hash_entry *h, *prev; + static int init_p = 0; + if (args != NULL) - (*d10v_callback->printf_filtered) (d10v_callback, "sim_open %s\n",args); + { +#ifdef DEBUG + if (strcmp (args, "-t") == 0) + d10v_debug = DEBUG; + else +#endif + (*d10v_callback->printf_filtered) (d10v_callback, "ERROR: unsupported option(s): %s\n",args); + } /* put all the opcodes in the hash table */ - for (s = Simops; s->func; s++) + if (!init_p++) { - h = &hash_table[hash(s->opcode,s->format)]; - - /* go to the last entry in the chain */ - while (h->next) - h = h->next; - - if (h->ops) + for (s = Simops; s->func; s++) { - h->next = calloc(1,sizeof(struct hash_entry)); - h = h->next; + h = &hash_table[hash(s->opcode,s->format)]; + + /* go to the last entry in the chain */ + while (h->next) + h = h->next; + + if (h->ops) + { + h->next = calloc(1,sizeof(struct hash_entry)); + h = h->next; + } + h->ops = s; + h->mask = s->mask; + h->opcode = s->opcode; } - h->ops = s; - h->mask = s->mask; - h->opcode = s->opcode; } } |