* 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.
+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.
#include "sysdep.h"
#include <sys/times.h>
#include <sys/param.h>
-
+#include "remote-sim.h"
int debug;
}
int
-sim_resume (step)
+sim_resume (step, siggnal)
{
static int init1;
int cycles = 0;
int
sim_write (addr, buffer, size)
- long int addr;
+ SIM_ADDR addr;
unsigned char *buffer;
int 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;
}
#define TICK_REGNUM 12
-void
+int
sim_store_register (rn, value)
int rn;
unsigned char *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;
case 10:
v = cpu.cycles;
longreg = 1;
-
break;
case 11:
v = cpu.ticks;
v = cpu.insts;
longreg = 1;
break;
-
}
if (h8300hmode || longreg)
{
buf[0] = v >> 8;
buf[1] = v;
}
+ return 0;
}
int
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;
}
-void
-sim_info (verbose)
+int
+sim_info (printf_fn, verbose)
+ void (*printf_fn)();
int verbose;
{
}
}
#endif
+
+ return 0;
}
void
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;
}
*/
+#include <stdio.h>
#include "bfd.h"
#include "sysdep.h"
}
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;
}
}