From 4dfb4ffcd1828740bf905bd018533aa84b24f486 Mon Sep 17 00:00:00 2001 From: David Edelsohn Date: Mon, 11 Mar 1996 19:30:53 +0000 Subject: * compile.c: #include "wait.h". (sim_resume, sleep insn): Check program exit status in r0. --- sim/h8300/ChangeLog | 3 ++- sim/h8300/compile.c | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog index 5ac0fb0..479e4849 100644 --- a/sim/h8300/ChangeLog +++ b/sim/h8300/ChangeLog @@ -1,6 +1,7 @@ Mon Mar 11 09:53:25 1996 Doug Evans - * compile.c (sim_resume): Watch for calls to abort. + * compile.c: #include "wait.h". + (sim_resume, sleep insn): Check program exit status in r0. * run.c: #include . (main): Abort if program got SIGILL. diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c index bfeb74c..7a2df63 100644 --- a/sim/h8300/compile.c +++ b/sim/h8300/compile.c @@ -27,6 +27,7 @@ #include #endif #include +#include "wait.h" #include "ansidecl.h" #include "callback.h" #include "remote-sim.h" @@ -1254,7 +1255,10 @@ sim_resume (step, siggnal) cpu.exception = SIGILL; goto end; case O (O_SLEEP, SB): - if ((short) cpu.regs[0] == -255) + /* The format of r0 is defined by devo/include/wait.h. + cpu.exception handling needs some cleanup: we need to make the + the handling of normal exits vs signals, etc. more sensible. */ + if (! WIFEXITED (cpu.regs[0]) && WIFSIGNALED (cpu.regs[0])) cpu.exception = SIGILL; else cpu.exception = SIGTRAP; -- cgit v1.1