diff options
author | David Edelsohn <dje.gcc@gmail.com> | 1993-10-26 17:01:03 +0000 |
---|---|---|
committer | David Edelsohn <dje.gcc@gmail.com> | 1993-10-26 17:01:03 +0000 |
commit | a415cf0a776e3db41c8918dca5e9c2fe0117932c (patch) | |
tree | 86d531c914552e00958f4245abe9efd4625274f3 /sim/h8300 | |
parent | c7efaa16dc66169aea23dd5a52d38d815f072b2a (diff) | |
download | gdb-a415cf0a776e3db41c8918dca5e9c2fe0117932c.zip gdb-a415cf0a776e3db41c8918dca5e9c2fe0117932c.tar.gz gdb-a415cf0a776e3db41c8918dca5e9c2fe0117932c.tar.bz2 |
* Makefile.in (CSEARCH): Add -I$(srcdir)/../../gdb
* compile.c: #include "remote-sim.h".
(sim_resume): New arg siggnal.
(sim_write): Use SIM_ADDR for type of arg addr. Always return a value.
(sim_read): Ditto.
(sim_store_register): Result is type int.
(sim_fetch_register): Ditto.
(sim_stop_reason): Renamed from sim_stop_signal.
(sim_set_pc): Use SIM_ADDR for type of arg pc.
(sim_info): int result, new arg printf_fn.
(sim_kill): int result.
(sim_open): int result, new arg name.
* run.c (main): Use sim_set_pc to set pc. Update call to sim_info.
Diffstat (limited to 'sim/h8300')
-rw-r--r-- | sim/h8300/ChangeLog | 18 | ||||
-rw-r--r-- | sim/h8300/compile.c | 56 | ||||
-rw-r--r-- | sim/h8300/run.c | 5 |
3 files changed, 54 insertions, 25 deletions
diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog index e8d00d9..564aad0 100644 --- a/sim/h8300/ChangeLog +++ b/sim/h8300/ChangeLog @@ -1,3 +1,21 @@ +Tue Oct 26 09:43:36 1993 Doug Evans (dje@canuck.cygnus.com) + + * Makefile.in (CSEARCH): Add -I$(srcdir)/../../gdb + * compile.c: #include "remote-sim.h". + (sim_resume): New arg siggnal. + (sim_write): Use SIM_ADDR for type of arg addr. + Always return a value. + (sim_read): Ditto. + (sim_store_register): Result is type int. + (sim_fetch_register): Ditto. + (sim_stop_reason): Renamed from sim_stop_signal. + (sim_set_pc): Use SIM_ADDR for type of arg pc. + (sim_info): int result, new arg printf_fn. + (sim_kill): int result. + (sim_open): int result, new arg name. + * run.c (main): Use sim_set_pc to set pc. + Update call to sim_info. + Sat Oct 23 15:01:18 1993 Doug Evans (dje@canuck.cygnus.com) * compile.c (sim_stop_signal): Result is now enum sim_stop. diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c index 09085d1..0cf0f20 100644 --- a/sim/h8300/compile.c +++ b/sim/h8300/compile.c @@ -21,7 +21,7 @@ #include "sysdep.h" #include <sys/times.h> #include <sys/param.h> - +#include "remote-sim.h" int debug; @@ -780,7 +780,7 @@ int n,nz; } int -sim_resume (step) +sim_resume (step, siggnal) { static int init1; int cycles = 0; @@ -1462,7 +1462,7 @@ case O(name, SL):{ int t;int hm = 0x80000000; rd = GET_L_REG(code->src.reg);how; int sim_write (addr, buffer, size) - long int addr; + SIM_ADDR addr; unsigned char *buffer; int size; { @@ -1470,24 +1470,24 @@ sim_write (addr, buffer, size) init_pointers (); if (addr < 0 || addr + size > MSIZE) - return; + return 0; for (i = 0; i < size; i++) { cpu.memory[addr + i] = buffer[i]; cpu.cache_idx[addr + i] = 0; } -return size; + return size; } int sim_read (addr, buffer, size) - long int addr; - char *buffer; + SIM_ADDR addr; + unsigned char *buffer; int size; { init_pointers (); if (addr < 0 || addr + size > MSIZE) - return; + return 0; memcpy (buffer, cpu.memory + addr, size); return size; } @@ -1515,7 +1515,7 @@ sim_read (addr, buffer, size) #define TICK_REGNUM 12 -void +int sim_store_register (rn, value) int rn; unsigned char *value; @@ -1560,12 +1560,13 @@ sim_store_register (rn, value) cpu.ticks = longval; break; } + return 0; } -void +int sim_fetch_register (rn, buf) int rn; - char *buf; + unsigned char *buf; { int v; int longreg = 0; @@ -1595,7 +1596,6 @@ sim_fetch_register (rn, buf) case 10: v = cpu.cycles; longreg = 1; - break; case 11: v = cpu.ticks; @@ -1605,7 +1605,6 @@ sim_fetch_register (rn, buf) v = cpu.insts; longreg = 1; break; - } if (h8300hmode || longreg) { @@ -1619,6 +1618,7 @@ sim_fetch_register (rn, buf) buf[0] = v >> 8; buf[1] = v; } + return 0; } int @@ -1627,17 +1627,22 @@ sim_trace () return 0; } -enum sim_stop -sim_stop_signal (sigrc) - int *sigrc +int +sim_stop_reason (reason, sigrc) + enum sim_stop *reason; + int *sigrc; { + *reason = sim_stopped; *sigrc = cpu.exception; - return sim_stopped; + return 0; } +int sim_set_pc (n) + SIM_ADDR n; { cpu.pc = n; + return 0; } @@ -1654,8 +1659,9 @@ sim_csize (n) -void -sim_info (verbose) +int +sim_info (printf_fn, verbose) + void (*printf_fn)(); int verbose; { @@ -1684,6 +1690,8 @@ sim_info (verbose) } } #endif + + return 0; } void @@ -1692,19 +1700,21 @@ set_h8300h () h8300hmode = 1; } -void +int sim_kill() { + return 0; } -sim_open () +sim_open (name) + char *name; { return 0; } sim_set_args(argv, env) -char **argv; -char **env; + char **argv; + char **env; { return 0; } diff --git a/sim/h8300/run.c b/sim/h8300/run.c index 3010433..72f2c18 100644 --- a/sim/h8300/run.c +++ b/sim/h8300/run.c @@ -18,6 +18,7 @@ */ +#include <stdio.h> #include "bfd.h" #include "sysdep.h" @@ -72,10 +73,10 @@ main (ac, av) } start_address = bfd_get_start_address(abfd); - sim_store_register(9,start_address); + sim_set_pc (start_address); sim_resume(0,0); if (verbose) - sim_info (verbose); + sim_info (printf, verbose - 1); return 0; } } |