summaryrefslogtreecommitdiff
path: root/sim
Commit message (Collapse)AuthorAgeFilesLines
* sim: msp430: start a test frameworkMike Frysinger2014-03-109-0/+120
| | | | | The current sim lacks any sort of tests. Start a basic framework and add a simple one to test the add insn.
* sim: msp430: set initial PC to ELF entry if availableMike Frysinger2014-03-102-1/+11
| | | | | If we want to run a simple ELF, the reset vector isn't set up, so starting at address 0 doesn't make sense. Use the ELF's entry point instead.
* sim: msp430: fix build time warningsMike Frysinger2014-03-102-2/+7
| | | | | | | | | | | | | | | | This fix is simple: msp430-sim.c: In function 'maybe_perform_syscall': msp430-sim.c:898:10: warning: format '%d' expects argument of type 'int', but argument 5 has type 'long int' [-Wformat] This one we change to use casts like everyone else does in the code base: msp430-sim.c: In function 'msp430_step_once': msp430-sim.c:985:7: warning: passing argument 3 of 'init_disassemble_info' from incompatible pointer type [enabled by default] include/dis-asm.h:368:13: note: expected 'fprintf_ftype' but argument is of type 'int (*)(struct FILE * __restrict__, const char * __restrict__)'
* sim: constify arg to sim_do_commandMike Frysinger2014-03-1030-28/+95
| | | | | | 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.
* sim: constify prog_nameMike Frysinger2014-03-0535-22/+89
| | | | | 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.
* sim: convert old style prototypesMike Frysinger2014-03-0426-266/+209
| | | | | 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.
* Revise signal mapping function in GDB interface for RX sim.Kevin Buettner2014-02-172-29/+18
| | | | | | | | | | | | | | | | | | sim/rx/gdb-if.c had a function named `rx_signal_to_host'. This function mapped signal numbers used by the BSP to host signal numbers which, at one time a while back, were used by GDB as target signal numbers. This change updates the signal numbers returned to be those names prefixed with "GDB_SIGNAL_" as defined in include/gdb/signals.h. It also changes the name of the function somewhat to better match what the function currently does. I noticed that this function is not static - and there's no reason for it not to be - so I made it static too. * gdb-if.c (rx_signal_to_host): Rename to `rx_signal_to_gdb_signal'. Make static. Update all callers to use new name. Use signal names from include/gdb/signals.h.
* sim: delete duplicate SIGINT handlingMike Frysinger2014-02-1710-57/+31
| | | | | | | | | | | | | | | | | Many of the simulators change the SIGINT handler. E.g., moxie/interp.c: sigsave = signal (SIGINT, interrupt); However, this is unnecessary. remote-sim.h already provides an API for asynchronously stopping a sim; and both gdb and the drivers (run.c and nrun.c at least, I didn't check the others) install a SIGINT handler which calls this method. URL: https://sourceware.org/bugzilla/show_bug.cgi?id=16450 Reported-by: Tom Tromey <tromey@redhat.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sim: ppc: drop $(LIBS) from psim dependencyAaro Koskinen2014-02-172-3/+7
| | | | | | | | | When cross-compiling GDB for PPC, there's a prerequisite "-lz" for psim that results in a build failure. With such prerequisite, GNU Make will try to search the library from build machine's /usr/lib which is wrong. On 64-bit Linux build machines the compilation will fail because of this. URL: https://sourceware.org/bugzilla/show_bug.cgi?id=12202
* remove VA_* macros from simTom Tromey2014-01-074-5/+11
| | | | | | | | | | 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.
* remove PARAMS from simTom Tromey2014-01-0733-430/+459
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Update Copyright year range in all files maintained by GDB.Joel Brobecker2014-01-01546-546/+546
|
* sim: bfin: tests: make run-tests.sh executableMike Frysinger2013-12-072-0/+4
| | | | | | | | | | | I meant for this script to be +x, but missed when doing the initial CVS commit. It wasn't possible to fix w/CVS, but it is w/git, so do it. Signed-off-by: Mike Frysinger <vapier@gentoo.org> 2012-12-03 Mike Frysinger <vapier@gentoo.org> * run-tests.sh: Add +x file mode.
* strip off +x bits on non-executable/script filesMike Frysinger2013-12-071-0/+4
| | | | | | | | These files are source files and have no business being +x. We couldn't easily fix it in CVS (you need login+write access to the raw rcs files), but we can fix this w/git. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* 2013-11-25 Steve Ellcey <sellcey@mips.com>Steve Ellcey2013-11-252-1/+5
| | | | * igen/Makefile.in (igen): Use BUILD_CFLAGS in link.
* sim/ChangeLog: Correct bug number in previous commit.Will Newton2013-11-071-1/+1
|
* sim/arm: Prevent crash when running sim with no binary.Will Newton2013-11-072-0/+8
| | | | | | | | 2013-11-07 Will Newton <will.newton@linaro.org> PR gdb/15508 * arm/wrapper.c (sim_create_inferior): Call init before accessing STATE.
* sim/arm: Prevent NULL pointer dereference in sim_create_inferior.Will Newton2013-11-072-4/+14
| | | | | | | | 2013-11-07 Will Newton <will.newton@linaro.org> PR gdb/9195 * arm/wrapper.c (sim_create_inferior): Avoid calling bfd_get_mach with a NULL bfd.
* * Makefile.in (srcsim): New variable.Hans-Peter Nilsson2013-10-152-1/+7
| | | | (version.c): Adjust call to $(srccom)/create-version.sh as per change.
* * create-version.sh: Align parameters to match those ofHans-Peter Nilsson2013-10-153-6/+19
| | | | | | ../../gdb/common/create-version.sh. * Make-common.in (srcsim): New variable. (version.c): Adjust call to create-version.sh as per above.
* sim/erc32/ChangeLog:Sergio Durigan Junior2013-10-092-3/+16
| | | | | | | | 2013-10-09 Sergio Durigan Junior <sergiodj@redhat.com> PR sim/16018: * float.c (set_fsr): Add missing "break" statements. Reindent code.
* Regenerate sim configure files to pick up support for powerpc64le inAlan Modra2013-09-2355-137/+9417
| | | | libtool.m4.
* sim: mark complete_option_list args const to fix build warningsMike Frysinger2013-09-032-1/+5
| | | | | The completion API was updated, but this func missed having its text/word args const.
* * gdb-if.c (hw_breakpoints): Remove.Kevin Buettner2013-08-082-10/+15
| | | | | (sim_store_register): Add an assert() to make sure PC is in range. Delete code which referenced hw_breakpoints[].
* move version.in from gdb/common back to gdbTom Tromey2013-06-285-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* * rx.c (SHIFT_OP): A shift by zero still sets the condition codes.Nick Clifton2013-06-282-2/+6
|
* * Makefile.in (dtbdir): Don't use gdb's version.in.Tom Tromey2013-06-262-1/+5
|
* Adapt sim to new version number & date locations.Joel Brobecker2013-06-245-11/+51
| | | | | | | | | | | | | | | | | | | 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.
* sim: bfin: note missing parallel handling of SEARCHMike Frysinger2013-06-242-0/+18
| | | | | | | The SEARCH insn is an oddball when it comes to parallel usage. It places a big limit on what other insns it can run in parallel with, but we don't currently track the amount of state needed to verify this (since no other insn really requires this). Add a note for now in case we get around to it.
* sim: bfin: handle invalid HLs encoding in dsp shift insnsMike Frysinger2013-06-242-5/+16
| | | | | | For many of the 32bit dsp shift related insns, we were just ignoring the HLs field. The hardware does not though and will reject the insn if it's set incorrectly. Update the sim to match.
* sim: bfin: run-tests.sh: fix typo in usage exitMike Frysinger2013-06-242-1/+5
|
* sim: bfin: se_all32bitopcodes: skip debug insns under the simMike Frysinger2013-06-242-1/+18
| | | | | | | Since the sim has a few fake debug insns that the hardware does not, we need to check for those before attempting to run them. Otherwise we'll randomly trigger the sim debug asserts/aborts/halts insns. On the hardware, these are proper invalid insns, and the table catches that.
* sim: bfin: speed up all insn testcases slightlyMike Frysinger2013-06-242-2/+8
| | | | | | | | | | | The main body of the "all insn" test is executed once per tested insn, and we test millions of insns here. Any shrinkage we can do in this loop will speed things up nicely (since it's multiplied per tested insn). To that end, simplify the end-of-table test into one less insn, and omit the SSYNC when we build for the sim. When we build to run on the hardware, this insn matters, but the sim doesn't have write store buffers in the chip that might get in the way (memory writes are atomic).
* sim: bfin: trim trailing whitespaceMike Frysinger2013-06-232-1/+5
|
* * msp430: New Directory.Nick Clifton2013-06-2117-0/+8534
| | | | | | | | | | | | | | | | | | | * 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.
* sim: bfin: stricter insn decodingMike Frysinger2013-06-192-50/+86
| | | | | | | | | | We wrote a test case that tries every single 32bit opcode on the hardware and compared it to the sim. There were a bunch of places in the sim where we weren't strict enough (requiring certain parts of the opcode be set) so we were treating a lot of invalid opcodes as valid ones. This sprinkles out a lot additional checks in the dsp32alu class. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sim: bfin: tweak run-tests for parallel usageMike Frysinger2013-06-172-6/+34
|
* sim: bfin: add helpful info for generating test tablesMike Frysinger2013-06-172-0/+23
|
* sim: bfin: drop RET[ENI] setupMike Frysinger2013-06-172-3/+4
| | | | | | | | | | Since these insns run in usermode, there should be no need to setup RET[ENI] to safe values. They won't be dereferenced, and any insn that returns via them are valid only in supervisor mode. Since this is in the main exception code path, saving any insn at all is good as it gets multiplied quickly (as in O(n^2) times). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sim: bfin: add flush/HWERR todoMike Frysinger2013-06-172-0/+8
|
* sim: bfin: only regen linux-fixed-code.h in maintainer modeMike Frysinger2013-06-102-1/+6
| | | | | | | Since many people don't have a Blackfin toolchain available, only try to regenerate the header file when in maintainer mode. This file rarely changes, and when it does, we commit the generated output, so there's almost never a need to run directly on an end system.
* sim: use AM_MAINTAINER_MODEMike Frysinger2013-06-0576-337/+1802
| | | | | | | 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.
* sim: arm: add support for MOVW and MOVT instructionsMike Frysinger2013-05-154-4/+71
| | | | | | | | | | | | | | | | | | From: Jayant R. Sonar <Jayant.Sonar@kpitcummins.com> This patch adds simulator support for handling the armv7 instructions 'movw (immediate)' and 'movt'. Compiler frequently use these instructions to load the 32bit addresses of global variables, string pointers etc. into the general registers. In absence of support of these instructions: 1. GDB run simulator fails to print even simple "hello world" string on console. 2. Loading of global variable addresses into the registers fail causing arithmetic operation failures. Patch has been regression tested for arm-none-eabi (-march=armv7-a).
* * v850.igen (LDSR): Accept but ignore a selID parameter.Nick Clifton2013-05-132-3/+9
|
* gdbTom Tromey2013-05-1020-10/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Move ChangeLog entry from sim/ to sim/ppc/...Joel Brobecker2013-05-062-4/+4
| | | | ... where it belongs.
* 2013-05-03 Hafiz Abid Qadeer <abidh@codesourcery.com>Hafiz Abid Qadeer2013-05-032-13/+6
| | | | | | revert: 2013-04-19 Nathan Froyd <froydnj@codesourcery.com> * ppc-instructions (isel): New instruction.
* 2013-04-19 Nathan Froyd <froydnj@codesourcery.com>Hafiz Abid Qadeer2013-04-192-0/+17
| | | | * ppc-instructions (isel): New instruction.
* sim: frv/m32r: back out hard failure when dv-sockser is not availableMike Frysinger2013-03-319-42/+34
| | | | | | | These sims have optional support for the dv-sockser model, so do not make them hard failures. The Makefile made it seem like they didn't actually support things dynamically, but a further code dive into the source and the Makefile shows that things work out.
* sim: rewrite SIM_AC_OPTION_HARDWARE a bit to simplify thingsMike Frysinger2013-03-2623-354/+448
| | | | | | | | | | | | | | | 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.