aboutsummaryrefslogtreecommitdiff
path: root/sim/common
AgeCommit message (Collapse)AuthorFilesLines
2016-08-15sim: unify symbol table handlingMike Frysinger4-26/+83
The common sim tracing code already handles loading and tracking of symbols from the target program so that it can show symbol info in trace/disassembly calls. Once we touch up the trace code and add a few API callbacks, ports don't need to do loading and searching of symbol tables themselves anymore.
2016-08-13sim: cgen: constify mode_namesMike Frysinger3-2/+7
2016-08-13sim: cgen: drop unused argv/envp definitionsMike Frysinger2-8/+5
The common argv/envp are used now by all ports, so drop this old cgen fragment.
2016-02-04Prevent possible undefined behaviour computing the size of the scache by ↵Nick Clifton2-11/+19
usingunsigned integers instead of signed integers. * cgen-scache.c (scache_option_handler): Prevent possible undefined behaviour computing the size of the scache by using unsigned integers instead of signed integers.
2016-01-17Minor comment fixes in sim/common/sim-fpu.c.Joel Brobecker2-67/+71
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-17minor reformatting in sim/common/sim-fpu.c.Joel Brobecker2-2/+9
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-11sim: config: do not try to align settingsMike Frysinger2-5/+10
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 Frysinger7-150/+104
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-10sim: drop unused SIM_AC_OPTION_PACKAGESMike Frysinger4-30/+7
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-10sim: allow the environment configure option everywhereMike Frysinger2-0/+5
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-10sim: allow the assert configure option everywhereMike Frysinger2-0/+5
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-10sim: drop targ-vals.def->nltvals.def indirectionMike Frysinger5-18/+16
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-10sim: allow the inline configure option everywhereMike Frysinger2-15/+10
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-10sim: drop --enable-sim-{regparm,stdcall} optionsMike Frysinger6-192/+49
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-10sim: drop --enable-sim-cflags optionMike Frysinger4-19/+8
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-09sim: drop common/cconfig.h in favor of a single config.hMike Frysinger15-10590/+81
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-06sim: config: drop use of __DATE__/__TIME__Mike Frysinger2-7/+5
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-06sim: sim_{create_inferior,open,parse_args}: constify argv/env slightlyMike Frysinger3-2/+7
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-05sim: trace: add support for disassemblingMike Frysinger3-1/+119
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-04sim: use STATE_MAGIC helperMike Frysinger2-1/+5
2016-01-04sim: unify min/max macrosMike Frysinger5-9/+17
Import defines from gdb/defs.h to the sim core so we can delete the various copies that already exist.
2016-01-04sim: parse_args: polish getopt error messageMike Frysinger2-1/+5
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-04sim: punt x86-specific bswap logicMike Frysinger5-55/+12
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-03sim: parse_args: display getopt error ourselvesMike Frysinger2-1/+33
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-03sim: clean up some more device detritusMike Frysinger3-4/+5
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-03sim: use libiberty countargv in more placesMike Frysinger2-2/+6
A bunch of places open code the countargv implementation, or outright duplicate it (as count_argc). Replace all of those w/countargv.
2016-01-03sim: nrun: use lbasenameMike Frysinger2-5/+9
2016-01-03sim: drop host endian configure optionMike Frysinger10-87/+295
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 Frysinger12-244/+125
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-02sim: delete dead current_state globalsMike Frysinger4-32/+6
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-01GDB copyright headers update after running GDB's copyright.py script.Joel Brobecker113-113/+113
gdb/ChangeLog: Update year range in copyright notice of all files.
2015-12-30sim: simplify STATE_MY_NAME setupMike Frysinger2-3/+6
No point in writing basename ourselves when libiberty provides one.
2015-12-27sim: unify sim-hloadMike Frysinger2-0/+5
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-26sim: punt WITH_DEVICES & tconfig.h supportMike Frysinger9-108/+22
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 ae7d0cac8ce971f7108d270c. 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-26sim: sim-core: pass down cpu to hw accesses when availableMike Frysinger2-10/+41
The bfin port has been using the device callback largely so it could be passed the cpu when available. Add this logic to the common core code so all ports get access to the active cpu. The semantics of these buffer functions are changed slightly in that errors halt the engine synchronously rather than returning the length to the caller. We'll probably adjust this in a follow up commit. The bfin code isn't updated just yet as it has a bit more logic in the device layer that needs to be unwound at which point we can delete it entirely.
2015-12-25sim: hw-properties: delete trace callsMike Frysinger2-4/+8
These trace calls don't seem to add anything useful and break the cris hw tests, so punt them. They were disabled before commit 6d519a4606b9 but were re-enabled as part of TRACE macro cleanups.
2015-12-25sim: drop WITH_ENGINE defineMike Frysinger3-15/+5
We enable this everywhere already, and all new ports should use the engine logic, so no point in making it an option to disable.
2015-12-25sim: sim-model: build for everyoneMike Frysinger10-20/+42
Rather than include this for some targets, set it up so we can build it all the time via the common code. This makes it easier for targets to opt into it when they're ready, increases build coverage, and allows us to centralize much of the logic. We also get to delete tconfig.h from two more targets -- they were setting WITH_DEVICES to 0 which has the same behavior as not defining it at all. While the SIM_HAVE_MODEL knob is gone, we now have WITH_MODEL_P, but it is only used by the common sim-model code. We use it to declare dummy model lists when the arch hasn't created its own.
2015-12-25sim: move MACH/MODEL types into SIM_xxx namespaceMike Frysinger4-27/+34
The "MACH" and "MODEL" names are a bit generic and collide with symbols used by other sections of code (like h8300's opcodes). Since these are sim-specific types, they really should have a "SIM_" prefix.
2015-12-25sim: device_error: puntMike Frysinger4-29/+16
Only four targets implement this function, and three of them do nothing. The 4th merely calls abort. Since calls to this function are followed by calls to sim_hw_abort or sim_io_error, this is largely useless. In the two places where we don't, replace the call with sim_engine_abort. We want to kill off the WITH_DEVICES logic in favor of WITH_HW, so this is a good first step.
2015-12-25sim: always enable callback memoryMike Frysinger4-13/+13
We enable WITH_CALLBACK_MEMORY everywhere and don't provide a way to turn it off, and no target does so. Make it unconditional for all to keep things simple.
2015-12-25sim: dv-pal: always use CPU_INDEXMike Frysinger2-5/+7
Since the core always provides CPU_INDEX, use it. The current code doesn't actually use it even though it should since it doesn't include the right headers.
2015-12-24sim: make LMA loading the default for all targetsMike Frysinger2-9/+7
Most targets already default to loading code via their LMA, but for a few, this means the default changes from loading VMA to LMA. It's better to have the different targets be consistent, and allows some code clean up.
2015-12-24sim: cris: move option install to sim_openMike Frysinger2-4/+4
We've moved custom option install for other targets to sim_open, so update cris too. It's the last one using MODULE_LIST, so we can drop that from the common code too.
2015-12-24sim: h8300: move h8300-specific options out of common codeMike Frysinger2-29/+7
Register the options in sim_open like other arches to avoid having to hack up the common modules.
2015-12-24sim: enable watchpoint module everywhereMike Frysinger2-2/+5
We build & bundle the watchpoint module everywhere, but we don't make the command line flags available by default. A few targets opted in, but most did not. Just enable the flag for everyone. Not all targets will respect the flags (making them nops), but shouldn't be a big deal. This is how we handle other common modules already.
2015-12-24sim: delete SIM_HAVE_FLATMEM supportMike Frysinger4-51/+9
No target has used this, and it's a cheap hack in place in using the common memory module. We want everyone using that though, so drop support for flatmem entirely.
2015-12-24sim: delete SIM_HAVE_SIMCACHEMike Frysinger2-6/+4
This was used by the old run interface, but we punted that awhile ago, so drop this define too.
2015-11-22sim: common: set up CPPFLAGS/CXXFLAGS/LDFLAGS from configure [PR sim/18762]Mike Frysinger2-0/+8
Make sure we pass down the CPP/CXX/LD flags that configure set up for us like we already do for C flags.
2015-11-22sim: sim_do_commandf: fix call to va_end [PR sim/19273]Mike Frysinger2-2/+13
Make sure we call va_end even in the error case.