aboutsummaryrefslogtreecommitdiff
path: root/sim/common
AgeCommit message (Collapse)AuthorFilesLines
2015-04-15sim: unify sim-cpu usageMike Frysinger3-5/+15
Now that all the targets are utilizing CPU_PC_{FETCH,STORE}, and the cpu state is multicore, and the STATE_CPU defines match, we can move it all to the common code.
2015-04-13sim: fix the PKGVERSION defineMike Frysinger3-3/+8
This should be SIM, not GDB.
2015-04-13sim: options: add --version supportMike Frysinger2-0/+18
The old run frontend had a --version option, but the new common sim-options file does not. Restore support for that so we can get version info out of `run` when using the new frontend.
2015-04-13sim: switch to gdb version scriptMike Frysinger3-40/+8
Since the local create-version.sh already points directly into the gdb source tree, we might as well use the gdb script directly too.
2015-04-06sim: move sim-engine.o/sim-hrw.o to the common listMike Frysinger2-0/+6
This makes these two objects available to all sims by default.
2015-04-02Regenerate configure in simH.J. Lu1-2/+2
* arm/configure: Regenerated. * avr/configure: Likewise. * bfin/configure: Likewise. * common/configure: Likewise. * cr16/configure: Likewise. * cris/configure: Likewise. * d10v/configure: Likewise. * erc32/configure: Likewise. * frv/configure: Likewise. * ft32/configure: Likewise. * h8300/configure: Likewise. * igen/configure: Likewise. * iq2000/configure: Likewise. * lm32/configure: Likewise. * m32c/configure: Likewise. * m32r/configure: Likewise. * m68hc11/configure: Likewise. * mcore/configure: Likewise. * microblaze/configure: Likewise. * mips/configure: Likewise. * mn10300/configure: Likewise. * moxie/configure: Likewise. * msp430/configure: Likewise. * ppc/configure: Likewise. * rl78/configure: Likewise. * rx/configure: Likewise. * sh/configure: Likewise. * sh64/configure: Likewise. * v850/configure: Likewise.
2015-04-01Fix sim buildH.J. Lu1-4/+3
* common/Make-common.in (CSEARCH): Remove $(ZLIBINC). (BFD_LIB): Remove $(ZLIB). (CONFIG_LIBS): Add $(ZLIB). * ppc/Makefile.in (ZLIBINC): Removed. (INCLUDES): Remove $(ZLIBINC). (BFD_LIB): Remove $(ZLIB).
2015-04-01Regenerate configure in simH.J. Lu1-4/+6
* arm/configure: Regenerated. * avr/configure: Likewise. * bfin/configure: Likewise. * common/configure: Likewise. * cr16/configure: Likewise. * cris/configure: Likewise. * d10v/configure: Likewise. * erc32/configure: Likewise. * frv/configure: Likewise. * ft32/configure: Likewise. * h8300/configure: Likewise. * igen/configure: Likewise. * iq2000/configure: Likewise. * lm32/configure: Likewise. * m32c/configure: Likewise. * m32r/configure: Likewise. * m68hc11/configure: Likewise. * mcore/configure: Likewise. * microblaze/configure: Likewise. * mips/configure: Likewise. * mn10300/configure: Likewise. * moxie/configure: Likewise. * msp430/configure: Likewise. * ppc/configure: Likewise. * rl78/configure: Likewise. * rx/configure: Likewise. * sh/configure: Likewise. * sh64/configure: Likewise. * v850/configure: Likewise.
2015-04-01sim: run: punt!Mike Frysinger4-457/+5
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-04-01sim: update zlib handlingMike Frysinger4-85/+24
With zlib being mandatory, and the updated m4 configs, we need to regen and use the new settings w/bfd to avoid linkage errors.
2015-03-31common: cgen-mem/cgen-ops: fix extern inline handlingMike Frysinger3-2/+9
With newer versions of gcc (5.x), the extern inline we're using with the cgen-{mem,ops} modules no longer work. Since this code really wants the gnu inline semantics, use that attribute explicitly.
2015-03-29sim: common: sim-arange: fix extern inline handlingMike Frysinger3-9/+21
With newer versions of gcc (5.x), the extern inline we're using with the sim-arange module no longer works. Since this code really wants the gnu inline semantics, use that attribute explicitly. Reported-by: DJ Delorie <dj@redhat.com> Reported-by: Joel Sherrill <joel.sherrill@oarcorp.com>
2015-03-24sim: profile: disconnect from watchpoint coreMike Frysinger2-12/+11
The profile code was using STATE_WATCHPOINTS to get access to the PC, but we already have a standard method for getting the pc, so switch to that. This assumes that sizeof_pc is the same size as sim_cia, but we already assume this in places by way of sim_pc_{get,set}, and this is how it's documented in the sim-base.h API.
2015-03-24sim: erc32/h8300/m68hc11: trim unused functionsMike Frysinger2-1/+6
These funcs are only used with the old run.o, and these sims use nrun.o, so drop these stub funcs.
2015-03-24sim: clean up SIM_HAVE_BIENDIANMike Frysinger2-1/+6
This define only applies when using the old run.o main. Document it as such, and delete it from mips/sh64 since both use nrun.o now.
2015-03-24sim: fix sim-hardware configure optionMike Frysinger2-7/+7
The current default handling for the --enable-sim-hardware option ends up forcing the value to whatever is set as the first argument when calling the macro (by virtue of how autoconf works). Relocate the setup code to the 4th parameter of the AC_ARG_ENABLE macro to fix it. This was caused by the simplification work in 1517bd274290e06af498ef7e49. Reported-by: Hans-Peter Nilsson <hans-peter.nilsson@axis.com>
2015-03-23sim: drop support for requiring hw supportMike Frysinger1-11/+6
Since no sim is using the "always" option to SIM_AC_OPTION_HARDWARE, and we don't want to require hw support to always be enabled, drop the option. This leads to a slight simplification in the macro too as we can collapse the sim_hw_p variable.
2015-03-23sim: dv-sockser: move build to common dirMike Frysinger2-3/+9
If dv-sockser is available, lets add it to the common SIM_HW_OBJS variable so it is always included automatically. Now ports do not have to shoe horn it in directly themselves. It does mean it will be compiled for targets that don't explicitly use it, but that's really what we want anyways.
2015-03-23sim: dv-sockser: add stub funcs when not availableMike Frysinger3-0/+46
This lets ports assume that the dv-sockser API is always available if they want to. This way we don't have to do an abort at configure time and it makes the resulting code a bit simpler.
2015-03-16sim: convert some old prototypesMike Frysinger3-9/+9
2015-03-16sim: rename tconfig.in to tconfig.hMike Frysinger8-27/+18
Rather than manually include tconfig.h when we think we'll need it (which is error prone as it can define symbols we expect from config.h), have it be included directly by config.h. Since we know we have to include that header everywhere already, this will make sure tconfig.h isn't missed. It should also be fine as tconfig.h is supposed to be simple and only set up a few core defines for the target. This allows us to stop symlinking it in place all the time and just use it straight out of the respective source directory.
2015-03-15sim: dv-sockser: push module init prototype downMike Frysinger4-0/+21
Pull out the duplicated dv_sockser_install prototype from the tconfig.in files and put it in the one place it gets used -- sim-module.c. This is still arguably incorrect, but it's better than the status quo where the tconfig.in has to include header files and duplicate the dv-sockser func. The tconfig header is meant to be simple and contain a target defines.
2015-03-14sim: delete unused sim-inline.c ruleMike Frysinger2-9/+5
This dates back to the start of the repo, but has never really been used. The sim-inline.c file has been checked in to the source, and attempts to build it in the build tree leads to a circular dep warning from make. It also doesn't produce a file that is usable -- it can't be compiled. Punt!
2015-03-14sim: make nrun the default run programMike Frysinger3-1/+14
We want people to stop using the run.c frontend, but it's hard to notice when it's still set as the default. Lets flip things so nrun.c is the default, and users of run.c will get an error by default. We turn that error into a warning for existing sims so we don't break them -- this is mostly meant for people starting new ports.
2015-03-14sim: move sim-io.h to sim-assert.hMike Frysinger3-1/+8
Since sim-endian.c doesn't actually use sim_io funcs, it's weird to include the sim-io.h header here. It's doing so only for the assert header. So lets relocate the include to the right place.
2015-02-19sim: drop unused sim_kill functionMike Frysinger2-9/+4
This has been deprecated for a long time and no one calls it.
2015-02-20sim: ChangeLog: Correct the related items position and format.Chen Gang1-1/+6
Move several items from sim/ChangeLog to sim/*/ChangeLog. Also remove the incorrect white space in sim/common/ChangeLog.
2015-02-14sim/common/gentmap.c: Include "string.h".Chen Gang2-0/+5
The related warnings: gcc ../../../binutils-gdb/sim/mcore/../common/gentmap.c -o gentmap -g -O -I. -I../../../binutils-gdb/sim/mcore -I../common -I../../../binutils-gdb/sim/mcore/../common -I../../include -I../../../binutils-gdb/sim/mcore/../../include -I../../bfd -I../../../binutils-gdb/sim/mcore/../../bfd -I../../opcodes -I../../../binutils-gdb/sim/mcore/../../opcodes ../../../binutils-gdb/sim/mcore/../common/gentmap.c: In function ‘main’: ../../../binutils-gdb/sim/mcore/../common/gentmap.c:119:7: warning: implicit declaration of function ‘strcmp’ [-Wimplicit-function-declaration] if (strcmp (argv[1], "-h") == 0) ^ 2015-02-13 Chen Gang <gang.chen.5i5j@gmail.com> * gentmap.c: Include "string.h".
2015-02-03sim: Call freeargv() when failure occursChen Gang1-1/+4
After successfully call buildargv(), the code need to be sure of calling freeargv() in any cases. 2015-02-02 Chen Gang <gang.chen.5i5j@gmail.com> * common/sim-options.c (sim_args_command): Call freeargv() when failure occurs.
2015-01-07Regenerate sim/common/aclocal.m4 and sim/common/configure...Joel Brobecker3-11/+14
... using automake 1.11.1, which is the version we're currently using throughout, instead of 1.11.3. This should be a no-op in practice, but will help automake/aclocal version-related differences to cloud real changes being made. sim/common/ChangeLog: * aclocal.m4, configure: Regenerate using automake 1.11.1.
2015-01-01Update year range in copyright notice of all files owned by the GDB project.Joel Brobecker113-113/+113
gdb/ChangeLog: Update year range in copyright notice of all files.
2014-12-03callback.h:struct host_callback_struct compilation error on Windows hosts.Joel Brobecker3-5/+13
On Windows, a recent gnulib update imported the lstat module, and this caused a remote-sim.c build failure in struct host_callback_struct: In file included from /[...]/gdb/remote-sim.c:34:0: /[...]/gdb/../include/gdb/callback.h:93:9: error: duplicate member '_stati64' int (*lstat) (host_callback *, const char *, struct stat *); ^ What happens it that gnulib's stat.h makes the following defines: /* Large File Support on native Windows. */ #if 1 # define stat _stati64 #endif and then: #if 1 # if ! 0 /* mingw does not support symlinks, therefore it does not have lstat. But without links, stat does just fine. */ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define lstat stat # endif So, the following fields in struct host_callback_struct... int (*stat) (host_callback *, const char *, struct stat *); int (*fstat) (host_callback *, int, struct stat *); int (*lstat) (host_callback *, const char *, struct stat *); ... get translated to... int (*_stati64) (host_callback *, const char *, struct _stati64 *); int (*_fstati64) (host_callback *, int, struct _stati64 *); int (*_stati64) (host_callback *, const char *, struct _stati64 *); ... which causes two fields to have the same name. This patch fixes the issue by renaming the stat-related fields by adding a "to_" prefix, similar to what is done in GDB's target_ops vector. include/gdb/ChangeLog: * callback.h (struct host_callback_struct) <to_stat>: Renamed from "stat". <to_fstat>: Renamed from "fstat". <to_lstat>: Renamed from "lstat". sim/common/ChangeLog: * sim-io.c (sim_io_stat, sim_io_fstat): Adjust calls to "stat" and "fstat" callbacks by calls to "to_stat" and "to_fstat" (resp) callbacks following renaming in callback.h. * syscall.c (cb_syscall): Likewise. Adjust calls to "lstat" callback by call to "to_lstat" callback sim/cris/ChangeLog: * traps.c (cris_break_13_handler): Adjust call to "fstat" callback by call to "to_fstat" following renaming in callback.h. sim/h8300/ChangeLog: * compile.c (sim_resume): Adjust calls to "stat" and "fstat" callbacks by calls to "to_stat" and "to_fstat" (resp) callbacks following renaming in callback.h.
2014-08-28Shadow SIM's debug_printf functionGary Benson2-0/+7
GDB and SIM both have functions called "debug_printf", which conflicts at link time. This commit shadows SIM's debug_printf with a macro so that SIM's symbol ends up being called "sim_debug_printf". sim/common/ChangeLog: * sim-trace.h (debug_printf): New define.
2014-08-19Fix --diable-shared --enable-plugins build breakageAlan Modra2-2/+64
Directories that don't use libtool need to add -ldl (on most *nix hosts) to provide dlopen for libbfd. config/ * plugins.m4 (AC_PLUGINS): If plugins are enabled, add -ldl to LIBS via AC_SEARCH_LIBS. gdb/ * acinclude.m4 (GDB_AC_CHECK_BFD): Don't add -ldl. * config.in: Regenerate. sim/ppc/ * configure.ac: Invoke AC_PLUGINS. * config.in: Regenerate. and regen lots of configure files.
2014-08-15Regenerate sim configury.Roland McGrath3-9/+52
2014-03-10sim: constify arg to sim_do_commandMike Frysinger4-3/+9
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 Frysinger5-5/+13
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-03-04sim: convert old style prototypesMike Frysinger6-197/+129
Most of these prototypes have been killed off, but we have a few left in the sim tree. Clean them up so we can enable the -W flag for it.
2014-01-07remove VA_* macros from simTom Tromey3-5/+5
Remove the obsolete VA_* macros from sim. 2014-01-06 Tom Tromey <tromey@redhat.com> * common/cgen-trace.c: Don't use old VA_* macros. * common/sim-load.c (xprintf): Likewise. * common/sim-trace.c (trace_printf, debug_printf): Likewise.
2014-01-07remove PARAMS from simTom Tromey10-212/+212
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.
2014-01-01Update Copyright year range in all files maintained by GDB.Joel Brobecker113-113/+113
2013-10-15 * create-version.sh: Align parameters to match those ofHans-Peter Nilsson3-6/+19
../../gdb/common/create-version.sh. * Make-common.in (srcsim): New variable. (version.c): Adjust call to create-version.sh as per above.
2013-09-23Regenerate sim configure files to pick up support for powerpc64le inAlan Modra2-5/+15
libtool.m4.
2013-09-03sim: mark complete_option_list args const to fix build warningsMike Frysinger2-1/+5
The completion API was updated, but this func missed having its text/word args const.
2013-06-28move version.in from gdb/common back to gdbTom Tromey3-2/+8
This reverts part of the earlier version.in change. It moves version.in back to the gdb directory. This works around the CVS bug we've found. gdb * Makefile.in (version.c): Use version.in, not common/version.in. * common/create-version.sh: Likewise. * common/version.in: Move... * version.in: ...here. gdb/doc * Makefile.in (version.subst): Use version.in, not common/version.in. * gdbint.texinfo (Versions and Branches, Releasing GDB): Likewise. gdb/gdbserver * Makefile.in (version.c): Use version.in, not common/version.in. sim/common * Make-common.in (version.c): Use version.in, not common/version.in. * create-version.sh: Likewise. sim/ppc: * Make-common.in (version.c): Use version.in, not common/version.in.
2013-06-24Adapt sim to new version number & date locations.Joel Brobecker3-6/+42
This change is required now that gdb/version.in has been moved to gdb/common/version.in and now that the date needs to be fetched from bfd/version.h. sim/common/ChangeLog: * create-version.sh: New script. Adapted from gdb/commong/create-version.sh. * Make-common.in (version.c): Update rule dependencies, and re-implement using create-version.sh. sim/ppc/ChangeLog: * Makefile.in (srccom): New variable. (version.c): Update rule dependencies, and re-implement using sim/common/create-version.sh.
2013-06-21 * msp430: New Directory.Nick Clifton3-0/+40
* configure.tgt: Add it. * configure: Regenerate. * gennltvals.sh: Add msp430 support. * nltvals.def: Regenerate. * Makefile.in: New. * aclocal.m4: Generate. * config.in: Generate. * configure.ac: New. * configure: Generate. * msp430-sim.c: New. * msp430-sim.h: New. * sim-main.h: New. * trace.c: New. * trace.h: New.
2013-06-05sim: use AM_MAINTAINER_MODEMike Frysinger4-25/+74
I noticed the sim code is using an old implementation of the maintainer logic. I cut it over to the new macro (like gdb has been doing). In practice, it makes no difference currently as nothing in the sim tree uses it, but I have a follow up commit for the Blackfin tree that needs it.
2013-05-10gdbTom Tromey2-1/+8
Freddie Chopin <freddie_chopin@op.pl> PR build/15414: * configure: Rebuild. * configure.ac (build_warnings): Do not use -Wformat-nonliteral with -Wno-format. sim/common * acinclude.m4 (SIM_AC_OPTION_WARNINGS): Do not use -Wformat-nonliteral with -Wno-format. sim/bfin * configure: Rebuild. sim/cr16 * configure: Rebuild. sim/cris * configure: Rebuild. sim/d10v * configure: Rebuild. sim/igen * configure: Rebuild. sim/m68hc11 * configure: Rebuild. sim/mips * configure: Rebuild. sim/mn10300 * configure: Rebuild. sim/v850 * configure: Rebuild.
2013-03-26sim: rewrite SIM_AC_OPTION_HARDWARE a bit to simplify thingsMike Frysinger2-26/+26
There's no need to put the majority of the logic into the 3rd arg of the AC_ARG_ENABLE. Coupled with the lack of indentation, it makes it hard to follow, error prone to update, and duplicates code (with the 4th arg). So pull the logic out of the 3rd arg and outside of the AC_ARG_ENABLE macro. This allows us to gut the 4th arg entirely, merge with the code that followed the macro, and fix bugs related to the new dv-sockser in the process. Hopefully building the various sims with the default sim-hardware settings, as well as with explicit --{dis,en}able-sim-hardware flags, should all just work now.