aboutsummaryrefslogtreecommitdiff
path: root/sim
AgeCommit message (Collapse)AuthorFilesLines
2016-01-10sim: drop targ-vals.def->nltvals.def indirectionMike Frysinger59-1557/+151
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: mips: drop SIM_AC_OPTION_SMP callMike Frysinger3-43/+7
No other port calls this macro directly, and mips has it hardcoded to the default -- disabling smp. In the future we'll enable this for all targets in common code, so tidy up the mips code now.
2016-01-10sim: allow the inline configure option everywhereMike Frysinger79-1006/+1113
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 Frysinger69-660/+245
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 Frysinger66-716/+191
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: stop configuring common subdirMike Frysinger4-18/+7
Now that cconfig.h doesn't exist, there's no need to build in the common subdir anymore. We leave the configure/Makefile files in there as there is a helper for developers to generate the nltvals.def file. Once that gets cleaned up in the future though, we can drop the build logic too.
2016-01-09sim: drop common/cconfig.h in favor of a single config.hMike Frysinger99-10674/+11040
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 Frysinger59-77/+248
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-06Change copyright owner to FSF in sim/testsuite/sim/mips/hilo-hazard-4.sJoel Brobecker2-2/+5
sim/testsuite/sim/mips/ChangeLog: * hilo-hazard-4.s: Change copyright ownder to FSF.
2016-01-05sim: msp430: drop duplicate sim_load_file callMike Frysinger2-26/+14
There's no need, or desire, to call sim_load_file from sim_open. The higher levels (gdb/run) take care of calling sim_load for us already.
2016-01-05sim: aarch64: switch to common disassembler tracingMike Frysinger5-137/+30
The output should largely be the same.
2016-01-05sim: bfin: add support disasm tracingMike Frysinger2-0/+6
2016-01-05sim: msp430: switch to common disassembler tracingMike Frysinger5-388/+12
The output format is a bit different, but the new form matches all the other trace lines. Otherwise, it should be functionally equivalent.
2016-01-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-05Add myself as the maintainer for the AArch64.Nick Clifton2-0/+5
2016-01-05Fix the execution of the MSP430 simulator testsuite.Nick Clifton2-2/+38
ld * emulparams/msp430elf.sh (RAM_START): Move to 0x500 - above the MSP430 hardware multiply address range. * scripttempl/elf32msp430.sc (__romdatastart): Define. (__romdatacopysize): Define. * scripttempl/elf32msp430_3.sc: Likewise. tests * testutils.inc (__pass): Use the LMA addresses of the _passmsg symbol. (__fail): Likewise.
2016-01-04sim: use STATE_MAGIC helperMike Frysinger2-1/+5
2016-01-04sim: unify min/max macrosMike Frysinger16-40/+60
Import defines from gdb/defs.h to the sim core so we can delete the various copies that already exist.
2016-01-04sim: aarch64: drop syscall.h include to fix buildTristan Gingold3-1/+8
The simulator is including syscall.h which is not standard and apparently not required (builds correctly without it on my machine).
2016-01-04sim: parse_args: polish getopt error messageMike Frysinger5-3/+12
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 Frysinger68-699/+187
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-04sim: d10v: gut endian logicMike Frysinger2-77/+5
The compiler should produce reasonable code here in general, so punt the various arch checks and bswap defines. This code will eventually go away entirely when we convert it to the common memory code.
2016-01-03sim: parse_args: display getopt error ourselvesMike Frysinger44-64/+138
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: TODO: move to wikiMike Frysinger6-71/+12
We're maintaining development docs in the wiki now: https://sourceware.org/gdb/wiki/Sim/TODO
2016-01-03sim: clean up some more device detritusMike Frysinger13-53/+26
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 Frysinger12-65/+44
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 Frysinger96-5871/+6648
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 Frysinger90-699/+712
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: cris: use standard output helpersMike Frysinger2-35/+14
The sim-io module provides output helpers, so no need to define local ones anymore.
2016-01-02sim: iq2000/m32r/lm32/sh64: delete dead option codeMike Frysinger8-55/+18
The iq2000/m32r/sh64 option parsing logic appears to have always been dead. At least iq2000/sh64 are simply copy & paste rot from m32r. The lm32 option parsing hack here hasn't been needed for a while -- this was fixed back in commit 11409fac6b95d71a92848a4499b02d60a4f4c5bb in the common code.
2016-01-02sim: delete dead current_state globalsMike Frysinger19-86/+42
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-02sim: ppc: do not exit when parsing args w/gdbMike Frysinger5-22/+50
When connecting to the simulator in gdb, we don't want it to exit on us when we pass down unknown/invalid/help/etc... options. Plumb down the kind argument so we can handle both gdb & psim interfaces.
2016-01-01GDB copyright headers update after running GDB's copyright.py script.Joel Brobecker577-577/+577
gdb/ChangeLog: Update year range in copyright notice of all files.
2015-12-30sim: m68hc11: fix default endianMike Frysinger3-2/+7
The previous commit here set the default to little instead of big. A typo lost when reviewing the different targets in parallel.
2015-12-30sim: cris/m68hc11: move default endian/alignment to configureMike Frysinger8-14/+115
2015-12-30sim: h8300: inline sim_state_initializeMike Frysinger2-27/+7
All the state is handled already by the common cpu allocation which zeros out the entire state.
2015-12-30sim: h8300: simplify h8300_reg_{fetch,store} funcsMike Frysinger2-53/+29
We can leverage the cpu->regs array rather than going through the function helpers to get nice compact code. Further, fix up the return values: return -1 when we can't find a register (and let the caller write out warnings), return 2/4 when we actually write out that amount, and handle the zero reg.
2015-12-30sim: h8300: switch to common sim-resumeMike Frysinger3-40/+57
2015-12-30sim: h8300: move default endian/alignment to configureMike Frysinger4-6/+112
2015-12-30sim: simplify STATE_MY_NAME setupMike Frysinger2-3/+6
No point in writing basename ourselves when libiberty provides one.
2015-12-30sim: arm/d10v/h8300/m68hc11/microblaze/mips/mn10300/moxie/sh/v850: convert ↵Mike Frysinger20-86/+169
to common sim_{fetch,store}_register
2015-12-30sim: h8300: move unused/buggy lregs arrayMike Frysinger2-4/+5
This array isn't used anywhere, and the init phase actually corrupts some memory because the array has 18 elements but tries to set the 19th (ZERO) position.
2015-12-30sim: h8300: drop unused inst.hMike Frysinger3-104/+5
We can also drop the compile.o rule since the common dep generation logic takes care of this for us.
2015-12-29sim: ppc: track closed state of file descriptors 0, 1, and 2.Kevin Buettner3-22/+151
This change tracks the "closed" state of file descriptors 0, 1, and 2, introducing the function fdbad() to emul_netbsd.c and emul_unix.c. Note that a function of the same name and purpose exists in sim/common/callback.c. This patch eliminates all of the "unresolved testcases" when testing GDB against the powerpc simulator. This occurs because the powerpc simulator closes, on behalf of the testcase, the file descriptors associated with stdin, stdout, and stderr. GDB still needs these descriptors to communicate with the user or, in this case, with the testing framework.
2015-12-27sim: aarch64/msp430: fix disassembler usageMike Frysinger4-4/+14
The disasm framework reserves the private_data field for the disassemblers themselves, not for people who use the disassembler. Instead, there is an application_data field for callers such as the sim. Switch to it to avoid random corruption/crashes when the disassemblers use private_data.
2015-12-27sim: unify sim-hloadMike Frysinger46-67/+93
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 Frysinger95-290/+197
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: bfin: push down mmr address/size checksMike Frysinger33-229/+549
The bfin port is using the WITH_DEVICES framework for two reasons: - get access to the cpu making the request (if available) - check the alignment & size for core & system MMRs We addressed the first part with commit dea10706e9159ba6e94eab4c25010f3, and we handle the second part with this commit. Arguably this is more correct too because trying to do bad reads/writes directly (when devices support is disabled) often results in bad memory accesses. As part of this clean up, we also adjust all of the existing logic that would reject invalid accesses: the code was relying on the checks never returning, but that's not the case when things like gdb (via the user's commands) are making the requests. Thus we'd still end up with bad mem accesses, or sometimes gdb being hung due to while(1) loops. Now we can connect (most of) these models into any address and have them work correctly.