aboutsummaryrefslogtreecommitdiff
path: root/sim/sh/interp.c
diff options
context:
space:
mode:
authorSteve Chamberlain <sac@cygnus>1995-09-20 16:52:52 +0000
committerSteve Chamberlain <sac@cygnus>1995-09-20 16:52:52 +0000
commit5897a29e88fc79cc7084811aec69e3bdaccd9150 (patch)
tree66b434fac383eb80a132ec4a8275b6ceb71a8243 /sim/sh/interp.c
parentf69e888e4dfa4d47bfc8eefe67ea6ae36455981c (diff)
downloadgdb-5897a29e88fc79cc7084811aec69e3bdaccd9150.zip
gdb-5897a29e88fc79cc7084811aec69e3bdaccd9150.tar.gz
gdb-5897a29e88fc79cc7084811aec69e3bdaccd9150.tar.bz2
* run.c (sim_callback_write_stdout): New.
* interp.c (trap): Call sim_callback_write_stdout when needed.
Diffstat (limited to 'sim/sh/interp.c')
-rw-r--r--sim/sh/interp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sim/sh/interp.c b/sim/sh/interp.c
index beaf442..c461981 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]);