From 3e99af1bae18cf44ea630a3cd5d371651a57474b Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Sat, 5 Dec 1998 10:32:12 +0000 Subject: [PATCH] * gx prototype: simulator I/O bug fix 1998-12-05 Frank Ch. Eigler * gx-translate.c (m32r_emit_short_insn): Correct ABI result handling for TRAP insn. --- sim/m32r-gx/ChangeLog | 5 +++++ sim/m32r-gx/gx-translate.c | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/sim/m32r-gx/ChangeLog b/sim/m32r-gx/ChangeLog index ad03dac37c5..a04bd6fdcb5 100644 --- a/sim/m32r-gx/ChangeLog +++ b/sim/m32r-gx/ChangeLog @@ -1,3 +1,8 @@ +1998-12-05 Frank Ch. Eigler + + * gx-translate.c (m32r_emit_short_insn): Correct ABI result + handling for TRAP insn. + 1998-12-01 Frank Ch. Eigler * Makefile.in (SIM_OBJS): Don't build sim-core.o. diff --git a/sim/m32r-gx/gx-translate.c b/sim/m32r-gx/gx-translate.c index 461417c5da3..aa0a0f1f05b 100644 --- a/sim/m32r-gx/gx-translate.c +++ b/sim/m32r-gx/gx-translate.c @@ -433,7 +433,9 @@ m32r_emit_long_insn(sim_gx_block* gx, PCADDR pc, unsigned insn, int optimized) sim_gx_compiled_block* block = optimized ? gx->optimized_block : gx->learning_block; FILE* f = block->source_file; - ASSERT(block->source_file != NULL); + ASSERT(f != NULL); + + /* fprintf(f, " printf(\"0x%06x\\n\");\n", pc); */ if(op1 == 0x8 && op2 == 0x4 && r1 == 0) { @@ -834,6 +836,8 @@ m32r_emit_short_insn(sim_gx_block* gx, PCADDR pc, unsigned insn, int optimized) ASSERT(f != NULL); + /* fprintf(f, " printf(\"0x%06x\\n\");\n", pc); */ + if(0) ; /* place holder */ else if(op1 == 0x0 && op2 == 0x0) @@ -1017,8 +1021,8 @@ m32r_emit_short_insn(sim_gx_block* gx, PCADDR pc, unsigned insn, int optimized) fprintf(f, " tgx_syscall_data d = { 0x%08x, gr0, gr1, gr2, gr3 };\n", (unsigned) pc); fprintf(f, " (*(callbacks->syscall))(info, &d);\n"); fprintf(f, " gr2 = d.errcode;\n"); - fprintf(f, " gr1 = d.result;\n"); - fprintf(f, " gr0 = d.result2;\n"); + fprintf(f, " gr0 = d.result;\n"); + fprintf(f, " gr1 = d.result2;\n"); fprintf(f, " }\n"); } else if (r2 == 1) /* gdb breakpoint */ -- 2.30.2