2009-11-25 03:22:45 +08:00
|
|
|
/* main.c --- main function for stand-alone RX simulator.
|
|
|
|
|
2015-01-01 17:32:14 +08:00
|
|
|
Copyright (C) 2005-2015 Free Software Foundation, Inc.
|
2009-11-25 03:22:45 +08:00
|
|
|
Contributed by Red Hat, Inc.
|
|
|
|
|
|
|
|
This file is part of the GNU simulators.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
|
|
|
|
|
2010-02-14 15:37:11 +08:00
|
|
|
#include "config.h"
|
2009-11-25 03:22:45 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
2010-02-14 15:37:11 +08:00
|
|
|
#ifdef HAVE_STDLIB_H
|
2009-11-25 03:22:45 +08:00
|
|
|
#include <stdlib.h>
|
2010-02-14 15:37:11 +08:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_UNISTD_H
|
2009-11-25 03:22:45 +08:00
|
|
|
#include <unistd.h>
|
2010-02-14 15:37:11 +08:00
|
|
|
#endif
|
2009-11-25 03:22:45 +08:00
|
|
|
#include <assert.h>
|
|
|
|
#include <setjmp.h>
|
|
|
|
#include <signal.h>
|
2010-02-14 15:37:11 +08:00
|
|
|
#ifdef HAVE_GETOPT_H
|
|
|
|
#include <getopt.h>
|
|
|
|
#endif
|
2009-11-25 03:22:45 +08:00
|
|
|
|
|
|
|
#include "bfd.h"
|
|
|
|
|
|
|
|
#include "cpu.h"
|
|
|
|
#include "mem.h"
|
|
|
|
#include "misc.h"
|
|
|
|
#include "load.h"
|
|
|
|
#include "trace.h"
|
|
|
|
#include "err.h"
|
|
|
|
|
|
|
|
static int disassemble = 0;
|
|
|
|
|
|
|
|
/* This must be higher than any other option index. */
|
|
|
|
#define OPT_ACT 400
|
|
|
|
|
|
|
|
#define ACT(E,A) (OPT_ACT + SIM_ERR_##E * SIM_ERRACTION_NUM_ACTIONS + SIM_ERRACTION_##A)
|
|
|
|
|
|
|
|
static struct option sim_options[] =
|
|
|
|
{
|
|
|
|
{ "end-sim-args", 0, NULL, 'E' },
|
|
|
|
{ "exit-null-deref", 0, NULL, ACT(NULL_POINTER_DEREFERENCE,EXIT) },
|
|
|
|
{ "warn-null-deref", 0, NULL, ACT(NULL_POINTER_DEREFERENCE,WARN) },
|
|
|
|
{ "ignore-null-deref", 0, NULL, ACT(NULL_POINTER_DEREFERENCE,IGNORE) },
|
|
|
|
{ "exit-unwritten-pages", 0, NULL, ACT(READ_UNWRITTEN_PAGES,EXIT) },
|
|
|
|
{ "warn-unwritten-pages", 0, NULL, ACT(READ_UNWRITTEN_PAGES,WARN) },
|
|
|
|
{ "ignore-unwritten-pages", 0, NULL, ACT(READ_UNWRITTEN_PAGES,IGNORE) },
|
|
|
|
{ "exit-unwritten-bytes", 0, NULL, ACT(READ_UNWRITTEN_BYTES,EXIT) },
|
|
|
|
{ "warn-unwritten-bytes", 0, NULL, ACT(READ_UNWRITTEN_BYTES,WARN) },
|
|
|
|
{ "ignore-unwritten-bytes", 0, NULL, ACT(READ_UNWRITTEN_BYTES,IGNORE) },
|
|
|
|
{ "exit-corrupt-stack", 0, NULL, ACT(CORRUPT_STACK,EXIT) },
|
|
|
|
{ "warn-corrupt-stack", 0, NULL, ACT(CORRUPT_STACK,WARN) },
|
|
|
|
{ "ignore-corrupt-stack", 0, NULL, ACT(CORRUPT_STACK,IGNORE) },
|
|
|
|
{ 0, 0, 0, 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
done (int exit_code)
|
|
|
|
{
|
|
|
|
if (verbose)
|
|
|
|
{
|
|
|
|
stack_heap_stats ();
|
|
|
|
mem_usage_stats ();
|
|
|
|
/* Only use comma separated numbers when being very verbose.
|
|
|
|
Comma separated numbers are hard to parse in awk scripts. */
|
|
|
|
if (verbose > 1)
|
|
|
|
printf ("insns: %14s\n", comma (rx_cycles));
|
|
|
|
else
|
|
|
|
printf ("insns: %u\n", rx_cycles);
|
2010-07-29 05:58:22 +08:00
|
|
|
|
|
|
|
pipeline_stats ();
|
2009-11-25 03:22:45 +08:00
|
|
|
}
|
|
|
|
exit (exit_code);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char **argv)
|
|
|
|
{
|
|
|
|
int o;
|
|
|
|
int save_trace;
|
|
|
|
bfd *prog;
|
[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.
2010-07-30 02:41:28 +08:00
|
|
|
int rc;
|
2009-11-25 03:22:45 +08:00
|
|
|
|
|
|
|
/* By default, we exit when an execution error occurs. */
|
|
|
|
execution_error_init_standalone ();
|
|
|
|
|
|
|
|
while ((o = getopt_long (argc, argv, "tvdeEwi", sim_options, NULL)) != -1)
|
|
|
|
{
|
|
|
|
if (o == 'E')
|
|
|
|
/* Stop processing the command line. This is so that any remaining
|
|
|
|
words on the command line that look like arguments will be passed
|
|
|
|
on to the program being simulated. */
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (o >= OPT_ACT)
|
|
|
|
{
|
|
|
|
int e, a;
|
|
|
|
|
|
|
|
o -= OPT_ACT;
|
|
|
|
e = o / SIM_ERRACTION_NUM_ACTIONS;
|
|
|
|
a = o % SIM_ERRACTION_NUM_ACTIONS;
|
|
|
|
execution_error_set_action (e, a);
|
|
|
|
}
|
|
|
|
else switch (o)
|
|
|
|
{
|
|
|
|
case 't':
|
|
|
|
trace++;
|
|
|
|
break;
|
|
|
|
case 'v':
|
|
|
|
verbose++;
|
|
|
|
break;
|
|
|
|
case 'd':
|
|
|
|
disassemble++;
|
|
|
|
break;
|
|
|
|
case 'e':
|
|
|
|
execution_error_init_standalone ();
|
|
|
|
break;
|
|
|
|
case 'w':
|
|
|
|
execution_error_warn_all ();
|
|
|
|
break;
|
|
|
|
case 'i':
|
|
|
|
execution_error_ignore_all ();
|
|
|
|
break;
|
|
|
|
case '?':
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
fprintf (stderr,
|
|
|
|
"usage: run [options] program [arguments]\n");
|
|
|
|
fprintf (stderr,
|
|
|
|
"\t-v\t- increase verbosity.\n"
|
|
|
|
"\t-t\t- trace.\n"
|
|
|
|
"\t-d\t- disassemble.\n"
|
|
|
|
"\t-E\t- stop processing sim args\n"
|
|
|
|
"\t-e\t- exit on all execution errors.\n"
|
|
|
|
"\t-w\t- warn (do not exit) on all execution errors.\n"
|
|
|
|
"\t-i\t- ignore all execution errors.\n");
|
|
|
|
for (i=0; sim_options[i].name; i++)
|
|
|
|
fprintf (stderr, "\t--%s\n", sim_options[i].name);
|
|
|
|
exit (1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
prog = bfd_openr (argv[optind], 0);
|
|
|
|
if (!prog)
|
|
|
|
{
|
|
|
|
fprintf (stderr, "Can't read %s\n", argv[optind]);
|
|
|
|
exit (1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!bfd_check_format (prog, bfd_object))
|
|
|
|
{
|
|
|
|
fprintf (stderr, "%s not a rx program\n", argv[optind]);
|
|
|
|
exit (1);
|
|
|
|
}
|
|
|
|
|
|
|
|
init_regs ();
|
|
|
|
|
|
|
|
rx_in_gdb = 0;
|
|
|
|
save_trace = trace;
|
|
|
|
trace = 0;
|
2012-03-03 09:23:45 +08:00
|
|
|
rx_load (prog, NULL);
|
2009-11-25 03:22:45 +08:00
|
|
|
trace = save_trace;
|
|
|
|
|
|
|
|
sim_disasm_init (prog);
|
|
|
|
|
[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.
2010-07-30 02:41:28 +08:00
|
|
|
enable_counting = verbose;
|
2009-11-25 03:22:45 +08:00
|
|
|
|
[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.
2010-07-30 02:41:28 +08:00
|
|
|
rc = setjmp (decode_jmp_buf);
|
2009-11-25 03:22:45 +08:00
|
|
|
|
[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.
2010-07-30 02:41:28 +08:00
|
|
|
if (rc == 0)
|
|
|
|
{
|
|
|
|
if (!trace && !disassemble)
|
2009-11-25 03:22:45 +08:00
|
|
|
{
|
[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.
2010-07-30 02:41:28 +08:00
|
|
|
/* This will longjmp to the above if an exception
|
|
|
|
happens. */
|
|
|
|
for (;;)
|
|
|
|
decode_opcode ();
|
2009-11-25 03:22:45 +08:00
|
|
|
}
|
|
|
|
else
|
[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.
2010-07-30 02:41:28 +08:00
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (trace)
|
|
|
|
printf ("\n");
|
2009-11-25 03:22:45 +08:00
|
|
|
|
[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.
2010-07-30 02:41:28 +08:00
|
|
|
if (disassemble)
|
|
|
|
{
|
|
|
|
enable_counting = 0;
|
|
|
|
sim_disasm_one ();
|
|
|
|
enable_counting = verbose;
|
|
|
|
}
|
|
|
|
|
|
|
|
rc = decode_opcode ();
|
|
|
|
|
|
|
|
if (trace)
|
|
|
|
trace_register_changes ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (RX_HIT_BREAK (rc))
|
|
|
|
done (1);
|
|
|
|
else if (RX_EXITED (rc))
|
|
|
|
done (RX_EXIT_STATUS (rc));
|
|
|
|
else if (RX_STOPPED (rc))
|
|
|
|
{
|
|
|
|
if (verbose)
|
|
|
|
printf("Stopped on signal %d\n", RX_STOP_SIG (rc));
|
|
|
|
exit(1);
|
2009-11-25 03:22:45 +08:00
|
|
|
}
|
[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.
2010-07-30 02:41:28 +08:00
|
|
|
done (0);
|
|
|
|
exit (0);
|
2009-11-25 03:22:45 +08:00
|
|
|
}
|