diff options
author | Gavin Romig-Koch <gavin@redhat.com> | 1997-05-22 13:16:03 +0000 |
---|---|---|
committer | Gavin Romig-Koch <gavin@redhat.com> | 1997-05-22 13:16:03 +0000 |
commit | 6e61ecfc92456bd557cd2276a92e34a13fd1ca4e (patch) | |
tree | 3d94cfc562be34fd30d884455d68e00beb695e40 /sim/common/sim-engine.c | |
parent | fb07c6969379c9f7ee889296e368c60918bd3898 (diff) | |
download | gdb-6e61ecfc92456bd557cd2276a92e34a13fd1ca4e.zip gdb-6e61ecfc92456bd557cd2276a92e34a13fd1ca4e.tar.gz gdb-6e61ecfc92456bd557cd2276a92e34a13fd1ca4e.tar.bz2 |
Change longjmp param/setjmp return value used for simulator restart from 0 to 2.
Diffstat (limited to 'sim/common/sim-engine.c')
-rw-r--r-- | sim/common/sim-engine.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sim/common/sim-engine.c b/sim/common/sim-engine.c index 46f69e5..6d6343e 100644 --- a/sim/common/sim-engine.c +++ b/sim/common/sim-engine.c @@ -18,11 +18,12 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "sim-main.h" - #include <stdio.h> #include <signal.h> +#include "sim-main.h" +#include "sim-assert.h" + /* Generic halt */ @@ -35,6 +36,7 @@ sim_engine_halt (SIM_DESC sd, int sigrc) { sim_engine *engine = STATE_ENGINE (sd); + ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER); if (engine->jmpbuf != NULL) { jmp_buf *halt_buf = engine->jmpbuf; @@ -59,13 +61,14 @@ sim_engine_restart (SIM_DESC sd, sim_cia cia) { sim_engine *engine = STATE_ENGINE (sd); + ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER); if (engine->jmpbuf != NULL) { jmp_buf *halt_buf = engine->jmpbuf; engine->last_cpu = last_cpu; engine->next_cpu = next_cpu; SIM_ENGINE_RESTART_HOOK (sd, last_cpu, cia); - longjmp(*halt_buf, 0); + longjmp(*halt_buf, 2); } else sim_io_error (sd, "sim_restart - bad long jump"); @@ -81,6 +84,7 @@ sim_engine_abort (SIM_DESC sd, const char *fmt, ...) { + ASSERT (sd == NULL || STATE_MAGIC (sd) == SIM_MAGIC_NUMBER); if (sd == NULL) { va_list ap; |