aboutsummaryrefslogtreecommitdiff
path: root/sim/h8300/compile.c
diff options
context:
space:
mode:
authorDavid Edelsohn <dje.gcc@gmail.com>1996-03-11 19:30:53 +0000
committerDavid Edelsohn <dje.gcc@gmail.com>1996-03-11 19:30:53 +0000
commit4dfb4ffcd1828740bf905bd018533aa84b24f486 (patch)
tree7fb47154d18f492bcf6154726ead80b7674aece2 /sim/h8300/compile.c
parent1ef980b961f19eb7bf5b18b0417a000d29e4d15e (diff)
downloadgdb-4dfb4ffcd1828740bf905bd018533aa84b24f486.zip
gdb-4dfb4ffcd1828740bf905bd018533aa84b24f486.tar.gz
gdb-4dfb4ffcd1828740bf905bd018533aa84b24f486.tar.bz2
* compile.c: #include "wait.h".
(sim_resume, sleep insn): Check program exit status in r0.
Diffstat (limited to 'sim/h8300/compile.c')
-rw-r--r--sim/h8300/compile.c6
1 files changed, 5 insertions, 1 deletions
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 <stdlib.h>
#endif
#include <sys/param.h>
+#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;