From: Michael Meissner Date: Sat, 14 Sep 1996 02:36:40 +0000 (+0000) Subject: For unknown traps, print contents of registers and continue execution X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=19d44375ff05bb2c50595ffcd955af61bbabd164;p=binutils-gdb.git For unknown traps, print contents of registers and continue execution --- diff --git a/sim/d10v/ChangeLog b/sim/d10v/ChangeLog index 25d1b1bf448..bd1e1ad8fe1 100644 --- a/sim/d10v/ChangeLog +++ b/sim/d10v/ChangeLog @@ -1,3 +1,8 @@ +Fri Sep 13 22:35:19 1996 Michael Meissner + + * simops.c (OP_5F00): Use unknown traps to print all GPRs, + accumulators, PC, and F0/F1/C flags. + Thu Sep 12 12:50:11 1996 Mark Alexander * simops.c (OP_5F00): Fix problems with system calls. diff --git a/sim/d10v/simops.c b/sim/d10v/simops.c index 5b5d70ff807..3a889a189e1 100644 --- a/sim/d10v/simops.c +++ b/sim/d10v/simops.c @@ -2425,8 +2425,38 @@ OP_5F00 () switch (OP[0]) { default: +#if 0 (*d10v_callback->printf_filtered) (d10v_callback, "Unknown trap code %d\n", OP[0]); State.exception = SIGILL; +#else + /* Use any other traps for batch debugging. */ + { + int i; + static int first_time = 1; + + if (first_time) + { + first_time = 0; + (*d10v_callback->printf_filtered) (d10v_callback, "Trap # PC "); + for (i = 0; i < 16; i++) + (*d10v_callback->printf_filtered) (d10v_callback, " %sr%d", (i > 9) ? "" : " ", i); + (*d10v_callback->printf_filtered) (d10v_callback, " a0 a1 f0 f1 c\n"); + } + + (*d10v_callback->printf_filtered) (d10v_callback, "Trap %2d 0x%.4x:", (int)OP[0], (int)PC); + + for (i = 0; i < 16; i++) + (*d10v_callback->printf_filtered) (d10v_callback, " %.4x", (int) State.regs[i]); + + for (i = 0; i < 2; i++) + (*d10v_callback->printf_filtered) (d10v_callback, " %.2x%.8lx", + ((int)(State.a[OP[i]] >> 32) & 0xff), + ((unsigned long)State.a[OP[i]]) & 0xffffffff); + + (*d10v_callback->printf_filtered) (d10v_callback, " %d %d %d\n", + State.F0 != 0, State.F1 != 0, State.C != 0); + break; +#endif case 0: /* Trap 0 is used for simulating low-level I/O */ @@ -2588,6 +2618,7 @@ OP_5F00 () /* Trap 3 writes a character */ putchar (State.regs[2]); break; + } } }