diff options
author | Michael Meissner <gnu@the-meissners.org> | 1996-09-14 02:36:40 +0000 |
---|---|---|
committer | Michael Meissner <gnu@the-meissners.org> | 1996-09-14 02:36:40 +0000 |
commit | 19d44375ff05bb2c50595ffcd955af61bbabd164 (patch) | |
tree | 78f5c4e6aa1b4172b4ba6a28a59fe659d6033990 | |
parent | c03e48e87f6ab875e622918ebc6450cdc1b1119f (diff) | |
download | gdb-19d44375ff05bb2c50595ffcd955af61bbabd164.zip gdb-19d44375ff05bb2c50595ffcd955af61bbabd164.tar.gz gdb-19d44375ff05bb2c50595ffcd955af61bbabd164.tar.bz2 |
For unknown traps, print contents of registers and continue execution
-rw-r--r-- | sim/d10v/ChangeLog | 5 | ||||
-rw-r--r-- | sim/d10v/simops.c | 31 |
2 files changed, 36 insertions, 0 deletions
diff --git a/sim/d10v/ChangeLog b/sim/d10v/ChangeLog index 25d1b1b..bd1e1ad 100644 --- a/sim/d10v/ChangeLog +++ b/sim/d10v/ChangeLog @@ -1,3 +1,8 @@ +Fri Sep 13 22:35:19 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * 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 <marka@cygnus.com> * simops.c (OP_5F00): Fix problems with system calls. diff --git a/sim/d10v/simops.c b/sim/d10v/simops.c index 5b5d70f..3a889a1 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; + } } } |