Commit Graph

193 Commits

Author SHA1 Message Date
Mike Frysinger
6dd65fc048 sim: unify bug & package settings
Move these options up to the common dir so we only test & export
them once across all ports.  The AC_INIT macro does a lot of the
heavy lifting already which allows further simplification.
2021-06-12 20:24:08 -04:00
Mike Frysinger
04381273a9 sim: unify debug/stdio/trace/profile build settings
Move these options up to the common dir so we only test & export
them once across all ports.

The ppc code needs a little extra care with its trace settings as
it's not exactly the same API as the common code.  The other knobs
are the same though.
2021-06-12 20:07:57 -04:00
Mike Frysinger
5ea4547402 sim: unify environment build settings
Move the --sim-enable-environment option up to the common dir so we
only test & export it once across all ports.
2021-06-12 11:01:57 -04:00
Mike Frysinger
dba333c1e4 sim: unify assert build settings
Move the --sim-enable-assert option up to the common dir so we only
test & export it once across all ports.
2021-06-12 10:58:22 -04:00
Mike Frysinger
b15c5d7a51 sim: unify platform function & header tests
Move the various platform tests up a level to avoid duplication
across the ports.  When building multiple versions, this speeds
things up a bit.

For now we move the obvious stuff up a level, but we don't turn
own the config.h entirely just yet -- we still have some tests
related to libraries that need consideration.
2021-06-12 10:45:36 -04:00
Mike Frysinger
f4fdd84587 sim: fully merge sim_state_base into sim_state
Now that all ports have migrated to the new framework, drop support
for the old sim_state_base layout.
2021-05-17 01:05:08 -04:00
Mike Frysinger
383861bd08 sim: invert sim_state storage
Currently all ports have to declare sim_state themselves in their
sim-main.h and then embed the common sim_state_base & sim_cpu in it.
This dynamic makes it impossible to share common object code among
multiple ports because the core data structure is always different.

Let's invert this relationship: common code declares sim_state, and
if the port actually needs state on a per-instance basis, it can use
the new arch_data field for it.  Most ports don't actually use it,
so they don't need to declare anything at all.

This is the first in a series of changes: it adds a define to select
between the old & new layouts, then converts all the ports that don't
need custom state over to the new layout.
2021-05-17 00:42:55 -04:00
Mike Frysinger
6df01ab8ab sim: switch config.h usage to defs.h
The defs.h header will take care of including the various config.h
headers.  For now, it's just config.h, but we'll add more when we
integrate gnulib in.

This header should be used instead of config.h, and should be the
first include in every .c file.  We won't rely on the old behavior
where we expected files to include the port's sim-main.h which then
includes the common sim-basics.h which then includes config.h.  We
have a ton of code that includes things before sim-main.h, and it
sometimes needs to be that way.  Creating a dedicated header avoids
the ordering mess and implicit inclusion that shows up otherwise.
2021-05-16 22:38:41 -04:00
Mike Frysinger
79633c125e sim: riscv: move __int128 check to configure 2021-05-16 00:04:17 -04:00
Mike Frysinger
df68e12b3b sim: create header namespace
The gdb/callback.h & gdb/remote-sim.h headers have nothing to do with
gdb and are really definitions for the libsim API under the sim/ tree.
While gdb uses those headers as a client, it's not specific to it.  So
create a new sim/ namespace and move the headers there.
2021-05-14 00:41:05 -04:00
Mike Frysinger
a147f3ff8c sim: remove sys/times.h in most places
The v850 port used this, and then it got copied to other ports even
though it wasn't needed.  Clean it up to avoid portability issues on
platforms not providing this (e.g. mingw64 for Windows).
2021-05-04 21:56:38 -04:00
Mike Frysinger
aa0fca163e sim: add support for build-time ar & ranlib
This is needed when building for a target whose ar & ranlib are
incompatible with the current build system.  For example, building
for Windows on a Linux system.

Then manually import the automake rule for libigen.a, but tweak the
tool variables to use the FOR_BUILD variants.
2021-05-04 08:22:07 -04:00
Mike Frysinger
fe34861780 sim: nrun: add local strsignal prototype
While libiberty provides a definition for this for systems that lack
the function (e.g. Windows), it doesn't provide a prototype.  So add
our own local copy in the one file that uses the func.
2021-05-01 16:37:39 -04:00
Mike Frysinger
bd0918c910 sim: nltvals: unify common syscall tables
Since libgloss provides a default syscall table for arches, use that
to provide the default syscall table for ports.  Only the exceptions
need to be enumerated now with the common logic as the default.
2021-04-26 22:39:55 -04:00
Mike Frysinger
66d055c754 sim: enable hardware support by default
Force this on for all ports.  We have a few common models that can
be used, so make them generally available.  If the port doesn't use
any hardware (the default), then behavior is unchanged.
2021-04-26 22:30:55 -04:00
Tom Tromey
19f6a43c6c Do not check for sys/time.h or sys/times.h
This updates the sim so that it unconditionally uses sys/time.h.  This
is in agreement with existing code, and a recent change to BFD.

I also think that sys/times.h is never needed by the sim, so this
patch removes the check and the one spot that was conditionally
including it.

sim/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* m4/sim_ac_common.m4 (SIM_AC_COMMON): Don't check for sys/time.h
	or sys/times.h.

sim/aarch64/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/arm/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/avr/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/bfin/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/bpf/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/common/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* sim-utils.c: Update includes.

sim/cr16/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* simops.c: Update includes.
	* configure, config.in: Rebuild.

sim/cris/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* rvdummy.c: Update includes.
	* dv-rv.c: Update includes.
	* configure, config.in: Rebuild.

sim/d10v/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/erc32/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/example-synacor/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/frv/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/ft32/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/h8300/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/iq2000/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/lm32/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/m32c/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/m32r/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/m68hc11/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/mcore/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/microblaze/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/mips/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/mn10300/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/moxie/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/msp430/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/or1k/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/ppc/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* mon.c: Update includes.
	* emul_unix.c: Update includes.
	(do_unix_gettimeofday): Update condition.

sim/pru/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/riscv/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/rl78/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/rx/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/sh/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* interp.c: Update includes.
	* configure, config.in: Rebuild.

sim/v850/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.
2021-04-22 19:51:55 -06:00
Tom Tromey
efd82ac7cb Require GNU make
GDB has required GNU make for quite some time, and this patch applies
this approach to the sim as well.  Requiring GNU make means that
automatic dependency tracking can be simple and reliable, and it also
makes other refactorings simpler.

sim/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* m4/sim_ac_common.m4 (SIM_AC_COMMON): Don't check for make.

sim/aarch64/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/arm/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/avr/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/bfin/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/common/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* Make-common.in: Require GNU make.

sim/cr16/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/cris/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/d10v/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/erc32/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/example-synacor/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/frv/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/ft32/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/h8300/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/iq2000/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/lm32/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/m32c/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/m32r/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/m68hc11/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/mcore/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/microblaze/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/mips/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/mn10300/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/moxie/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/msp430/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/or1k/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/pru/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/riscv/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/rl78/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/rx/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/sh/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/v850/ChangeLog
2021-04-22  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.
2021-04-22 19:51:54 -06:00
Mike Frysinger
2662c237a9 sim: regen against sim/m4/
My scripts weren't updated to use new -I../m4 as the first arg.
2021-04-21 20:40:51 -04:00
Simon Marchi
1f195bc327 sim: use -Werror when probing for supported warning flags
When building with clang, we get:

    error: unknown warning option '-Wmissing-parameter-type' [-Werror,-Wunknown-warning-option]

This is because clang only warns by default when encountering an unknown
warning option, and the probe for supported warning flags is done
without -Werror.  All flags are therefore accepted by configure, but
then it breaks when actually compiling a source file with -Werror.

This is equivalent to this commit in gdb:

    3e019bdc20
    gdb: Use -Werror when checking for (un)supported warning flags

We then see some other compilation errors when building with clang and
-Werror, they can be dealt with later.
2021-04-21 19:48:35 -04:00
Mike Frysinger
2c2645d7a8 sim: switch to AC_CHECK_HEADERS_ONCE
This avoids duplicate tests for headers between common m4, arches,
and any other sources that would trigger header tests.
2021-04-18 23:53:01 -04:00
Mike Frysinger
f3d25569f1 sim: moxie: switch syscalls to common nltvals
Rather than hand duplicate the syscall constants, switch to the
common nltvals framework.  I made sure the constants have the
same values before & after too :).
2021-04-18 23:03:38 -04:00
Mike Frysinger
37e9f18266 sim: switch to AC_CHECK_FUNCS_ONCE & merge a little
This avoids duplicate tests for functions between common m4, arches,
and any other sources that would trigger func tests.

Also manually delete known duplicate function tests between the m4,
bfin, and v850 ports.
2021-04-18 21:55:17 -04:00
Mike Frysinger
d5a71b1131 sim: cgen: move cgen_cpu_max_extra_bytes logic into the common code
Every arch handles this the same way, so move it to the common code.
This will also make unifying the sim_cpu structure easier.
2021-04-12 00:14:32 -04:00
Luis Machado
b7f507caf0 Fix DTB generation mechanism and build failure
I ran into a build failure with --enable-targets=all due to the fact that
the moxie sim expects to be able to use the dtc tool.  If it isn't available,
the builds fails.

The following patch adds a prebuilt dtb file to the tree. That file is the one
that is used for installations.

The patch also enables (re-)generation of the dtb file through maintainer
mode, if it needs to be updated due to a change in the dts file.

Tested on aarch64-linux/x86_64-linux.

sim/moxie/ChangeLog:

2021-04-08  Luis Machado  <luis.machado@linaro.org>

	* Makefile.in (moxie-gdb.dtb): Add maintainer mode dependency.
	(install-dtb): Install prebuilt dtb file.
	* moxie-gdb.dtb: New prebuilt file.
2021-04-08 15:02:14 -03:00
Mike Frysinger
c2783492b6 sim: unify toolchain settings
The toplevel, common, and igen dirs all have their own code for
setting up toolchain settings.  Unify all of that in a new macro.
2021-04-02 23:31:14 -04:00
Mike Frysinger
c25ea03dd6 sim: set up build-time compiler settings
Some sim dirs were already setting up CFLAGS_FOR_BUILD in inconsistent
ways.  Move it to a common place for reuse.
2021-02-28 03:14:59 -05:00
Mike Frysinger
a3e2cc64a6 sim: use AC_CHECK_TOOL to find ar
Rather than require $AR be set and then default to `ar`, use the
standard AC_CHECK_TOOL helper to find a good prefixed tool.  In
practice this shouldn't change much as we seem to have macros in
the tree that were already setting it up, but we shouldn't rely
on that implicitly.
2021-02-28 03:03:44 -05:00
Mike Frysinger
ebe9564b99 sim: require AC_PROG_CPP explicitly
All the scripts were using this implicitly already, so there's no real
change for them, but we want to call it explicitly as the CPP tool is
used to generate nltvals.def.
2021-02-28 02:19:51 -05:00
Mike Frysinger
760b3e8bc9 sim: common: split up acinclude.m4 into individual m4 files
This file is quite large and is getting unmanageable.  Split it apart
to follow aclocal best practices by putting one-macro-per-file.  There
shouldn't be any real functional changes here as can be seen in the
configure script regens.
2021-02-21 02:20:19 -05:00
Mike Frysinger
136da8cd9c sim: switch to AC_CONFIG_MACRO_DIRS
Rather than hand maintain m4 includes in various autotool files,
use AC_CONFIG_MACRO_DIRS to declare the relevant search paths.
This simplifies the code, makes it more robust, and cleans out
unused logic from configure.
2021-02-13 00:24:20 -05:00
Mike Frysinger
4c0d76b9c4 sim: watchpoints: use common sim_pc_get
Few arches implement STATE_WATCHPOINTS()->pc while all of them implement
sim_pc_get.  Lets switch the sim-watch core for monitoring pc events to
the sim_pc_get API so this module works for all ports, and then we can
delete this old back channel of snooping in the port's cpu state -- the
code needs the pointer to the pc storage so that it can read out bytes
and compare them to the watchrange.

This also fixes the logic on multi-cpu sims by removing the limitation
of only being able to watch CPU0's state.
2021-02-06 12:12:51 -05:00
Mike Frysinger
7a36eeea26 sim: common: switch AC_CONFIG_HEADERS
The AC_CONFIG_HEADER macro is long deprecated, so switch to the
newer form.  This also gets rid of the position limitation, and
drops support for an argument to SIM_AC_COMMON which we haven't
used anywhere.
2021-02-06 12:00:42 -05:00
Mike Frysinger
aa09469fc6 sim: drop use of bfd/configure.host
These settings might have made sense in darker compiler times, but I
think they're largely obsolete now.  Looking through the values that
get used in HDEFINES, it's quite limited, and configure itself should
handle them.  If we still need something, we can leverage standard
autoconf macros instead, after we get a clear user report.

TDEFINES was never set anywhere and was always empty, so prune that.
2021-02-06 10:56:11 -05:00
Mike Frysinger
3c811346e9 sim: moxie: cleanup build warnings
This port only had one minor warning left in it, so fix it and then
enable -Werror behavior by deleting the macro call.  We'll use the
common default now (which is -Werror).
2021-01-31 12:06:29 -05:00
Mike Frysinger
d4e3adda12 sim: watchpoints: change sizeof_pc to sizeof(sim_cia)
Existing ports already have sizeof_pc set to the same size as sim_cia,
so simply make that part of the core code.  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.

There is code to allow sims to pick different register word sizes from
address sizes, but most ports use the defaults for both (32-bits), and
the few that support multiple register sizes never change the address
size (so address defaults to register).  I can't think of any machine
where the register hardware size would be larger than the address word
size either.  We have ABIs that behave that way (e.g. x32), but the
hardware is still equivalent register sized.
2021-01-30 10:14:21 -05:00
Mike Frysinger
68ed285428 sim: clean up C11 header includes
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-11 08:05:54 -05:00
Mike Frysinger
50df264dae sim: clean up stale AC_PREREQ refs
This was purged from the tree when we upgraded to autoconf-2.69,
but a few references in the sim tree were missed.
2021-01-09 09:27:29 -05:00
Mike Frysinger
bf470982f9 sim: enable -Werror by default for some arches
We've had this off for a long time because the sim code was way too
full of warnings for it to be feasible.  However, I've cleaned things
up significantly from when this was first merged, and we can start to
turn this around.

Change the macro to enable -Werror by default, and allow ports to opt
out.  New ports will get it automatically (and we can push back on
them if they try to turn it off).

Also turn it off for the few ports that still hit warnings for me.
All the rest will get the new default, and we'll wait for feedback
if/when new issues come up.
2021-01-09 09:19:37 -05:00
Mike Frysinger
46f900c065 sim: require a C11 compiler
With GDB requiring a C++11 compiler now, this hopefully shouldn't
be a big deal.  It's been 10 years since C11 came out, so should
be plenty of time to upgrade.

This will allow us to start cleaning up random header logic and
many of our non-standard custom types.
2021-01-08 15:45:42 -05:00
Mike Frysinger
dfb856ba26 sim: update bug URI to https:// 2021-01-04 18:14:37 -05:00
Joel Brobecker
3666a04883 Update copyright year range in all GDB files
This commits the result of running gdb/copyright.py as per our Start
of New Year procedure...

gdb/ChangeLog

        Update copyright year range in copyright header of all GDB files.
2021-01-01 12:12:21 +04:00
Joel Brobecker
b811d2c292 Update copyright year range in all GDB files.
gdb/ChangeLog:

        Update copyright year range in all GDB files.
2020-01-01 10:20:53 +04:00
Anthony Green
fb46334198 Add unlink support to moxie simulator
This change adds support for the unlink system call, which is
required by the GCC testsuite.  It also switches read/write/open
system calls to use the sim_io_* functions.

2019-12-14  Anthony Green  <green@moxielogic.com>

	* interp.c (sim_engine_run): Make use of sim_io_* functions for
	read/write/open system calls.  Implement the unlink system call.
2019-12-14 05:33:39 -05:00
Joel Brobecker
42a4f53d2b Update copyright year range in all GDB files.
This commit applies all changes made after running the gdb/copyright.py
script.

Note that one file was flagged by the script, due to an invalid
copyright header
(gdb/unittests/basic_string_view/element_access/char/empty.cc).
As the file was copied from GCC's libstdc++-v3 testsuite, this commit
leaves this file untouched for the time being; a patch to fix the header
was sent to gcc-patches first.

gdb/ChangeLog:

	Update copyright year range in all GDB files.
2019-01-01 10:01:51 +04:00
Simon Marchi
d0ac1c4488 Bump to autoconf 2.69 and automake 1.15.1
When trying to run the update-gnulib.sh script in gdb, I get this:

Error: Wrong automake version (Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ([^      =:+{}]+)}/ at /opt/automake/1.11.1/bin/automake line 4113.), we need 1.11.1.
Aborting.

Apparently, it's an issue with a regex in automake that triggers a
warning starting with Perl 5.22.  It has been fixed in automake 1.15.1.
So I think it's a good excuse to bump the versions of autoconf and
automake used in the gnulib import.  And to avoid requiring multiple
builds of autoconf/automake, it was suggested that we bump the required
version of those tools for all binutils-gdb.

For autoconf, the 2.69 version is universally available, so it's an easy
choice.  For automake, different distros and distro versions have
different automake versions.  But 1.15.1 seems to be the most readily
available as a package.  In any case, it's easy to build it from source.

I removed the version checks from AUTOMAKE_OPTIONS and AC_PREREQ,
because I don't think they are useful in our case.  They only specify a
lower bound for the acceptable version of automake/autoconf.  That's
useful if you let the user choose the version of the tool they want to
use, but want to set a minimum version (because you use a feature that
was introduced in that version).  In our case, we force people to use a
specific version anyway.  For the autoconf version, we have the check in
config/override.m4 that enforces the version we want.  It will be one
less thing to update next time we change autotools version.

I hit a few categories of problems that required some changes.  They are
described below along with the chosen solutions.

Problem 1:

  configure.ac:17: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
  configure.ac:17: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation

Solution 1:

  Adjust the code based on the example at that URL.

Problem 2 (in zlib/):

  Makefile.am: error: required file './INSTALL' not found
  Makefile.am:   'automake --add-missing' can install 'INSTALL'
  Makefile.am: error: required file './NEWS' not found
  Makefile.am: error: required file './AUTHORS' not found
  Makefile.am: error: required file './COPYING' not found
  Makefile.am:   'automake --add-missing' can install 'COPYING'

Solution 2:

  Add the foreign option to AUTOMAKE_OPTIONS.

Problem 3:

  doc/Makefile.am:20: error: support for Cygnus-style trees has been removed

Solution 3:

  Remove the cygnus options.

Problem 4:

  Makefile.am:656: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')

Solution 4:

  Rename "INCLUDES = " to "AM_CPPFLAGS += " (because AM_CPPFLAGS is
  already defined earlier).

Problem 5:

  doc/Makefile.am:71: warning: suffix '.texinfo' for Texinfo files is discouraged; use '.texi' instead
  doc/Makefile.am: warning: Oops!
  doc/Makefile.am:     It appears this file (or files included by it) are triggering
  doc/Makefile.am:     an undocumented, soon-to-be-removed automake hack.
  doc/Makefile.am:     Future automake versions will no longer place in the builddir
  doc/Makefile.am:     (rather than in the srcdir) the generated '.info' files that
  doc/Makefile.am:     appear to be cleaned, by e.g. being listed in CLEANFILES or
  doc/Makefile.am:     DISTCLEANFILES.
  doc/Makefile.am:     If you want your '.info' files to be placed in the builddir
  doc/Makefile.am:     rather than in the srcdir, you have to use the shiny new
  doc/Makefile.am:     'info-in-builddir' automake option.

Solution 5:

  Rename .texinfo files to .texi.

Problem 6:

  doc/Makefile.am: warning: Oops!
  doc/Makefile.am:     It appears this file (or files included by it) are triggering
  doc/Makefile.am:     an undocumented, soon-to-be-removed automake hack.
  doc/Makefile.am:     Future automake versions will no longer place in the builddir
  doc/Makefile.am:     (rather than in the srcdir) the generated '.info' files that
  doc/Makefile.am:     appear to be cleaned, by e.g. being listed in CLEANFILES or
  doc/Makefile.am:     DISTCLEANFILES.
  doc/Makefile.am:     If you want your '.info' files to be placed in the builddir
  doc/Makefile.am:     rather than in the srcdir, you have to use the shiny new
  doc/Makefile.am:     'info-in-builddir' automake option.

Solution 6:

  Remove the hack at the bottom of doc/Makefile.am and use
  the info-in-builddir automake option.

Problem 7:

  doc/Makefile.am:35: error: required file '../texinfo.tex' not found
  doc/Makefile.am:35:   'automake --add-missing' can install 'texinfo.tex'

Solution 7:

  Use the no-texinfo.tex automake option.  We also have one in
  texinfo/texinfo.tex, not sure if we should point to that, or move it
  (or a newer version of it added with automake --add-missing) to
  top-level.

Problem 8:

  Makefile.am:131: warning: source file 'config/tc-aarch64.c' is in a subdirectory,
  Makefile.am:131: but option 'subdir-objects' is disabled
  automake: warning: possible forward-incompatibility.
  automake: At least a source file is in a subdirectory, but the 'subdir-objects'
  automake: automake option hasn't been enabled.  For now, the corresponding output
  automake: object file(s) will be placed in the top-level directory.  However,
  automake: this behaviour will change in future Automake versions: they will
  automake: unconditionally cause object files to be placed in the same subdirectory
  automake: of the corresponding sources.
  automake: You are advised to start using 'subdir-objects' option throughout your
  automake: project, to avoid future incompatibilities.

Solution 8:

  Use subdir-objects, that means adjusting references to some .o that will now
  be in config/.

Problem 9:

  configure.ac:375: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
  ../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
  ../../lib/autoconf/general.m4:2601: _AC_COMPILE_IFELSE is expanded from...
  ../../lib/autoconf/general.m4:2617: AC_COMPILE_IFELSE is expanded from...
  ../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from...
  ../../lib/autoconf/general.m4:2042: AC_CACHE_VAL is expanded from...
  ../../lib/autoconf/general.m4:2063: AC_CACHE_CHECK is expanded from...
  configure.ac:375: the top level

Solution 9:

  Use AC_LANG_SOURCE, or use proper quoting.

Problem 10 (in intl/):

  configure.ac:7: warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
  /usr/share/aclocal/threadlib.m4:36: gl_THREADLIB_EARLY_BODY is expanded from...
  /usr/share/aclocal/threadlib.m4:29: gl_THREADLIB_EARLY is expanded from...
  /usr/share/aclocal/threadlib.m4:318: gl_THREADLIB is expanded from...
  /usr/share/aclocal/lock.m4:9: gl_LOCK is expanded from...
  /usr/share/aclocal/intl.m4:211: gt_INTL_SUBDIR_CORE is expanded from...
  /usr/share/aclocal/intl.m4:25: AM_INTL_SUBDIR is expanded from...
  /usr/share/aclocal/gettext.m4:57: AM_GNU_GETTEXT is expanded from...
  configure.ac:7: the top level

Solution 10:

  Add AC_USE_SYSTEM_EXTENSIONS in configure.ac.

ChangeLog:

	* libtool.m4: Use AC_LANG_SOURCE.
	* configure.ac: Remove AC_PREREQ, use AC_LANG_SOURCE.
	* README-maintainer-mode: Update version requirements.
	* ar-lib: New file.
	* test-driver: New file.
	* configure: Re-generate.

bfd/ChangeLog:

	* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11.
	(INCLUDES): Rename to ...
	(AM_CPPFLAGS): ... this.
	* configure.ac: Remove AC_PREREQ.
	* doc/Makefile.am (AUTOMAKE_OPTIONS): Remove 1.9, cygnus, add
	info-in-builddir no-texinfo.tex.
	(info_TEXINFOS): Rename bfd.texinfo to bfd.texi.
	* doc/bfd.texinfo: Rename to ...
	* doc/bfd.texi: ... this.
	* Makefile.in: Re-generate.
	* aclocal.m4: Re-generate.
	* config.in: Re-generate.
	* configure: Re-generate.
	* doc/Makefile.in: Re-generate.

binutils/ChangeLog:

	* configure.ac: Remove AC_PREREQ.
	* doc/Makefile.am (AUTOMAKE_OPTIONS): Remove cygnus, add
	info-in-builddir no-texinfo.tex.
	* Makefile.in: Re-generate.
	* aclocal.m4: Re-generate.
	* config.in: Re-generate.
	* configure: Re-generate.
	* doc/Makefile.in: Re-generate.

config/ChangeLog:

	* override.m4 (_GCC_AUTOCONF_VERSION): Bump from 2.64 to 2.69.

etc/ChangeLog:

	* configure.in: Remove AC_PREREQ.
	* configure: Re-generate.

gas/ChangeLog:

	* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11, add subdir-objects.
	(TARG_CPU_O, OBJ_FORMAT_O, ATOF_TARG_O): Add config/ prefix.
	* configure.ac (TARG_CPU_O, OBJ_FORMAT_O, ATOF_TARG_O, emfiles,
	extra_objects): Add config/ prefix.
	* doc/as.texinfo: Rename to...
	* doc/as.texi: ... this.
	* doc/Makefile.am: Rename as.texinfo to as.texi throughout.
	Remove DISTCLEANFILES hack.
	(AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add no-texinfo.tex and
	info-in-builddir.
	* Makefile.in: Re-generate.
	* aclocal.m4: Re-generate.
	* config.in: Re-generate.
	* configure: Re-generate.
	* doc/Makefile.in: Re-generate.

gdb/ChangeLog:

	* common/common-defs.h (PACKAGE_NAME, PACKAGE_VERSION,
	PACKAGE_STRING, PACKAGE_TARNAME): Undefine.
	* configure.ac: Remove AC_PREREQ, add missing quoting.
	* gnulib/configure.ac: Modernize usage of
	AC_INIT/AM_INIT_AUTOMAKE.  Remove AC_PREREQ.
	* gnulib/update-gnulib.sh (AUTOCONF_VERSION): Bump to 2.69.
	(AUTOMAKE_VERSION): Bump to 1.15.1.
	* configure: Re-generate.
	* config.in: Re-generate.
	* aclocal.m4: Re-generate.
	* gnulib/aclocal.m4: Re-generate.
	* gnulib/config.in: Re-generate.
	* gnulib/configure: Re-generate.
	* gnulib/import/Makefile.in: Re-generate.

gdb/gdbserver/ChangeLog:

	* configure.ac: Remove AC_PREREQ, add missing quoting.
	* configure: Re-generate.
	* config.in: Re-generate.
	* aclocal.m4: Re-generate.

gdb/testsuite/ChangeLog:

	* configure.ac: Remove AC_PREREQ.
	* configure: Re-generate.

gold/ChangeLog:

	* configure.ac: Remove AC_PREREQ, add missing quoting and usage
	of AC_LANG_SOURCE.
	* Makefile.in: Re-generate.
	* aclocal.m4: Re-generate.
	* configure: Re-generate.
	* testsuite/Makefile.in: Re-generate.

gprof/ChangeLog:

	* configure.ac: Remove AC_PREREQ.
	* Makefile.am: Remove DISTCLEANFILES hack.
	(AUTOMAKE_OPTIONS): Remove 1.11, add info-in-builddir.
	* Makefile.in: Re-generate.
	* aclocal.m4: Re-generate.
	* configure: Re-generate.
	* gconfig.in: Re-generate.

intl/ChangeLog:

	* configure.ac: Add AC_USE_SYSTEM_EXTENSIONS, remove AC_PREREQ.
	* configure: Re-generate.
	* config.h.in: Re-generate.
	* aclocal.m4: Re-generate.

ld/ChangeLog:

	* configure.ac: Remove AC_PREREQ.
	* Makefile.am: Remove DISTCLEANFILES hack, rename ld.texinfo to
	ld.texi, ldint.texinfo to ldint.texi throughout.
	(AUTOMAKE_OPTIONS): Add info-in-builddir.
	* README: Rename ld.texinfo to ld.texi, ldint.texinfo to
	ldint.texi throughout.
	* gen-doc.texi: Likewise.
	* h8-doc.texi: Likewise.
	* ld.texinfo: Rename to ...
	* ld.texi: ... this.
	* ldint.texinfo: Rename to ...
	* ldint.texi: ... this.
	* Makefile.in: Re-generate.
	* aclocal.m4: Re-generate.
	* config.in: Re-generate.
	* configure: Re-generate.

libdecnumber/ChangeLog:

	* configure.ac: Remove AC_PREREQ.
	* configure: Re-generate.
	* aclocal.m4.

libiberty/ChangeLog:

	* configure.ac: Remove AC_PREREQ.
	* configure: Re-generate.
	* config.in: Re-generate.

opcodes/ChangeLog:

	* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in: Re-generate.
	* aclocal.m4: Re-generate.
	* configure: Re-generate.

readline/ChangeLog.gdb:

	* configure: Re-generate.
	* examples/rlfe/configure: Re-generate.

sim/ChangeLog:

	* All configure.ac: Remove AC_PREREQ.
	* All configure: Re-generate.

zlib/ChangeLog.bin-gdb:

	* configure.ac: Modernize AC_INIT call, remove AC_PREREQ.
	* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add
	foreign.
	* Makefile.in: Re-generate.
	* aclocal.m4: Re-generate.
	* configure: Re-generate.
2018-06-19 16:55:06 -04:00
Simon Marchi
37f980dc03 config: Sync with GCC
... and re-generate all possible configure files, since they may depend
on things in config/.

config/ChangeLog:

	Sync with GCC
	2018-06-08  Martin Liska  <mliska@suse.cz>

	* bootstrap-mpx.mk: Remove.

	2018-05-10  Martin Liska  <mliska@suse.cz>

	PR bootstrap/64914
	* bootstrap-ubsan.mk: Define UBSAN_BOOTSTRAP.

	2018-05-09  Joshua Watt <jpewhacker@gmail.com>

        * ax_pthread.m4: Add file.

	2018-05-08  Richard Biener  <rguenther@suse.de>

	PR bootstrap/85571
	* bootstrap-lto-noplugin.mk: Disable compare.
	* bootstrap-lto.mk: Supply contrib/compare-lto for do-compare.

	2018-04-24  H.J. Lu  <hongjiu.lu@intel.com>

	PR bootstrap/85490
	* bootstrap-cet.mk (STAGE4_CFLAGS): New.

	2018-04-24  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/85485
	* bootstrap-cet.mk (STAGE2_CFLAGS): Remove -mcet.
	(STAGE3_CFLAGS): Likewise.

	2018-04-24  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/85485
	* cet.m4 (GCC_CET_FLAGS): Replace -mcet with -mshstk.

	2018-04-19  Jakub Jelinek  <jakub@redhat.com>

	* cet.m4 (GCC_CET_FLAGS): Default to --disable-cet, replace
	--enable-cet=default with --enable-cet=auto.

	2018-04-18  David Malcolm  <dmalcolm@redhat.com>

	PR jit/85384
	* acx.m4 (GCC_BASE_VER): Remove \$\$ from sed expression.
2018-06-18 09:33:48 -04:00
Joel Brobecker
e2882c8578 Update copyright year range in all GDB files
gdb/ChangeLog:

        Update copyright year range in all GDB files
2018-01-02 07:38:06 +04:00
John Baldwin
5c887dd5f6 Honor an existing CC_FOR_BUILD in the environment for sim.
This matches the equivalent bits in bfd/acinclude.m4

sim/ChangeLog:

	* configure.ac: Honor existing CC_FOR_BUILD in environment.
	* configure: Regenerate.

sim/aarch64/ChangeLog:

	* configure: Regenerate.

sim/arm/ChangeLog:

	* configure: Regenerate.

sim/avr/ChangeLog:

	* configure: Regenerate.

sim/bfin/ChangeLog:

	* configure: Regenerate.

sim/common/ChangeLog:

	* acinclude.m4 (SIM_AC_COMMON) Honor existing CC_FOR_BUILD in
	environment.

sim/cr16/ChangeLog:

	* configure: Regenerate.

sim/cris/ChangeLog:

	* configure: Regenerate.

sim/d10v/ChangeLog:

	* configure: Regenerate.

sim/erc32/ChangeLog:

	* configure: Regenerate.

sim/frv/ChangeLog:

	* configure: Regenerate.

sim/ft32/ChangeLog:

	* configure: Regenerate.

sim/h8300/ChangeLog:

	* configure: Regenerate.

sim/iq2000/ChangeLog:

	* configure: Regenerate.

sim/lm32/ChangeLog:

	* configure: Regenerate.

sim/m32c/ChangeLog:

	* configure: Regenerate.

sim/m32r/ChangeLog:

	* configure: Regenerate.

sim/m68hc11/ChangeLog:

	* configure: Regenerate.

sim/mcore/ChangeLog:

	* configure: Regenerate.

sim/microblaze/ChangeLog:

	* configure: Regenerate.

sim/mips/ChangeLog:

	* configure: Regenerate.

sim/mn10300/ChangeLog:

	* configure: Regenerate.

sim/moxie/ChangeLog:

	* configure: Regenerate.

sim/msp430/ChangeLog:

	* configure: Regenerate.

sim/rl78/ChangeLog:

	* configure: Regenerate.

sim/rx/ChangeLog:

	* configure: Regenerate.

sim/sh/ChangeLog:

	* configure: Regenerate.

sim/sh64/ChangeLog:

	* configure: Regenerate.

sim/v850/ChangeLog:

	* configure: Regenerate.
2017-09-06 10:16:12 -07:00
Anthony Green
6c869779da Fix simulator 2017-09-04 10:00:37 -04:00
Joel Brobecker
61baf725ec update copyright year range in GDB files
This applies the second part of GDB's End of Year Procedure, which
updates the copyright year range in all of GDB's files.

gdb/ChangeLog:

        Update copyright year range in all GDB files.
2017-01-01 10:52:34 +04: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
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
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
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
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
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
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
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
e1211e5506 sim: arm/d10v/h8300/m68hc11/microblaze/mips/mn10300/moxie/sh/v850: convert to common sim_{fetch,store}_register 2015-12-30 03:30:25 -05:00
Mike Frysinger
5e744ef887 sim: unify sim-hload
Pretty much all targets are using this module already, so add it to the
common list of objects.  The only oddball out here is cris and that's
because it supports loading via an offset for all the phdrs.  We drop
support for that.
2015-12-27 00:54:41 -05:00
Mike Frysinger
1b393626ce sim: punt WITH_DEVICES & tconfig.h support
No arch is using this anymore, and we want all new ports using the
hardware framework instead.  Punt WITH_DEVICES and the two callbacks
device_io_{read,write}_buffer.

We can also punt the tconfig.h file as no port is using it anymore.
This fixes in-tree builds that get confused by picking up the wrong
one (common/ vs <port>/) caused by commit ae7d0cac8c.

Any port that needs to set up a global define can use their own
sim-main.h file that they must provide regardless.
2015-12-26 20:38:31 -05:00
Mike Frysinger
797eee4264 sim: sim-stop/sim-reason/sim-reg: move to common obj list
Now that all arches (for the most part) have moved over, move sim-stop.o,
sim-reason.o, and sim-reg.o to the common object list and out of all the
arch ports.
2015-11-16 00:41:59 -05:00
Mike Frysinger
6e4f085c7f sim: sim-close: unify sim_close logic
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-15 02:30:19 -05:00
Mike Frysinger
7d8a636c9a sim: moxie: fix leakage in error path [BZ #18273]
Reported-by: dcb <dcb314@hotmail.com>
2015-10-11 03:56:22 -04:00
H.J. Lu
72f4393d8c Remove leading/trailing white spaces in ChangeLog 2015-07-24 04:16:47 -07:00
Mike Frysinger
8d0978fb4b sim: use AS_HELP_STRING everywhere
This helps standardize the configure --help output.
2015-06-23 15:02:08 -04:00
Mike Frysinger
306f4178ef sim: update configure.in->configure.ac docs
A few places still refer to the configure.in file; update them.
2015-06-12 12:11:21 -04:00
Mike Frysinger
a348708291 sim: drop -DTRACE from configure
No code uses this anymore and the symbol conflicts with the new TRACE
helper.  Punt it from configure.
2015-06-12 10:40:46 -04:00
Mike Frysinger
0054dcd7b6 sim: moxie: use new common trace defines
Now that there's common helpers for printing trace data, switch to that
to restore the insn tracing support for this target.
2015-06-12 06:57:44 -04:00
Mike Frysinger
53d2389fd0 sim: moxie: rename TRACE to MOXIE_TRACE_INSN
We want to add new common trace helpers including "TRACE", so rename the
moxie one to MOXIE_TRACE_INSN.  This also matches what the code is doing.
2015-06-12 06:16:39 -04:00
Mike Frysinger
20bca71d82 sim: unify SIM_CPU definition
Since every target typedefs this the same way, move it to the common code.

We have to leave Blackfin behind here for now because of inter-dependencies
on types and headers: sim-base.h includes sim-model.h which needs types in
machs.h which needs types in bfim-sim.h which needs SIM_CPU.
2015-04-18 04:31:36 -04:00
Mike Frysinger
7e83aa92f2 sim: unify sim_cia definition
Almost every target defines sim_cia the same way -- either using the
address_word type directly, or a type of equivalent size.  The only
odd one out is sh64 (who has 32bit address_word and 64bit cia), and
even that case doesn't seem to make sense.  We'll put off clean up
though of sh64 and at least set up a sensible default for everyone.
2015-04-18 04:14:38 -04:00
Mike Frysinger
034685f9ce sim: replace CIA_{GET,SET} with CPU_PC_{GET,SET}
The CIA_{GET,SET} macros serve the same function as CPU_PC_{GET,SET}
except the latter adds a layer of indirection via the sim state.  This
lets models set up different functions at runtime and doesn't reach so
directly into the arch-specific cpu state.

It also doesn't make sense to have two sets of macros that do exactly
the same thing, so lets standardize on the one that gets us more.
2015-04-17 02:44:30 -04:00
Mike Frysinger
4c0cab1e21 sim: avr/mcore/moxie: fill out sim-cpu pc fetch/store helpers
This makes the common sim-cpu logic work.
2015-04-16 02:13:50 -04:00
Mike Frysinger
78e9aa70fe sim: unify sim-cpu usage
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-15 02:19:52 -04:00
Mike Frysinger
bf12d44ee0 sim: fix the PKGVERSION define
This should be SIM, not GDB.
2015-04-13 02:41:10 -04:00
Mike Frysinger
122bbfb52a sim: move sim-engine.o/sim-hrw.o to the common list
This makes these two objects available to all sims by default.
2015-04-06 23:56:47 -04:00
Mike Frysinger
20cc975360 sim: moxie: fix running after nrun conversion
The nrun conversion was slightly incorrect in how it stopped when an
exception occurred.  We still set cpu.asregs.exception, but nothing
was checking it anymore.  Convert all of that to sim_engine_halt.

To keep things from regressing again, add a basic testsuite too.
2015-04-05 04:37:44 -04:00
H.J. Lu
7fed4b0be6 Regenerate configure in sim
* 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-02 05:43:07 -07:00
H.J. Lu
0ceaf1ec96 Regenerate configure in sim
* 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-01 10:15:13 -07:00
Mike Frysinger
0fe84f3fbe sim: run: punt!
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-01 01:22:44 -04:00
Mike Frysinger
aadc9410ba sim: update zlib handling
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-04-01 01:07:57 -04:00
Mike Frysinger
1bf57e9a2e sim: moxie: clean up build time warnings 2015-03-24 01:14:28 -04:00
Mike Frysinger
cc8ab1ded5 sim: moxie: convert to nrun.o
This port already used a lot of common/ files, so cutting it over to
nrun.o and using a few more common objects is pretty straight forward.
2015-03-24 01:08:56 -04:00
Mike Frysinger
c4a6006b2e sim: moxie: switch to common sim-command.o 2015-03-24 00:42:37 -04:00
Mike Frysinger
ae7d0cac8c sim: rename tconfig.in to tconfig.h
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-16 01:23:52 -04:00
Mike Frysinger
41cc895fc8 sim: mcore/moxie: clean up makefiles a bit
Clean out stub targets and rules that get autogenerated.
2015-03-14 07:46:54 -04:00
Mike Frysinger
465fb143c8 sim: make nrun the default run program
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-14 07:02:58 -04:00
Mike Frysinger
5cddc23a3a sim: drop duplicate header checks
The SIM_AC_COMMON macro already checks for a bunch of headers, so specific
sim ports need not do it themselves.
2015-03-14 06:04:29 -04:00
Mike Frysinger
dc049bf460 sim: drop unused headers
These look like left over hacks from the days where we had to protect
ourselves from the compiler and C library.  None of these checks are
relevant, and we have common configure logic to do header tests.  Punt
them all now.
2015-02-20 00:16:14 -05:00
Mike Frysinger
4c4ca605d5 sim: drop unused sim_kill function
This has been deprecated for a long time and no one calls it.
2015-02-19 20:42:14 -05:00
Joel Brobecker
32d0add0a6 Update year range in copyright notice of all files owned by the GDB project.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2015-01-01 13:32:14 +04:00
Anthony Green
507411ccab Update sto/ldo implementations with 16 bit offsets 2014-12-27 18:19:49 -05:00