2003-06-24 Michael Snyder * sim-main.h (SIM_WIFSTOPPED, SIM_WSTOPSIG): Define. * compile.c (sim_resume): Use the above to return stop signal. Index: sim-main.h =================================================================== RCS file: /cvs/cvsfiles/devo/sim/h8sx/sim-main.h,v retrieving revision 1.13 diff -p -r1.13 sim-main.h *** sim-main.h 2003/06/18 11:51:39 1.13 --- sim-main.h 2003/06/24 22:13:22 *************** struct sim_state { *** 164,170 **** /* 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) #endif /* SIM_MAIN_H */ --- 164,172 ---- /* 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_WIFSTOPPED(V) (!SIM_WIFEXITED (V)) ! #define SIM_WEXITSTATUS(V) (((V) >> 8) & 0xff) ! #define SIM_WSTOPSIG(V) ((V) & 0x7f) #endif /* SIM_MAIN_H */ Index: compile.c =================================================================== RCS file: /cvs/cvsfiles/devo/sim/h8sx/compile.c,v retrieving revision 1.84 diff -p -r1.84 compile.c *** compile.c 2003/06/19 04:18:52 1.84 --- compile.c 2003/06/24 22:13:22 *************** sim_resume (SIM_DESC sd, int step, int s *** 3575,3580 **** --- 3575,3586 ---- 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. */