From f9c7014e9c1c8ac8b39b1819a6510d0a2ba90e13 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Thu, 29 Jul 2010 18:41:28 +0000 Subject: [include/opcode] * rx.h (RX_Operand_Type): Add TwoReg. (RX_Opcode_ID): Remove ediv and ediv2. [opcodes] * rx-decode.opc (SRR): New. (rx_decode_opcode): Use it for movbi and movbir. Decode NOP2 (mov r0,r0) and NOP3 (max r0,r0) special cases. * rx-decode.c: Regenerate. [sim/rx] * rx.c (decode_cache_base): New. (id_names): Remove ediv and edivu. (optype_names): Add TwoReg. (maybe_get_mem_page): New. (rx_get_byte): Call it. (get_op): Add TwoReg support. (put_op): Likewise. (PD, PS, PS2, GD, GS, GS2, DSZ, SSZ, S2SZ, US1, US2, OM): "opcode" is a pointer now. (DO_RETURN): New. We use longjmp to return an exception result. (decode_opcode): Make opcode a pointer to the decode cache. Save decoded opcode information and re-use. Call DO_RETURN instead of return throughout. Remove ediv and edivu. * mem.c (ptdc): New. Adds decode cache. (rx_mem_ptr): Support it. (rx_mem_decode_cache): New. * mem.h (enum mem_ptr_action): add MPA_DECODE_CACHE. (rx_mem_decode_cache): Declare. * gdb-if.c (sim_resume): Add decode_opcode's setjmp logic here... * main.c (main): ...and here. Use a fast loop if neither trace nor disassemble is given. * cpu.h (RX_MAKE_STEPPED, RX_MAKE_HIT_BREAK, RX_MAKE_EXITED, RX_MAKE_STOPPED, RX_EXITED, RX_STOPPED): Adjust so that 0 is not a valid code for anything. --- sim/rx/gdb-if.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'sim/rx/gdb-if.c') diff --git a/sim/rx/gdb-if.c b/sim/rx/gdb-if.c index 1f6fe95..1fce257 100644 --- a/sim/rx/gdb-if.c +++ b/sim/rx/gdb-if.c @@ -733,6 +733,8 @@ handle_step (int rc) void sim_resume (SIM_DESC sd, int step, int sig_to_deliver) { + int rc; + check_desc (sd); if (sig_to_deliver != 0) @@ -745,7 +747,12 @@ sim_resume (SIM_DESC sd, int step, int sig_to_deliver) execution_error_clear_last_error (); if (step) - handle_step (decode_opcode ()); + { + rc = setjmp (decode_jmp_buf); + if (rc == 0) + rc = decode_opcode (); + handle_step (rc); + } else { /* We don't clear 'stop' here, because then we would miss @@ -762,7 +769,9 @@ sim_resume (SIM_DESC sd, int step, int sig_to_deliver) break; } - int rc = decode_opcode (); + rc = setjmp (decode_jmp_buf); + if (rc == 0) + rc = decode_opcode (); if (execution_error_get_last_error () != SIM_ERR_NONE) { -- cgit v1.1