aboutsummaryrefslogtreecommitdiff
path: root/sim/h8300/compile.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-10-22 05:26:27 +0000
committerAndrew Cagney <cagney@redhat.com>1997-10-22 05:26:27 +0000
commit9e03a68f136a021e7bfa9afb18ca4f170e949f80 (patch)
tree78c37915fae5528e6e3cba233bbecbd7c368fa39 /sim/h8300/compile.c
parent2328ef1c9815f27863ca176608f87cd4c2ba3665 (diff)
downloadgdb-9e03a68f136a021e7bfa9afb18ca4f170e949f80.zip
gdb-9e03a68f136a021e7bfa9afb18ca4f170e949f80.tar.gz
gdb-9e03a68f136a021e7bfa9afb18ca4f170e949f80.tar.bz2
Add LMA_P and DO_WRITE arguments to sim/common/sim-load.c:sim_load_file().
Update all simulators. Clarify behavour of sim_load in remote-sim.h
Diffstat (limited to 'sim/h8300/compile.c')
-rw-r--r--sim/h8300/compile.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c
index 08dbbcc..12f9d29 100644
--- a/sim/h8300/compile.c
+++ b/sim/h8300/compile.c
@@ -26,13 +26,19 @@
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
+#endif
#include "wait.h"
#include "ansidecl.h"
#include "bfd.h"
#include "callback.h"
#include "remote-sim.h"
+#ifndef SIGTRAP
+# define SIGTRAP 5
+#endif
+
int debug;
host_callback *sim_callback;
@@ -1269,7 +1275,10 @@ sim_resume (sd, step, siggnal)
goto next;
case O (O_SYSCALL, SB):
- printf ("%c", cpu.regs[2]);
+ {
+ char c = cpu.regs[2];
+ sim_callback->write_stdout (sim_callback, &c, 1);
+ }
goto next;
ONOT (O_NOT, rd = ~rd; v = 0;);
@@ -1714,9 +1723,9 @@ sim_resume (sd, step, siggnal)
;
/* if (cpu.regs[8] ) abort(); */
- if (poll_count++ > 100)
+ if (--poll_count < 0)
{
- poll_count = 0;
+ poll_count = 100;
if ((*sim_callback->poll_quit) != NULL
&& (*sim_callback->poll_quit) (sim_callback))
sim_stop (sd);
@@ -2108,7 +2117,8 @@ sim_load (sd, prog, abfd, from_tty)
cpu.mask = memory_size - 1;
if (sim_load_file (sd, myname, sim_callback, prog, prog_bfd,
- sim_kind == SIM_OPEN_DEBUG)
+ sim_kind == SIM_OPEN_DEBUG,
+ 0, sim_write)
== NULL)
{
/* Close the bfd if we opened it. */