summaryrefslogtreecommitdiff
path: root/sim
AgeCommit message (Collapse)AuthorFilesLines
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-27psim: Correct spelling in comments.Joel Sherrill6-2/+11
2014-08-27 Joel Sherrill <joel.sherrill@oarcorp.com> * basics.h, device.c, device.h, hw_htab.c, hw_memory.c: Correct spelling in comments.
2014-08-23Fix m32r-elf sim, default hardware to off.Hans-Peter Nilsson4-12/+13
The situation here is similar to that of the other nearby (previous) sims fixed; it fails at the dv_sockser_install declaration in sim/m32r/tconfig.in. But, as opposed to e.g. frv, this *does* have a definition of UART_INCHAR_ADDR et al. It's somewhat tempting to keep sim-hardware enabled here but, I'm disabling it for the same reasons as for frv. Unsurprisingly (as m32r seems to be the template), the same confusing lines are in sim/m32r/Makefile.in as in sim/frv/Makefile.in at that time, deleted in 73e76d20. Again, commit 73e76d20 (for m32r as well as for frv) attempted to move the non-existing dv-sockser.o use to $(m32r_extra_objs) but missed that AC_SUBST would only affect @m32r_extra_objs@ and not $(m32r_extra_objs) per se so nothing happened. As for frv, I'm removing the $(m32r_extra_objs) too, to avoid confusion. Make check-sim for m32r-elf shows no regressions (5 failures; 100 expected passes) compared to bf3d9781ec049 (before the recent config.in regen, after sim-hardware mostly-enabled) and eed23bb4a1 (before the sim-hardware mostly-enabled; 2013-03-23). sim/m32r: * configure.ac: Default simulator hardware to off again. Remove dead m32r_extra_objs substitution. * configure: Regenerate. * Makefile.in: Remove unused frv_extra_objs.
2014-08-23Fix sh64-elf sim, default hardware to off.Hans-Peter Nilsson3-15/+9
See nearby (previous) commit for the iq2000 sim; this similarly fails at the dv_sockser_install declaration in sim/sh64/tconfig.in. I'm disabling simulator hardware to be consistent with the state before 94c63d78f (2013-03-23) and with the actions for the frv sim and the iq2000 sim. Make check-sim for sh64-elf shows no regressions (25 failures; 357 expected passes) compared to bf3d9781ec049 (before the recent config.in regen, after sim-hardware mostly-enabled) and eed23bb4a1 (before the sim-hardware mostly-enabled; 2013-03-23). sim/sh64: * configure.ac: Default simulator hardware to off again without emitting errors when off or dv-sockser.o unavailable. * configure: Regenerate.
2014-08-23Fix iq2000-elf sim, default hardware to off.Hans-Peter Nilsson3-15/+9
See nearby (previous) commit for the frv sim; this similarly fails at the dv_sockser_install declaration in sim/iq2000/tconfig.in. There's no HAVE_DV_SOCKSER conditionals here and no other dv-sockser.o artefacts so maybe there is no further fallout, but I'm going to disable sim-hardware just be consistent with the state before 94c63d78f (2013-03-23) and with the actions for the frv sim. Make check-sim for iq2000-elf shows no failures but that's in no small part because it has no test-suite. sim/iq2000: * configure.ac: Default simulator hardware to off again without emitting errors when off or dv-sockser.o unavailable. * configure: Regenerate.
2014-08-23Fix frv-elf sim, default hardware to off.Hans-Peter Nilsson4-12/+13
At 2974be626, frv-elf fails at the dv_sockser_install declaration in sim/frv/tconfig.in. But, with the trivial #include's added (see other sims tconfig.in, like cris or mn10300), it *still* fails building sim/frv/devices.c because of a missing UART_INCHAR_ADDR. I have no insight into what'd be a valid value, except that there's a definition in m32r, which was probably used as a template with frv not finished. Simulated hardware should not have been be enabled, and was indeed not enabled by default before 94c63d78f (2013-03-23), where it seems to have been enabled for no simulator-specific reason. Except dv-sockser.o wasn't enabled even then: sim/frv/config.in wasn't regenerated, so HAVE_DV_SOCKSER was never defined. Maybe people were fooled by this in sim/frv/Makefile.in at that time (these two lines were later deleted, in 73e76d20): CONFIG_DEVICES = dv-sockser.o CONFIG_DEVICES = (As it seems people have missed it before: the second line overrides the first...) I'm guessing these lines were part of the never-completed hardware-support. Commit 73e76d20 attempted to move the imagined dv-sockser.o from $(CONFIG_DEVICES) to $(frv_extra_objs) but missed that AC_SUBST would only affect @frv_extra_objs@ (not $(frv_extra_objs) per se) so nothing happened regarding sockser: dv-sockser.o was not compiled and HAVE_DV_SOCKSER was not defined. I'm removing the $(frv_extra_objs) too, to avoid confusion. The best action seems to be disabling all hardware support by default again until a specific sim maintainer finishes the work. Make check-sim for frv-elf shows no failures after this. sim/frv: * configure.ac: Default simulator hardware to off again. Remove dead frv_extra_objs substitution. * configure: Regenerate. * Makefile.in: Remove unused frv_extra_objs.
2014-08-19Fix --diable-shared --enable-plugins build breakageAlan Modra56-52/+1785
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-19Replace static variables in the MSP430 simulator with fields in the cpu ↵Nick Clifton3-66/+98
state structure. * msp430-sim.c: Move static hardware multiply support variables from here... * msp430-sim.h (msp430_cpu_state): ... into here ... * msp430-sim.c (get_op, put_op): ... and update references to use the msp430_cpu_state structure.
2014-08-15Regenerate sim configury.Roland McGrath78-234/+1427
2014-06-30Sim - Use long int format instead of int to avoid compiling warningMichael Eager2-3/+8
2014-07-01 Chen Gang <gang.chen.5i5j@gmail.com> * sim/microblaze/interp.c: Use long int format instead of int format to avoid compiling warnings.
2014-06-03Fix a small but in the emulation of the MSP430 hardware multiply.Nick Clifton2-3/+37
* msp430-sim.c (get_op): Handle reads of low result register when in MAC mode. (put_op): Copy MAC result into result words. Handle writes to the low result register.
2014-05-12Support 32->64 sign extension in msp430's sign_extDJ Delorie2-4/+9
* msp43-sim.c (sign_ext): Change to "long long" to support sign-extending 32-bit values.
2014-05-08Add support for emulating the MSP430 hardware multiply feature.Nick Clifton2-23/+192
* msp430-sim.c (sim_open): Do not allocate memory over the hardware multiply registers. (get_op): Add support for reads from the hardware multiply registers. (put_op): Add support for writes to the hardware multiply registers. (msp430_step_once): Add support for the RETI instruction used by the CPUX architecture.
2014-04-02Add support for two new moxie sign-extension instructionsAnthony Green2-2/+22
2014-03-19Improve .rsrc section merging with better handling of the alignment adjustmentsNick Clifton1-0/+6
made between merged .rsrc sections. * peXXigen.c (rsrc_align): New function. Attempts to cope with alignment variances when .rsrc sections are merged. (rsrc_process_section): Use rsrc_align. * Makefile.am (default-manifest.o): Use WINDRES_FOR_TARGET. * Makefile.in: Regenerate. * emultempl/default-manifest.rc: Fix typo. * scripttempl/pe.sc (R_RSRC): Fix default-manifest exclusion. (.rsrc): Add SUBALIGN(4). * scripttempl/pep.sc: Likewise.
2014-03-18Convert function declarations to ISO C format. Remove redundant code.Nick Clifton1-99/+60
* wrapper.c: Convert function declarations to ISO C format. (sim_open): Delete code for handling t,d and z command line options.
2014-03-14Add support for instruction level tracing to the ARM simulator.Nick Clifton7-94/+245
* wrapper.c (op_print): New function. (sim_dis_read): New function. (print_insn): New function - disassembles the given instruction. (sim_trace): Note that tracing is now allowed. (sim_create_inferior): Default to emulating v6. Initialise the disassembler machinery. (sim_target_parse_command_line): Add support for -t -d and -z options. (sim_target_display_usage): Note existence of -d and -z options. (sim_open): Parse -t -d and -z options. * armemu.h: Add exports of trace, disas and trace_funcs. Add prototype for print_insn. * armemu.c (ARMul_Emulate26): Add tracing code. Delete unused variables. * thumbemu (handle_v6_thumb_insn): Delete unused variable Rd. Move Rm variable into switch cases. Add tracing code. * armcopro.c (XScale_cp15_init): Add a return value. (XScale_cp13_init): Likewise. (XScale_cp14_init): Likewise. (XScale_cp15_LDC): Delete unused function. (XScale_cp15_STC): Likewise. * maverick.c: Delete comment inside comment. (DSPInit): Delete unused function. (DSPMCR4): Fix compile time warning about missing parenthesis. (DSPMCR5): Likewise. (DSPCDP6): Delete unused variable opcode2.
2014-03-14Prevent writes to R15 via LDR or LDM from changing the ARM/Thumb state in ↵David McQuillan3-3/+23
pre-v5 architectures. PR sim/8388 * armemu.c (WriteR15Load): New function. Determines if the state can be changed upon a write to R15. (LoadMult): Use WriteR15Load. * armemu.h (WRITEDESTB): Use WriteR15Load.
2014-03-12Add myself as the maintainer for the MSP430 sim.Nick Clifton2-0/+5
2014-03-10sim: msp430: start a test frameworkMike Frysinger9-0/+120
The current sim lacks any sort of tests. Start a basic framework and add a simple one to test the add insn.
2014-03-10sim: msp430: set initial PC to ELF entry if availableMike Frysinger2-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.
2014-03-10sim: msp430: fix build time warningsMike Frysinger2-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__)'
2014-03-10sim: constify arg to sim_do_commandMike Frysinger30-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.
2014-03-05sim: constify prog_nameMike Frysinger35-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.
2014-03-04sim: convert old style prototypesMike Frysinger26-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.
2014-02-17 Revise signal mapping function in GDB interface for RX sim.Kevin Buettner2-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.
2014-02-17sim: delete duplicate SIGINT handlingMike Frysinger10-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>
2014-02-17sim: ppc: drop $(LIBS) from psim dependencyAaro Koskinen2-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
2014-01-07remove VA_* macros from simTom Tromey4-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.
2014-01-07remove PARAMS from simTom Tromey33-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.
2014-01-01Update Copyright year range in all files maintained by GDB.Joel Brobecker546-546/+546
2013-12-07sim: bfin: tests: make run-tests.sh executableMike Frysinger2-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.
2013-12-07strip off +x bits on non-executable/script filesMike Frysinger1-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-252013-11-25 Steve Ellcey <sellcey@mips.com>Steve Ellcey2-1/+5
* igen/Makefile.in (igen): Use BUILD_CFLAGS in link.
2013-11-07sim/ChangeLog: Correct bug number in previous commit.Will Newton1-1/+1
2013-11-07sim/arm: Prevent crash when running sim with no binary.Will Newton2-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.
2013-11-07sim/arm: Prevent NULL pointer dereference in sim_create_inferior.Will Newton2-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.
2013-10-15 * Makefile.in (srcsim): New variable.Hans-Peter Nilsson2-1/+7
(version.c): Adjust call to $(srccom)/create-version.sh as per change.
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-10-09sim/erc32/ChangeLog:Sergio Durigan Junior2-3/+16
2013-10-09 Sergio Durigan Junior <sergiodj@redhat.com> PR sim/16018: * float.c (set_fsr): Add missing "break" statements. Reindent code.
2013-09-23Regenerate sim configure files to pick up support for powerpc64le inAlan Modra55-137/+9417
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-08-08 * gdb-if.c (hw_breakpoints): Remove.Kevin Buettner2-10/+15
(sim_store_register): Add an assert() to make sure PC is in range. Delete code which referenced hw_breakpoints[].
2013-06-28move version.in from gdb/common back to gdbTom Tromey5-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.
2013-06-28* rx.c (SHIFT_OP): A shift by zero still sets the condition codes.Nick Clifton2-2/+6
2013-06-26 * Makefile.in (dtbdir): Don't use gdb's version.in.Tom Tromey2-1/+5
2013-06-24Adapt sim to new version number & date locations.Joel Brobecker5-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.
2013-06-24sim: bfin: note missing parallel handling of SEARCHMike Frysinger2-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.
2013-06-24sim: bfin: handle invalid HLs encoding in dsp shift insnsMike Frysinger2-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.
2013-06-24sim: bfin: run-tests.sh: fix typo in usage exitMike Frysinger2-1/+5