summaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2003-07-02 19:04:58 +0000
committerMichael Snyder <msnyder@specifix.com>2003-07-02 19:04:58 +0000
commitd3e4b4052514eb72a0a2d933698d656222c2570a (patch)
tree87afe99630d19a8163f76f363c7f80384986a4ca /sim
parent04785499f4a2a63e58ef614c1e46e96794f32e17 (diff)
downloadgdb-d3e4b4052514eb72a0a2d933698d656222c2570a.tar.gz
2003-06-24 Michael Snyder <msnyder@redhat.com>
* sim-main.h (SIM_WIFSTOPPED, SIM_WSTOPSIG): Define. * compile.c (sim_resume): Use the above to return stop signal.
Diffstat (limited to 'sim')
-rw-r--r--sim/h8300/ChangeLog5
-rw-r--r--sim/h8300/compile.c6
-rw-r--r--sim/h8300/sim-main.h6
3 files changed, 15 insertions, 2 deletions
diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog
index cd81e6eed8b..2112ad92682 100644
--- a/sim/h8300/ChangeLog
+++ b/sim/h8300/ChangeLog
@@ -1,3 +1,8 @@
+2003-06-24 Michael Snyder <msnyder@redhat.com>
+
+ * sim-main.h (SIM_WIFSTOPPED, SIM_WSTOPSIG): Define.
+ * compile.c (sim_resume): Use the above to return stop signal.
+
2003-06-18 Michael Snyder <msnyder@redhat.com>
* compile.c: Replace "Hitachi" with "Renesas".
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c
index f416695277d..7635655b3e5 100644
--- a/sim/h8300/compile.c
+++ b/sim/h8300/compile.c
@@ -3575,6 +3575,12 @@ sim_resume (SIM_DESC sd, int step, int siggnal)
sim_engine_set_run_state (sd, sim_exited,
SIM_WEXITSTATUS (h8_get_reg (sd, 0)));
}
+ else if (SIM_WIFSTOPPED (h8_get_reg (sd, 0)))
+ {
+ /* Pass the stop signal up to gdb. */
+ sim_engine_set_run_state (sd, sim_stopped,
+ SIM_WSTOPSIG (h8_get_reg (sd, 0)));
+ }
else
{
/* Treat it as a sigtrap. */
diff --git a/sim/h8300/sim-main.h b/sim/h8300/sim-main.h
index 6acf901d5de..284a5586d16 100644
--- a/sim/h8300/sim-main.h
+++ b/sim/h8300/sim-main.h
@@ -164,7 +164,9 @@ struct sim_state {
/* Local version of macros for decoding exit status.
(included here rather than try to find target version of wait.h)
*/
-#define SIM_WIFEXITED(V) (((V) & 0xff) == 0)
-#define SIM_WEXITSTATUS(V) ((V) >> 8)
+#define SIM_WIFEXITED(V) (((V) & 0xff) == 0)
+#define SIM_WIFSTOPPED(V) (!SIM_WIFEXITED (V))
+#define SIM_WEXITSTATUS(V) (((V) >> 8) & 0xff)
+#define SIM_WSTOPSIG(V) ((V) & 0x7f)
#endif /* SIM_MAIN_H */