aboutsummaryrefslogtreecommitdiff
path: root/sim/common/sim-config.c
AgeCommit message (Collapse)AuthorFilesLines
2023-01-01Update copyright year range in header of all files managed by GDBJoel Brobecker1-1/+1
This commit is the result of running the gdb/copyright.py script, which automated the update of the copyright year range for all source files managed by the GDB project to be updated to include year 2023.
2022-01-01Automatic Copyright Year update after running gdb/copyright.pyJoel Brobecker1-1/+1
This commit brings all the changes made by running gdb/copyright.py as per GDB's Start of New Year Procedure. For the avoidance of doubt, all changes in this commits were performed by the script.
2021-12-04sim: reorder header includesMike Frysinger1-1/+2
We're including system headers after local headers in a bunch of places, but this leads to conflicts when our local headers happen to define symbols that show up in the system headers. Use the more standard order of: * config.h (via defs.h) * system headers * local library headers (e.g. bfd & libiberty) * sim specific headers
2021-06-17sim: overhaul & unify endian settings managementMike Frysinger1-5/+0
The m4 macro has 2 args: the "wire" settings (which represents the hardwired port behavior), and the default settings (which are used if nothing else is specified). If none are specified, the arch is expected to support both, and the value will be probed based on the user runtime options or the input program. Only two arches today set the default value (bpf & mips). We can probably let this go as it only shows up in one scenario: the sim is invoked, but with no inputs, and no user endian selection. This means bpf will not behave like the other arches: an error is shown and forces the user to make a choice. If an input program is used though, we'll still switch the default to that. This allows us to remove the WITH_DEFAULT_TARGET_BYTE_ORDER setting. For the ports that set a "wire" endian, move it to the runtime init of the respective sim_open calls. This allows us to change the WITH_TARGET_BYTE_ORDER to purely a user-selected configure setting if they want to force a specific endianness. With all the endian logic moved to runtime selection, we can move the configure call up to the common dir so we only process it once across all ports. The ppc arch was picking the wire endian based on the target used, but since we weren't doing that for other biendian arches, we can let this go too. We'll rely on the input selecting the endian, or make the user decide.
2021-06-12sim: overhaul alignment settings managementMike Frysinger1-6/+2
Currently, the sim-config module will abort if alignment settings haven't been specified by the port's configure.ac. This is a bit weird when we've allowed SIM_AC_OPTION_ALIGNMENT to seem like it's optional to use. Thus everyone invokes it. There are 4 alignment settings, but really only 2 matters: strict and nonstrict. The "mixed" setting is just the default ("unset"), and "forced" isn't used directly by anyone (it's available as a runtime option for some ports). The m4 macro has 2 args: the "wire" settings (which represents the hardwired port behavior), and the default settings (which are used if nothing else is specified). If none are specified, then the build won't work (see above as if SIM_AC_OPTION_ALIGNMENT wasn't called). If default settings are provided, then that is used, but we allow the user to override at runtime. Otherwise, the "wire" settings are used and user runtime options to change are ignored. Most ports specify a default, or set the "wire" to nonstrict. A few set "wire" to strict, but it's not clear that's necessary as it doesn't make the code behavior, by default, any different. It might make things a little faster, but we should provide the user the choice of the compromises to make: force a specific mode at compile time for faster runtime, or allow the choice at runtime. More likely it seems like an oversight when these ports were initially created, and/or copied & pasted from existing ports. With all that backstory, let's get to what this commit does. First kill off the idea of a compile-time default alignment and set it to nonstrict in the common code. For any ports that want strict alignment by default, that code is moved to sim_open while initializing the sim. That means WITH_DEFAULT_ALIGNMENT can be completely removed. Moving the default alignment to the runtime also allows removal of setting the "wire" settings at configure time. Which allows removing of all arguments to SIM_AC_OPTION_ALIGNMENT and moving that call to common code. The macro logic can be reworked to not pass WITH_ALIGNMENT as -D CPPFLAG and instead move it to config.h. All of these taken together mean we can hoist the macro up to the top level and share it among all sims so behavior is consistent among all the ports.
2021-05-16sim: switch config.h usage to defs.hMike Frysinger1-0/+2
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-01-04sim: common: use sim_config_print nameMike Frysinger1-1/+1
Meant to push this variant where naming preference is given to the module the code resides in rather than the operation it performs.
2021-01-04sim: common: rename sim_print_configMike Frysinger1-1/+1
print_sim_config has never been used anywhere, so rename it to follow the sim_* naming style for all other symbols we export.
2021-01-01Update copyright year range in all GDB filesJoel Brobecker1-1/+1
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.
2020-01-01Update copyright year range in all GDB files.Joel Brobecker1-1/+1
gdb/ChangeLog: Update copyright year range in all GDB files.
2019-01-01Update copyright year range in all GDB files.Joel Brobecker1-1/+1
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.
2018-01-02Update copyright year range in all GDB filesJoel Brobecker1-1/+1
gdb/ChangeLog: Update copyright year range in all GDB files
2017-01-01update copyright year range in GDB filesJoel Brobecker1-1/+1
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.
2016-01-11sim: config: do not try to align settingsMike Frysinger1-5/+5
We try to align the output for a few settings, but not most of them. Drop the aligning entirely to be lazy.
2016-01-10sim: move many common settings from CPPFLAGS to config.hMike Frysinger1-1/+2
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-06sim: config: drop use of __DATE__/__TIME__Mike Frysinger1-7/+0
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-03sim: drop host endian configure optionMike Frysinger1-20/+2
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-03sim: convert to bfd_endianMike Frysinger1-22/+22
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-01GDB copyright headers update after running GDB's copyright.py script.Joel Brobecker1-1/+1
gdb/ChangeLog: Update year range in copyright notice of all files.
2015-01-01Update year range in copyright notice of all files owned by the GDB project.Joel Brobecker1-1/+1
gdb/ChangeLog: Update year range in copyright notice of all files.
2014-01-01Update Copyright year range in all files maintained by GDB.Joel Brobecker1-1/+1
2013-01-01Update years in copyright notice for the GDB files.Joel Brobecker1-1/+1
Two modifications: 1. The addition of 2013 to the copyright year range for every file; 2. The use of a single year range, instead of potentially multiple year ranges, as approved by the FSF.
2012-01-04Copyright year update in most files of the GDB Project.Joel Brobecker1-1/+1
gdb/ChangeLog: Copyright year update in most files of the GDB Project.
2011-05-11sim: fix func call style (space before paren)Mike Frysinger1-9/+9
Committed this as obvious: -foo(...); +foo (...); Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-03-15sim: common: trim trailing whitespaceMike Frysinger1-13/+13
2011-01-01run copyright.sh for 2011.Joel Brobecker1-1/+1
2010-01-01Update copyright notices to add year 2010.Joel Brobecker1-1/+1
2009-01-14 Update the copyright notice of some of the files I missedJoel Brobecker1-1/+1
in the previous copyright update.
2008-01-01 Updated copyright notices for most files.Daniel Jacobowitz1-1/+1
2007-08-24 Switch the license of all files explicitly copyright the FSFJoel Brobecker1-4/+2
to GPLv3.
2007-01-09Copyright updates for 2007.Daniel Jacobowitz1-1/+1
2004-11-16 * sim-config.c (sim_config): Recognize when a bfd has unspecifiedHans-Peter Nilsson1-1/+5
endian information.
2002-11-232002-11-22 Andrew Cagney <ac131313@redhat.com>Andrew Cagney1-19/+22
* dv-core.c: Update copyright. sim/common contributed to the FSF. * dv-glue.c, dv-pal.c, hw-base.c, hw-base.h, hw-device.c: Ditto. * hw-device.h, hw-handles.c, hw-handles.h: Ditto. * hw-instances.c, hw-instances.h, hw-properties.c: Ditto. * hw-properties.h, hw-tree.c, hw-tree.h, sim-alu.h: Ditto. * sim-basics.h, sim-bits.c, sim-bits.h, sim-config.c: Ditto. * sim-config.h, sim-core.c, sim-core.h, sim-endian.c: Ditto. * sim-endian.h, sim-events.c, sim-events.h, sim-inline.c: Ditto. * sim-inline.h, sim-io.c, sim-io.h, sim-n-bits.h: Ditto. * sim-n-core.h, sim-n-endian.h, sim-types.h: Ditto.
1999-04-16Initial creation of sourceware repositorygdb-4_18-branchpointStan Shebs1-0/+377
1999-04-16Initial creation of sourceware repositoryStan Shebs1-369/+0
1998-01-31Add config support for the size of the target address and OF cell.Andrew Cagney1-5/+11
1997-12-04 * Make-common.in (SIM_ENVIRONMENT): New variable.Doug Evans1-44/+29
(CONFIG_CFLAGS): Add it. * aclocal.m4 (SIM_AC_OPTION_ENVIRONMENT): Handle --enable-sim-environment option. * configure: Regenerated. * sim-config.h (environment support): Rewrite. * sim-config.c (current_environment): Define as enum, unconditionally. (current_alignment): Define unconditionally. (config_environment_to_a): Update. (config_alignment_to_a): Fix type of argument. Define unconditionally. (sim_config): Handle environment and alignment determination unconditionally. Delete sanity checks of current_environment, unnecessary. (print_sim_config): Update. * sim-options.c (STANDARD_OPTIONS enum): Add OPTION_ENVIRONMENT. (standard_options): Add --environment. (standard_option_handler): Likewise.
1997-09-04Finish implementation of sim-memopt.Andrew Cagney1-0/+2
Use in d30v and tic80. Make available a generic sim_read, sim_write implementation.
1997-08-27Add ABFD argument to sim_create_inferior. Document.Andrew Cagney1-45/+15
Add file sim-hload.c - generic load for hardware only simulators. Review each simulators sim_open, sim_load, sim_create_inferior so that they more closely match required behavour.
1997-08-25Add ABFD argument to sim_open call. Pass through to sim_config soAndrew Cagney1-49/+138
that image properties such as endianness can be checked. More strongly document the expected behavour of each of the sim_* interfaces. Add default endian argument to simulator config macro SIM_AC_OPTION_ENDIAN. Use in sim_config.
1997-04-02New file common/sim-config.c sets/checks simulator configuration options.Andrew Cagney1-0/+317
Update common/aclocal.m4 to better work with sim-config.[hc].