From: Steve Chamberlain Date: Wed, 20 Sep 1995 16:52:52 +0000 (+0000) Subject: * run.c (sim_callback_write_stdout): New. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5897a29e88fc79cc7084811aec69e3bdaccd9150;p=binutils-gdb.git * run.c (sim_callback_write_stdout): New. * interp.c (trap): Call sim_callback_write_stdout when needed. --- diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog index 382b22c73de..d82bbc94994 100644 --- a/sim/sh/ChangeLog +++ b/sim/sh/ChangeLog @@ -1,3 +1,8 @@ +Wed Sep 20 09:51:50 1995 steve chamberlain + + * 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 * interp.c (trap): Remove useless code. diff --git a/sim/sh/interp.c b/sim/sh/interp.c index beaf4429766..c461981d186 100644 --- a/sim/sh/interp.c +++ b/sim/sh/interp.c @@ -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]); diff --git a/sim/sh/run.c b/sim/sh/run.c index f039851bd8d..587d3afd9a2 100644 --- a/sim/sh/run.c +++ b/sim/sh/run.c @@ -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); +}