Commit Graph

3759 Commits

Author SHA1 Message Date
Joel Brobecker f749ed6079 Minor comment fixes in sim/common/sim-fpu.c.
This patch makes a fair number of fixes in the various comments of
sim-fpu.c, mostly to either better conform to the GNU Coding Standards
(sentences start with a capital letter, end with a period), or to
fix spelling mistakes.

sim/common/ChangeLog:

        * sim-fpu.c: Minor comment fixes throughout.
2016-01-17 09:34:29 +04:00
Joel Brobecker 3c8e93b7fa minor reformatting in sim/common/sim-fpu.c.
This patch just makes a copy of formatting changes to better conform
with the GNU Coding Style.

sim/common/ChangeLog:

        * sim-fpu.c (print_bits): Minor reformatting (no code change).
        (sim_fpu_map): Likewise.
2016-01-17 09:33:49 +04:00
Mike Frysinger b36d953bce sim: mips: workaround 32-bit addr sign extensions
The mips bfd will sign extend 32-bit addresses into 64-bit values,
so if the entry happens to be 0x80000000 or higher, it is turned to
0xffffffff80000000 which points to memory that doesn't exist.

This wasn't an issue until commit 26f8bf63bf
as all addresses were automatically truncated there in the translate
function to 32-bits.  When we cleaned up that code, the full 64-bits
were checked leading to many test failures for mips-sde-elf targets
and such.
2016-01-12 01:42:22 -05:00
Mike Frysinger 34ac507d94 sim: config: do not try to align settings
We try to align the output for a few settings, but not most of them.
Drop the aligning entirely to be lazy.
2016-01-11 00:58:55 -05:00
Mike Frysinger ce39bd3890 sim: move many common settings from CPPFLAGS to config.h
Rather than stuffing the command line with a bunch of -D flags, start
moving things to config.h which is managed by autoheader.  This makes
the makefile a bit simpler and the build output tighter, and it makes
the migration to automake easier as there are fewer vars to juggle.

We'll want to move the other options out too, but it'll take more work.
2016-01-10 18:54:41 -05:00
Mike Frysinger e19418e02e sim: drop unused SIM_AC_OPTION_PACKAGES
This was imported from the ppc sim, but that was only used to control
a single file, and that is already governed by the hw models.  There's
no need to have a sep configure option here, especially since none of
the other sims are using it.  Even when the code is enabled, there's
no runtime overhead.
2016-01-10 17:54:04 -05:00
Mike Frysinger 16f7876d71 sim: allow the environment configure option everywhere
Currently ports have to call SIM_AC_OPTION_ENVIRONMENT explicitly in
order to make the configure flag available.  There's no real reason
to not allow this flag for all ports, so move it to the common sim
macro.  This way we get standard behavior across all ports too.
2016-01-10 17:03:36 -05:00
Mike Frysinger 35656e9521 sim: allow the assert configure option everywhere
Currently ports have to call SIM_AC_OPTION_ASSERT explicitly in order
to make the configure flag available, which none of them do.  There's
no real reason to not allow this flag for all ports, so move it to the
common sim macro.  This way we get standard behavior across all ports.
2016-01-10 16:13:13 -05:00
Mike Frysinger 99d8e87993 sim: drop targ-vals.def->nltvals.def indirection
We don't have alternative nltvals.def files, so always symlinking
the targ-vals.def file to it doesn't gain us anything.  It does
make the build more complicated though and a pain to convert to
something newer (like automake).  Drop the symlinking entirely.

In the future, we'll want to explode this file anyways into the
respective arch dirs so things can be selected dynamically at
runtime, so it's not like we'll be bringing this back.
2016-01-10 04:01:16 -05:00
Mike Frysinger 6d90347b5d sim: mips: drop SIM_AC_OPTION_SMP call
No other port calls this macro directly, and mips has it hardcoded
to the default -- disabling smp.  In the future we'll enable this
for all targets in common code, so tidy up the mips code now.
2016-01-10 03:42:06 -05:00
Mike Frysinger 347fe5bb86 sim: allow the inline configure option everywhere
Currently ports have to call SIM_AC_OPTION_INLINE explicitly in order
to make the configure flag available.  There's no real reason to not
allow this flag for all ports, so move it to the common sim macro.
This way we get standard behavior across all ports too.
2016-01-10 03:36:32 -05:00
Mike Frysinger 0dc73ef7c3 sim: drop --enable-sim-{regparm,stdcall} options
These options were never exposed for most sims (just the ppc one),
and they are really only useful on 32-bit x86 systems.  Considering
modern systems tend to be 64-bit x86_64 and how well modern compilers
are at optimizing code, these have outlived their usefulness.
2016-01-10 03:15:01 -05:00
Mike Frysinger 22be3fbeac sim: drop --enable-sim-cflags option
No other sub directory provides such a configuration option, so
drop it from the sim dir as well.  This cleans up a good bit of
code in the process.

If people want to use custom flags for just the sim, they can
still run configure+make by hand in the sim subdir and use the
normal CFLAGS settings.
2016-01-10 02:54:59 -05:00
Mike Frysinger 5295724cdc sim: stop configuring common subdir
Now that cconfig.h doesn't exist, there's no need to build in the common
subdir anymore.  We leave the configure/Makefile files in there as there
is a helper for developers to generate the nltvals.def file.  Once that
gets cleaned up in the future though, we can drop the build logic too.
2016-01-09 03:52:30 -05:00
Mike Frysinger 936df7568a sim: drop common/cconfig.h in favor of a single config.h
The common subdir sets up a cconfig.h file to hold checks for the common
code.  In practice, most files still end up using config.h instead which
just leads to confusion.

Merge all the configure checks that went into cconfig.h into SIM_AC_COMMON
so we can drop the cconfig.h file altogether.  Now there is only a single
config.h file like normal.
2016-01-09 03:52:30 -05:00
Mike Frysinger b900245c3b sim: config: drop use of __DATE__/__TIME__
These don't add a whole lot of useful info, and people don't like them as
it makes builds unreproducible, so just drop them.
2016-01-06 21:52:57 -05:00
Mike Frysinger 2e3d4f4d5d sim: sim_{create_inferior,open,parse_args}: constify argv/env slightly
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-06 21:48:59 -05:00
Joel Brobecker 6847703472 Change copyright owner to FSF in sim/testsuite/sim/mips/hilo-hazard-4.s
sim/testsuite/sim/mips/ChangeLog:

        * hilo-hazard-4.s: Change copyright ownder to FSF.
2016-01-06 09:41:15 +04:00
Mike Frysinger 402cf05346 sim: msp430: drop duplicate sim_load_file call
There's no need, or desire, to call sim_load_file from sim_open.  The
higher levels (gdb/run) take care of calling sim_load for us already.
2016-01-05 14:37:46 -05:00
Mike Frysinger 1a846c6262 sim: aarch64: switch to common disassembler tracing
The output should largely be the same.
2016-01-05 14:37:46 -05:00
Mike Frysinger 824c862804 sim: bfin: add support disasm tracing 2016-01-05 14:37:45 -05:00
Mike Frysinger 70d3944832 sim: msp430: switch to common disassembler tracing
The output format is a bit different, but the new form matches all the
other trace lines.  Otherwise, it should be functionally equivalent.
2016-01-05 14:37:33 -05:00
Mike Frysinger bfb2629c16 sim: trace: add support for disassembling
Some targets have started to add support for calling the disassembler
automatically when executing code.  Add support for that directly into
the trace core.
2016-01-05 14:28:37 -05:00
Nick Clifton 4eb70007f1 Add myself as the maintainer for the AArch64. 2016-01-05 16:49:26 +00:00
Nick Clifton 296ebfbb91 Fix the execution of the MSP430 simulator testsuite.
ld	* emulparams/msp430elf.sh (RAM_START): Move to 0x500 - above the
	MSP430 hardware multiply address range.
	* scripttempl/elf32msp430.sc (__romdatastart): Define.
	(__romdatacopysize): Define.
	* scripttempl/elf32msp430_3.sc: Likewise.

tests	* testutils.inc (__pass): Use the LMA addresses of the _passmsg
	symbol.
	(__fail): Likewise.
2016-01-05 16:43:58 +00:00
Mike Frysinger 44ddb0c66a sim: use STATE_MAGIC helper 2016-01-04 23:01:14 -05:00
Mike Frysinger bc273e1751 sim: unify min/max macros
Import defines from gdb/defs.h to the sim core so we can delete the
various copies that already exist.
2016-01-04 22:24:03 -05:00
Tristan Gingold ac8eefeb24 sim: aarch64: drop syscall.h include to fix build
The simulator is including syscall.h which is not standard and apparently
not required (builds correctly without it on my machine).
2016-01-04 20:09:24 -05:00
Mike Frysinger 8d7d784e23 sim: parse_args: polish getopt error message
The cris sim hit a few failures after the recent getopt logic, and the
expected output showed a few ways we can improve things to better match
other utils.
2016-01-04 05:08:26 -05:00
Mike Frysinger 9bbf6f91c6 sim: punt x86-specific bswap logic
The compiler/C library should produce reasonable code for htonl/ntohl,
and at least glibc tries pretty hard to always produce good code for
them.  This logic only had support for 32-bit x86 systems anymore, and
it's unlikely people were even opting into this, so drop it all.
2016-01-04 05:04:30 -05:00
Mike Frysinger 13adda68c5 sim: d10v: gut endian logic
The compiler should produce reasonable code here in general, so punt the
various arch checks and bswap defines.  This code will eventually go away
entirely when we convert it to the common memory code.
2016-01-04 05:04:04 -05:00
Mike Frysinger 77cf2ef5dc sim: parse_args: display getopt error ourselves
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.
2016-01-03 22:07:39 -05:00
Mike Frysinger 3726f72c65 sim: TODO: move to wiki
We're maintaining development docs in the wiki now:
	https://sourceware.org/gdb/wiki/Sim/TODO
2016-01-03 19:54:25 -05:00
Mike Frysinger 61971b86bb sim: clean up some more device detritus
Clean up some more remains of WITH_DEVICES that escaped notice.

We also clean up GETTWI/SETTWI defines in a few ports where they
were copied & pasted and are unused as they happen to be near the
device code.
2016-01-03 04:23:10 -05:00
Mike Frysinger 34fed69938 sim: use libiberty countargv in more places
A bunch of places open code the countargv implementation, or outright
duplicate it (as count_argc).  Replace all of those w/countargv.
2016-01-03 04:08:56 -05:00
Mike Frysinger aba6f46b23 sim: nrun: use lbasename 2016-01-03 03:50:08 -05:00
Mike Frysinger 0cb8d8513c sim: drop host endian configure option
The --enable-sim-hostendian flag was purely so people had an escape route
for when cross-compiling.  This is because historically, AC_C_BIGENDIAN
did not work in those cases.  That was fixed a while ago though, so we can
require that macro everywhere now and simplify a good bit of code.
2016-01-03 00:52:51 -05:00
Mike Frysinger 1ac72f0659 sim: convert to bfd_endian
Rather than re-invent endian defines, as well as maintain our own list
of OS & arch-specific includes, punt all that logic in favor of the bfd
ones already set up and maintained elsewhere.  We already rely on the
bfd library, so leveraging the endian aspect should be fine.
2016-01-03 00:18:07 -05:00
Mike Frysinger b3fbb288af sim: cris: use standard output helpers
The sim-io module provides output helpers, so no need to define local
ones anymore.
2016-01-02 14:00:48 -05:00
Mike Frysinger 027e73b217 sim: iq2000/m32r/lm32/sh64: delete dead option code
The iq2000/m32r/sh64 option parsing logic appears to have always been
dead.  At least iq2000/sh64 are simply copy & paste rot from m32r.

The lm32 option parsing hack here hasn't been needed for a while -- this
was fixed back in commit 11409fac6b in the
common code.
2016-01-02 10:39:13 -05:00
Mike Frysinger d47f5b30d8 sim: delete dead current_state globals
The global current_state handle to the current simulator state is a
design idea that was half implemented, but never really cleaned up.
The point was to have a global variable pointing to the state so that
funcs could more quickly & easily access the state anywhere.  We've
instead moved in the direction of passing state around everywhere and
don't have any intention of moving back.

I also can't find any references to gdb using this variable, or to
cgen related "dump_regs" functions, both of which were used in the
comments related to this code.
2016-01-02 10:27:56 -05:00
Mike Frysinger dea827fc5c sim: ppc: do not exit when parsing args w/gdb
When connecting to the simulator in gdb, we don't want it to exit on
us when we pass down unknown/invalid/help/etc... options.  Plumb down
the kind argument so we can handle both gdb & psim interfaces.
2016-01-02 03:38:29 -05:00
Joel Brobecker 618f726fcb GDB copyright headers update after running GDB's copyright.py script.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2016-01-01 08:43:22 +04:00
Mike Frysinger 8e26d677a2 sim: m68hc11: fix default endian
The previous commit here set the default to little instead of big.
A typo lost when reviewing the different targets in parallel.
2015-12-30 23:48:17 -05:00
Mike Frysinger eca4255a1a sim: cris/m68hc11: move default endian/alignment to configure 2015-12-30 21:01:58 -05:00
Mike Frysinger cec99e6b2c sim: h8300: inline sim_state_initialize
All the state is handled already by the common cpu allocation which
zeros out the entire state.
2015-12-30 06:05:02 -05:00
Mike Frysinger 2a2757ac7e sim: h8300: simplify h8300_reg_{fetch,store} funcs
We can leverage the cpu->regs array rather than going through the
function helpers to get nice compact code.

Further, fix up the return values: return -1 when we can't find a
register (and let the caller write out warnings), return 2/4 when
we actually write out that amount, and handle the zero reg.
2015-12-30 06:02:27 -05:00
Mike Frysinger 4ca9d09e82 sim: h8300: switch to common sim-resume 2015-12-30 05:27:18 -05:00
Mike Frysinger 5658c2571f sim: h8300: move default endian/alignment to configure 2015-12-30 05:20:41 -05:00
Mike Frysinger 9950eccba1 sim: simplify STATE_MY_NAME setup
No point in writing basename ourselves when libiberty provides one.
2015-12-30 03:35:12 -05:00