aboutsummaryrefslogtreecommitdiff
path: root/sim/d10v/interp.c
AgeCommit message (Collapse)AuthorFilesLines
2021-01-11sim: clean up C11 header includesMike Frysinger1-9/+0
Since we require C11 now, we can assume many headers exist, and clean up all of the conditional includes. It's not like any of this code actually accounted for the headers not existing, just whether we could include them. The strings.h cleanup is a little nuanced: it isn't in C11, but every use of it in the codebase will include strings.h only if string.h doesn't exist. Since we now assume the C11 string.h exists, we'll never include strings.h, so we can delete it.
2021-01-09sim: cr16/d10v: move storage out of headerMike Frysinger1-0/+2
These ports declare their State variable in a header and then include multiple times. This causes linker errors with newer gcc due to the change in -fno-common behavior. Move the storage to a C file so we only have one instance of it in the final program.
2016-01-06sim: sim_{create_inferior,open,parse_args}: constify argv/env slightlyMike Frysinger1-2/+4
2016-01-03 Mike Frysinger <vapier@gentoo.org> * sim-options.c (sim_parse_args): Mark argv array const. * sim-options.h (sim_parse_args): Likewise.
2016-01-03sim: parse_args: display getopt error ourselvesMike Frysinger1-3/+1
Fix a long standing todo where we let getopt write directly to stderr when an invalid option is passed. Use the sim io funcs instead as they go through the filtered callbacks that gdb wants.
2015-12-30sim: arm/d10v/h8300/m68hc11/microblaze/mips/mn10300/moxie/sh/v850: convert ↵Mike Frysinger1-6/+11
to common sim_{fetch,store}_register
2015-11-15sim: cr16/d10v: drop redundant call to sim_create_inferiorMike Frysinger1-1/+0
With the conversion to the nrun frontend, this call should no longer be necessary. It also actively crashes when trying to use the sd state.
2015-11-15sim: d10v: drop global callback stateMike Frysinger1-63/+59
Now that we have access to the sim state in all the right places, use existing sim helpers in place of d10v_callback directly.
2015-11-15sim: d10v: convert to common sim engine logicMike Frysinger1-118/+59
Now that we have access to the sim state everywhere, we can convert to the common engine logic for overall processing. This frees us up from tracking exception state ourselves.
2015-11-15sim: d10v: push down sd/cpu varsMike Frysinger1-82/+101
By itself, this commit doesn't really change anything. It lays the groundwork for using the cpu state in follow up commits, both for engine state and for cpu state. Splitting things up this way so it is easier to see how things have changed.
2015-11-15sim: sim-close: unify sim_close logicMike Frysinger1-7/+0
Other than the nice advantage of all sims having to declare one fewer common function, this also fixes leakage in pretty much every sim. Many were not freeing any resources, and a few were inconsistent as to the ones they did. Now we have a single module that takes care of all the logic for us. Most of the non-cgen based ones could be deleted outright. The cgen ones required adding a callback to the arch-specific cleanup func. The few that still have close callbacks are to manage their internal state. We do not convert erc32, m32c, ppc, rl78, or rx as they do not use the common sim core.
2015-11-10sim: cr16/d10v: localize translation funcsMike Frysinger1-3/+3
These functions are only used in the interp module, so there's no point in exporting them and declaring them in the external sim interface.
2015-04-17sim: arm/cr16/d10v/h8300/microblaze/sh: fill out sim-cpu pc fetch/store helpersMike Frysinger1-0/+22
This makes the common sim-cpu logic work.
2015-04-02sim: d10v: fix signal updatesMike Frysinger1-8/+5
Way back in aba6488e0b73756f31f154d12a228baa82a68d8a, a bunch of signal defines were changed to TARGET_SIGNAL_xxx. For d10v, the transition was incomplete which lead to sim_stop_reason using the new set but sim_resume still using the old set. Which meant in some cases, the sim would never actually stop. Convert all the remaining SIGxxx defines in here to TARGET_SIGNAL_xxx. This has the nice side effect of fixing the testsuite.
2015-04-01sim: run: punt!Mike Frysinger1-2/+0
Now that all targets have been converted to nrun, we can finally punt this old inconsistent interface. A few stray references to the old run were sprinkled about; clean them up in the process. We leave behind the run(1) man page mostly so that we get it updated for the new nrun interface.
2015-03-30sim: d10v: convert to nrunMike Frysinger1-115/+68
A lot of cpu state is stored in global variables, as is memory handling. The sim_size support needs unwinding at some point. But at least this is an improvement on the status quo.
2015-03-30sim: d10v: delete NEED_UI_LOOP_HOOK handlingMike Frysinger1-19/+0
This hook is used only when linked into gdb, and d10v doesn't have a gdb port anymore. Punt it.
2015-03-30sim: d10v: clean up misc warningsMike Frysinger1-81/+27
2015-03-30sim: d10v: use common configure optionsMike Frysinger1-0/+8
In preparation for converting to nrun, call the common functions that are needed. This doesn't produce any new warnings, and the generated code should be the same.
2014-03-10sim: constify arg to sim_do_commandMike Frysinger1-1/+1
It is rare for people to want to modify the cmd arg. In general, they really shouldn't be, but a few still do. For those who misbehave, dupe the string locally so they can bang on it.
2014-03-05sim: constify prog_nameMike Frysinger1-1/+1
There's no need for the prog_name handed down to the core to be mutable, so add const markings to it and all the related funcs.
2014-01-07remove PARAMS from simTom Tromey1-10/+10
This removes the last uses of PARAMS from sim. 2014-01-06 Tom Tromey <tromey@redhat.com> * README-HACKING: Don't use PARAMS. * arm/wrapper.c: Don't use PARAMS. * bfin/sim-main.h: Don't use PARAMS. * common/callback.c: Don't use PARAMS. * common/cgen-trace.c: Don't use PARAMS. * common/run-sim.h: Don't use PARAMS. * common/run.c: Don't use PARAMS. * common/sim-base.h: Don't use PARAMS. * common/sim-load.c: Don't use PARAMS. * common/sim-options.h: Don't use PARAMS. * common/sim-trace.c: Don't use PARAMS. * common/sim-trace.h: Don't use PARAMS. * common/sim-utils.h: Don't use PARAMS. * cr16/cr16_sim.h: Don't use PARAMS. * cr16/gencode.c: Don't use PARAMS. * cr16/interp.c: Don't use PARAMS. * cr16/simops.c: Don't use PARAMS. * d10v/d10v_sim.h: Don't use PARAMS. * d10v/gencode.c: Don't use PARAMS. * d10v/interp.c: Don't use PARAMS. * d10v/simops.c: Don't use PARAMS. * erc32/erc32.c: Don't use PARAMS. * erc32/exec.c: Don't use PARAMS. * erc32/float.c: Don't use PARAMS. * erc32/func.c: Don't use PARAMS. * erc32/sis.c: Don't use PARAMS. * erc32/sis.h: Don't use PARAMS. * mips/interp.c: Don't use PARAMS. * mips/sim-main.h: Don't use PARAMS. * sh/interp.c: Don't use PARAMS. * v850/sim-main.h: Don't use PARAMS. * v850/v850_sim.h: Don't use PARAMS.
2012-06-19include "config.h" instead of BFD's sysdep.h in d10v/interp.cJoel Brobecker1-1/+13
The change of include file introduces some new warnings about functions being used without a prototype. So a few more system includes have been added to compensate for that. sim/d10v/ChangeLog: * interp.c: #include "config.h" instead of "sysdep.h". Add conditional include of string.h or strings.h, as well as conditional include of stdlib.h.
2012-05-24gdb/Pedro Alves1-2/+2
2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. gdb/gdbserver/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. include/gdb/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 * gdb/signals.def: Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/arm/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/avr/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/common/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/cr16/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/d10v/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/erc32/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/m32c/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/ppc/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/rl78/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. sim/rx/ 2012-05-24 Pedro Alves <palves@redhat.com> PR gdb/7205 Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
2010-04-14sim: constify sim_write source buffer (part 2)Mike Frysinger1-1/+1
As pointed out by Sandra Loosemore, a bunch of targets define sim_write themselves instead of using the common/ code. So constify them too. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2006-04-18* interp.c (sim_stop_reason): Fix typo.Nick Clifton1-1/+1
2005-11-28 * remote-sim.c (gdbsim_wait): Pass target signal numbers toMark Mitchell1-6/+3
sim_resume. Expect target signal numbers from sim_stop_reason. * wrapper.c (gdb/signals.h): Include it. (SIGTRAP): Don't define. (SIGBUS): Likewise. (sim_stop_reason): Use TARGET_SIGNAL_* instead of SIG*. * sim-reason.c (sim_stop_reason): Use sim_signal_to_target, not sim_signal_to_host. * sim-signal.c (sim_signal_to_host): Fix typo. (sim_signal_to_target): New function. * interp.c (gdb/signals.h): Include it. (sim_stop_reason): Use TARGET_SIGNAL_*. * interf.c: (gdb/signals.h): Include it. (sim_stop_reason): Use TARGET_SIGNAL_*. * sim_calls.c (gdb/signals.h): Include it. (sim_stop_reason): Use TARGET_SIGNAL_*. * psim.c (cntrl_c_simulation): Use TARGET_SIGNAL_*.
2004-06-29Index: mn10200/ChangeLogAndrew Cagney1-3/+3
2004-06-28 Andrew Cagney <cagney@gnu.org> * interp.c: Rename ui_loop_hook to deprecated_ui_loop_hook. Index: d10v/ChangeLog 2004-06-28 Andrew Cagney <cagney@gnu.org> * interp.c (sim_resume): Rename ui_loop_hook to deprecated_ui_loop_hook. Index: arm/ChangeLog 2004-06-28 Andrew Cagney <cagney@gnu.org> * armemu.c: Rename ui_loop_hook to deprecated_ui_loop_hook. Index: common/ChangeLog 2004-06-28 Andrew Cagney <cagney@gnu.org> * run.c: Rename ui_loop_hook to deprecated_ui_loop_hook.
2003-06-222003-06-22 Andrew Cagney <cagney@redhat.com>Andrew Cagney1-36/+26
* interp.c (xfer_mem): Simplify. Only do a single partial transfer. Problem reported by Tom Rix.
2003-05-07Index: gdb/ChangeLogAndrew Cagney1-18/+24
2003-05-07 Andrew Cagney <cagney@redhat.com> * d10v-tdep.c (remote_d10v_translate_xfer_address): Add "regcache". (d10v_print_registers_info): Update. (d10v_dmap_register, d10v_imap_register): Delete functions. (struct gdbarch_tdep): Add "regcache" parameter to "dmap_register" and "imap_register". (d10v_ts2_dmap_register, d10v_ts2_imap_register): Add "regcache". (d10v_ts3_dmap_register, d10v_ts3_imap_register): Add "regcache". * arch-utils.c (generic_remote_translate_xfer_address): Add "regcache" and "gdbarch" parameters. * gdbarch.sh (REMOTE_TRANSLATE_XFER_ADDRESS): Add "regcache" parameter. Change class to multi-arch. * gdbarch.h, gdbarch.c: Re-generate. * remote.c (remote_xfer_memory): Use gdbarch_remote_translate_xfer_address. Index: include/gdb/ChangeLog 2003-05-07 Andrew Cagney <cagney@redhat.com> * sim-d10v.h (sim_d10v_translate_addr): Add regcache parameter. (sim_d10v_translate_imap_addr): Add regcache parameter. (sim_d10v_translate_dmap_addr): Ditto. Index: sim/d10v/ChangeLog 2003-05-07 Andrew Cagney <cagney@redhat.com> * interp.c (sim_d10v_translate_addr): Add "regcache" parameter. (sim_d10v_translate_imap_addr): Ditto. (sim_d10v_translate_dmap_addr): Ditto. (xfer_mem): Pass NULL regcache to sim_d10v_translate_addr. (dmem_addr): Pass NULL regcache to sim_d10v_translate_dmap_addr. (dmap_register, imap_register): Add "regcache" parameter. (imem_addr): Pass NULL regcache to sim_d10v_translate_imap_addr. (sim_fetch_register): Pass NULL regcache to imap_register and dmap_register.
2003-02-27Index: arm/ChangeLogAndrew Cagney1-2/+2
2003-02-27 Andrew Cagney <cagney@redhat.com> * wrapper.c (sim_create_inferior, sim_open): Rename _bfd to bfd. Index: common/ChangeLog 2003-02-27 Andrew Cagney <cagney@redhat.com> * sim-utils.h (sim_analyze_program, sim_load_file): Rename _bfd to bfd. * sim-hload.c (sim_load), sim-base.h (sim_state_base): Ditto. * nrun.c (main): Ditto. Index: d10v/ChangeLog 2003-02-27 Andrew Cagney <cagney@redhat.com> * interp.c (sim_open, sim_create_inferior): Rename _bfd to bfd. Index: erc32/ChangeLog 2003-02-27 Andrew Cagney <cagney@redhat.com> * interf.c (sim_open, sim_create_inferior): Rename _bfd to bfd. Index: h8300/ChangeLog 2003-02-27 Andrew Cagney <cagney@redhat.com> * compile.c (sim_open, sim_create_inferior): Rename _bfd to bfd. Index: h8500/ChangeLog 2003-02-27 Andrew Cagney <cagney@redhat.com> * compile.c (sim_open, sim_create_inferior): Rename _bfd to bfd. Index: i960/ChangeLog 2003-02-27 Andrew Cagney <cagney@redhat.com> * sim-if.c (sim_open, sim_create_inferior): Rename _bfd to bfd. Index: m32r/ChangeLog 2003-02-27 Andrew Cagney <cagney@redhat.com> * sim-if.c (sim_open, sim_create_inferior): Rename _bfd to bfd. Index: m68hc11/ChangeLog 2003-02-27 Andrew Cagney <cagney@redhat.com> * interp.c (sim_prepare_for_program, sim_open) (sim_create_inferior): Rename _bfd to bfd. Index: mcore/ChangeLog 2003-02-27 Andrew Cagney <cagney@redhat.com> * interp.c (sim_open, sim_create_inferior): Rename _bfd to bfd. Index: mips/ChangeLog 2003-02-27 Andrew Cagney <cagney@redhat.com> * interp.c (sim_open): (sim_create_inferior): Index: mn10200/ChangeLog 2003-02-27 Andrew Cagney <cagney@redhat.com> * interp.c (sim_open, sim_create_inferior): Rename _bfd to bfd. Index: mn10300/ChangeLog 2003-02-27 Andrew Cagney <cagney@redhat.com> * interp.c (sim_open, sim_create_inferior, sim_open) (sim_create_inferior): Rename _bfd to bfd. Index: ppc/ChangeLog 2003-02-27 Andrew Cagney <cagney@redhat.com> * sim_calls.c (sim_open, sim_create_inferior): Rename _bfd to bfd. Index: sh/ChangeLog 2003-02-27 Andrew Cagney <cagney@redhat.com> * interp.c (init_dsp, sim_open, sim_create_inferior): Rename _bfd to bfd. Index: v850/ChangeLog 2003-02-27 Andrew Cagney <cagney@redhat.com> * interp.c (sim_open, sim_create_inferior): Rename _bfd to bfd. Index: z8k/ChangeLog 2003-02-27 Andrew Cagney <cagney@redhat.com> * iface.c (sim_open, sim_create_inferior): Rename _bfd to bfd.
2002-06-15Fix for transfers across segments.Tom Rix1-2/+3
2002-06-09Move include/callback.h and include/remote-sim.h to include/gdb/.Andrew Cagney1-2/+2
Update accordingly.
2002-06-08Fix name of enum used in cast (sim_fetch_register, sim_store_register).Andrew Cagney1-2/+2
2002-06-01Fill-out d10v enum so that there are no ``=''.Andrew Cagney1-56/+112
2002-05-282002-05-28 Elena Zannoni <ezannoni@redhat.com>Elena Zannoni1-0/+8
* interp.c (sim_create_inferior): Add comment. From Alan Matsuoka <alanm@redhat.com>: From 2001-04-27 Jason Eckhardt <jle@cygnus.com>: * simops.c (OP_4400): Output "mvf0f" instead of "mf0f". (OP_4401): Output "mvf0t" instead of "mf0t". (OP_460B): Do not output a flag register. (OP_4609): Do not output a flag register.
2002-05-24* sim-d10v.h: Delete file. Moved to include/gdb/.Andrew Cagney1-1/+1
* sim-d10v.h: New file. Moved from include/sim-d10v.h. * Makefile.in (INCLUDE): Add "gdb/sim-d10v.h". * interp.c: Include "gdb/sim-d10v.h" instead of "sim-d10v.h". * d10v-tdep.c: Include "gdb/sim-d10v.h" instead of "sim-d10v.h". * Makefile.in (sim_d10v_h): Update definition.
2001-08-02Removed a section of code that didn't do anything, but left values inJohn R. Moore1-19/+0
memory. This was labeled as a hack to set r0/r1 with argc/argv.
2000-05-03Add missing ChangeLog.Andrew Cagney1-1/+2
Sync with mitsu's version.
2000-04-18Add support for SIGILL (reserved-instruction-exception).Andrew Cagney1-2/+7
2000-02-22When SIM_HAVE_ENVIRONMENT: use sim_set_trace() to enable tracingAndrew Cagney1-10/+2
instead of sim_trace() to run the program; include support for ``-o'' option (operating environment); when a signal occurs, only continue execution when operating environment mode. Update d10v.
2000-02-09Report SIGBUS and halt simulation when ld/st detect a misaligned address.Andrew Cagney1-2/+35
2000-01-06import gdb-2000-01-05 snapshotJason Molenda1-0/+1
1999-11-17import gdb-1999-11-16 snapshotJason Molenda1-288/+557
1999-09-13import gdb-1999-09-13 snapshotJason Molenda1-20/+75
1999-04-26import gdb-19990422 snapshotStan Shebs1-0/+18
1999-04-16Initial creation of sourceware repositorygdb-4_18-branchpointStan Shebs1-0/+1086
1999-04-16Initial creation of sourceware repositoryStan Shebs1-1069/+0
1998-02-16Implement "dbt" and "rtd" instructions.Andrew Cagney1-15/+25
Import fixes to dmap_addr() from mitsu branch.
1998-02-10D10v memory map changed. Update.Andrew Cagney1-136/+173
Initialize IMAP/DMAP registers to hardware reset value.
1998-01-22 * interp.c (UMEM_SEGMENTS): New define, set to 128.Fred Fish1-54/+120
(sim_size): Use UMEM_SEGMENTS rather than hardwired constant. (sim_close): Reset prog_bfd to NULL after closing it. Also reset prog_bfd_was_opened_p after closing prog_bfd. (sim_load): Reset prog_bfd_was_opened_p after closing prog_bfd. (sim_create_inferior): Get start address from abfd not prog_bfd. (xfer_mem): Do bounds checking on addresses and return zero length read/write on bad addresses, rather than aborting. Prepare to be able to handle xfers that cross segment boundaries, but not yet implemented. Only emit debug message when d10v_debug is set as well as DEBUG being defined.