* run.c (sim_callback_write_stdout): New.
authorSteve Chamberlain <sac@cygnus>
Wed, 20 Sep 1995 16:52:52 +0000 (16:52 +0000)
committerSteve Chamberlain <sac@cygnus>
Wed, 20 Sep 1995 16:52:52 +0000 (16:52 +0000)
* interp.c (trap): Call sim_callback_write_stdout when needed.

sim/sh/ChangeLog
sim/sh/interp.c
sim/sh/run.c

index 382b22c73de8d6df286d82b1a1fc4f31932fbfe2..d82bbc949941fc8a056b8fa33e1b2516e689268b 100644 (file)
@@ -1,3 +1,8 @@
+Wed Sep 20 09:51:50 1995  steve chamberlain  <sac@slash.cygnus.com>
+
+       * run.c (sim_callback_write_stdout):  New.
+       * interp.c (trap): Call sim_callback_write_stdout when needed.
+
 Mon Sep 18 18:42:27 1995  steve chamberlain  <sac@slash.cygnus.com>
 
        * interp.c (trap): Remove useless code.
index beaf44297668e5f56cc9c61105384cadde12eb08..c461981d186aaded8aa590bb26c5ac039f94a3f5 100644 (file)
@@ -506,7 +506,10 @@ trap (i, regs, memory, maskl, maskw, little_endian)
            regs[0] = read (regs[5], ptr (regs[6]), regs[7]);
            break;
          case SYS_write:
-           regs[0] = write (regs[5], ptr (regs[6]), regs[7]);
+           if (regs[5] == 1)
+             regs[0] = sim_callback_write_stdout (ptr(regs[6]), regs[7]);
+           else
+             regs[0] = write (regs[5], ptr (regs[6]), regs[7]);
            break;
          case SYS_lseek:
            regs[0] = lseek (regs[5], regs[6], regs[7]);
index f039851bd8dd1e02ac9ff0c37b02013d8bfda451..587d3afd9a2c3ec848e254b70969513ee545b2df 100644 (file)
@@ -165,3 +165,11 @@ printf_filtered (va_alist)
   vfprintf (stdout, format, args);
   va_end (args);
 }
+
+int
+sim_callback_write_stdout (arg, len)
+     char *arg;
+     int len;
+{
+  return write (1, arg, len);
+}