Age | Commit message (Collapse) | Author | Files | Lines |
|
The rest of the binutils tree renamed this variable many years ago.
|
|
These use the same pattern as seen in the opcodes/ dir and in automake
in general (ish). This helps simplify the boilerplate for building and
linking build-time code, and fixes some inconsistency in flag usage.
For rules that were compiling+linking in a single step, split them into
separate steps so we can apply the correct set of options. This matches
automake behavior too.
|
|
This allows us to delete most of our custom test logic,
and avoids a recursive make for minor speed up.
|
|
This was last used 15 years ago, so clearly not important enough to
keep around. Punt it.
|
|
We don't need a variable to add a dependency to the "all" target, and
having one doesn't really add value. Switch to the target directly for
the few ports that actually use this.
|
|
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.
|
|
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.
|
|
This was missed when we deleted the common/configure build logic.
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
This is a hand-written implementation that should have fairly complete
coverage for the base integer instruction set ("i"), and for the atomic
("a") and integer multiplication+division ("m") extensions. It also
covers 32-bit & 64-bit targets.
The unittest coverage is a bit weak atm, but should get better.
|
|
GCC warns that we pass a non-string literal as the format string,
so add an explicit "%s" to make it happy.
|
|
When compiling we get the following warnings:
common/cgen-accfp.c: In function 'fixsfsi':
common/cgen-accfp.c:370:18: warning: pointer targets in passing argument 1 of 'sim_fpu_to32i' differ in signedness [-Wpointer-sign]
sim_fpu_to32i (&res, &op1, sim_fpu_round_near);
^
common/cgen-accfp.c: In function 'fixdfsi':
common/cgen-accfp.c:381:18: warning: pointer targets in passing argument 1 of 'sim_fpu_to32i' differ in signedness [-Wpointer-sign]
sim_fpu_to32i (&res, &op1, sim_fpu_round_near);
^
|
|
This tool is only run by developers and not in a release build,
so rewrite it in Python to make it more maintainable.
|
|
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.
|
|
When the target's PC is 64-bits, this shift expands into a range of
8 * 8 - 1 which doesn't work with 32-bit constants. Force it to be
a 64-bit value all the time and let the compiler truncate it.
|
|
This avoids fixed sized buffers on the stack.
|
|
This was largely already done, but I think people didn't quite notice.
|
|
We don't use the host & target aliases, so don't bother emitting them.
|
|
This was mostly orphaned a while back, but left behind so people could
still run `make headers`. Merge that one target to the top sim dir and
delete all the build logic. This should avoid confusing people further.
|
|
It's not 1996 anymore, so stop writing shell code like it is, and
rewrite it with modern POSIX shell standards. This makes it much
more user friendly.
Then regenerate the file with latest newlib sources to verify.
|
|
The default watchpoint handler is NULL. That means any port that
sets the STATE_WATCHPOINTS->pc field will crash if you try to use
the --watch options but don't configure the interrupt handler. In
the past, you had to setup STATE_WATCHPOINTS->pc if you wanted to
support PC profiling, and while that was fixed a while ago, we have
a lot of ports who still configure it.
We already add a default set of interrupts (just "int") if the port
doesn't define any. Let's also add a default handler that raises a
SIGTRAP. When connected to gdb, this is a breakpoint which is what
people would expect. When running standalone, it'll abort the sim,
but it's unclear whether there's anything better to do there. This
really is just to make the watchpoint module more usable out of the
box for most ports with very little setup, at least inside of gdb.
|
|
The code supports a <start>[,<end>] syntax, but the logic for handling
the <end> check was broken: it would detect the first byte was ",", but
then include that in the strtoul call meaning the result is always 0.
Further, it (re)assigned to arg0 when it meant arg1 which means this
code always processed a range expression as 0,0. Oops.
|
|
My change 1ac72f0659d64d6a14da862242db0d841d2878d0 ("sim: convert to
bfd_endian") subtly broke the watchpoint module on little endian host
systems. The old code used 0 to mean "whatever the host endian is",
and while that was changed to use BFD_ENDIAN_UNKNOWN, this caller was
missed. Since its API used an int instead of an enum, the coercion
from 0 to the BFD endian enum was silently missed, and 0 happens to
be BFD_ENDIAN_BIG.
Instead of restoring the old logic by passing in BFD_ENDIAN_UNKNOWN,
we know the right host endian at compile time, so use that directly.
|
|
|
|
Now that all ports have opted in to this, we can require it in the
core. It guarantees that new ports have them turned on, and defaults
to -Werror in the hopes that new ports keep their code clean from the
start. We do this as a sep commit to make it clear that there are no
changes to existing ports as they've all explicitly called it already.
|
|
For 32-bit targets, %x happens to work for unsigned_word. But for
64-bit targets, it's too small, and gcc throws an error. Use the
right printf format define for them.
|
|
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.
|
|
Delete stale prototypes that libiberty.h already provides, and add
missing libiberty.h includes to files that use those functions.
|
|
This was purged from the tree when we upgraded to autoconf-2.69,
but a few references in the sim tree were missed.
|
|
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.
|
|
Newer gcc thinks we might return a pointer to a stack buffer, but
we don't -- we strdup it before returning. Rework the code to just
malloc the buffer from the start and avoid the stack+strdup.
|
|
|
|
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.
|
|
This allows gdb to quickly dump & process the memory map that the sim
knows about. This isn't fully accurate, but is largely limited by the
gdb memory map format. While the sim supports RWX bits, gdb can only
handle RW or RO regions.
|
|
|
|
This mirrors gdb behavior of dumping extra info when being run in
interactive mode. It also gives us an excuse to use the otherwise
unused sim_print_config.
|
|
Meant to push this variant where naming preference is given to the
module the code resides in rather than the operation it performs.
|
|
This mirrors the existing sim_print_help function, and the behavior
of all other GNU tools with their --version.
|
|
print_sim_config has never been used anywhere, so rename it to follow
the sim_* naming style for all other symbols we export.
|
|
We have ALIGN_{8,16,PAGE} and FLOOR_PAGE macros (where PAGE is defined as
4k) which were imported from the ppc sim. But no other sim utilizes these
and hardcoding the sizes in the name is a bit limiting.
Let's delete these and import the two general macros that gdb uses:
align_up(addr, bytes)
align_down(addr, bytes)
This in turn allows us to cut over the Blackfin code immediately.
|
|
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.
|
|
When running gdb/gdb_mbuild.sh, I run into:
...
src/sim/aarch64/../common/sim-cpu.c: In function 'sim_cpu_free':
src/sim/aarch64/../common/sim-cpu.c:64:3: error: implicit declaration of \
function 'free' [-Werror=implicit-function-declaration]
free (cpu);
^~~~
src/sim/aarch64/../common/sim-cpu.c:64:3: error: incompatible implicit \
declaration of built-in function 'free' [-Werror]
src/sim/aarch64/../common/sim-cpu.c:64:3: note: include '<stdlib.h>' or \
provide a declaration of 'free'
...
Fix this by adding "#include <stdlib.h>".
Tested by gdb/gdb_mbuild.sh -e aarch64-elf.
sim/common/ChangeLog:
2020-08-10 Tom de Vries <tdevries@suse.de>
* sim-cpu.c: Include stdlib.h for free.
|
|
When trying to compile GDB with --target=avr, with gcc 9.2.0, I am
getting a bunch of:
/home/simark/src/binutils-gdb/sim/avr/../common/nrun.c:94:7: error: implicit declaration of function ‘abort’ [-Werror=implicit-function-declaration]
94 | abort ();
| ^~~~~
/home/simark/src/binutils-gdb/sim/avr/../common/nrun.c:94:7: error: incompatible implicit declaration of built-in function ‘abort’ [-Werror]
/home/simark/src/binutils-gdb/sim/avr/../common/nrun.c:94:7: note: include ‘<stdlib.h>’ or provide a declaration of ‘abort’
I did what the compiler told me and added the relevant includes in the
problematic files.
sim/common/ChangeLog:
* nrun.c: Include stdlib.h.
* sim-core.c: Likewise.
* sim-engine.c: Likewise.
* sim-io.c: Likewise.
* sim-module.c: Likewise.
* sim-reason.c: Likewise.
|
|
gdb/ChangeLog:
Update copyright year range in all GDB files.
|
|
PR build/24572 notes that "make install-strip" fails. For me, it
works in every directory except "sim", so this patch adds
install-strip targets to the Makefiles that appear there.
sim/ChangeLog
2019-12-19 Tom Tromey <tromey@adacore.com>
PR build/24572:
* Makefile.in (install-strip): New target.
sim/common/ChangeLog
2019-12-19 Tom Tromey <tromey@adacore.com>
PR build/24572:
* Makefile.in (install-strip): New target.
sim/igen/ChangeLog
2019-12-19 Tom Tromey <tromey@adacore.com>
PR build/24572:
* Makefile.in (install-strip): New target.
sim/ppc/ChangeLog
2019-12-19 Tom Tromey <tromey@adacore.com>
PR build/24572:
* Makefile.in (install-strip): New target.
sim/testsuite/ChangeLog
2019-12-19 Tom Tromey <tromey@adacore.com>
PR build/24572:
* Makefile.in (install-strip): New target.
Change-Id: I76613bc5c7e7812284f33826f8a5d914477fcdc5
|
|
Representation of max 32-bit integer is 10 chars.
The potential issue is observed by GCC 7 targeted to AArch64.
sim/common/ChangeLog:
2019-12-01 Pavel I. Kryukov <kryukov@frtk.ru>
* sim-utils.c: Prevent buffer overflow.
|
|
A simulator port for the TI PRU I/O processor.
v1: https://sourceware.org/ml/gdb-patches/2016-12/msg00143.html
v2: https://sourceware.org/ml/gdb-patches/2017-02/msg00397.html
v3: https://sourceware.org/ml/gdb-patches/2017-02/msg00516.html
v4: https://sourceware.org/ml/gdb-patches/2018-06/msg00484.html
v5: https://sourceware.org/ml/gdb-patches/2019-08/msg00584.html
v6: https://sourceware.org/ml/gdb-patches/2019-09/msg00036.html
gdb/ChangeLog:
* NEWS: Mention new simulator port for PRU.
sim/ChangeLog:
* MAINTAINERS: Add myself as PRU maintainer.
* configure: Regenerated.
* configure.tgt: Add PRU.
sim/common/ChangeLog:
* gennltvals.sh: Add PRU libgloss target.
* nltvals.def: Regenerate from the latest libgloss sources.
sim/pru/ChangeLog:
* Makefile.in: New file.
* aclocal.m4: Regenerated.
* config.in: Regenerated.
* configure: Regenerated.
* configure.ac: New file.
* interp.c: New file.
* pru.h: New file.
* pru.isa: New file.
* sim-main.h: New file.
|