aboutsummaryrefslogtreecommitdiff
path: root/sim
AgeCommit message (Collapse)AuthorFilesLines
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.
2015-12-26sim: bfin: avoid stack error under asanMike Frysinger2-1/+5
We set up an array of 3 elements and then index into it with a 2bit value. We check the range before we actually use the pointer, but the indexing is enough to make asan upset, so just stuff a fourth value in there to keep things simple.
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-26sim: mips: delete mmu stubs to move to common sim_{read,write}Mike Frysinger6-355/+153
The only unique thing about mip's sim_{read,write} helpers is the call to address_translation on the incoming address. When we look closer at that function though, we see it's just a stub that maps physical to virtual, and the cache/return values are hardcoded. If we delete this function, we can then collapse all the callers and drop the custom sim_{read,write} logic entirely. Some day we might want to add MMU support, but when we do, we'll want to have the common layers handle things so all targets benefit.
2015-12-26sim: cris: do not pass cpu when writing memory during initMike Frysinger2-5/+10
The point of passing down the cpu to core reads/writes is to signal which cpu is making the access. For system accesses (such as internal memory initialization), passing the cpu down doesn't make sense, and in the case of early init like cris, can cause crashes. Since the cpu isn't fully set up at this point, if the core code tries to access some fields (like the PC reg), it'll crash. While cris shouldn't be doing this setup here (it should be in the inferior stage), we'll deal with that later.
2015-12-26sim: standardize sim_create_inferior handling of argv a bit moreMike Frysinger18-34/+106
For targets that process argv in sim_create_inferior, improve the code: - provide more details in the comment - make the check for when to re-init more robust - clean out legacy sim_copy_argv code This will be cleaned up more in the future when we have a common inferior creation function, but at least help new ports get it right until then.
2015-12-26sim: aarch64: move ChangeLog contentMike Frysinger2-26/+25
2015-12-25sim: frv: punt WITH_DEVICE supportMike Frysinger6-95/+10
The frv port used the device logic to support a single cache address, and the comments around that are "these were merely copied from a diff port and are unused", plus the code to attach the memory is "#if 0". Just punt it all.
2015-12-25sim: m32r: migrate from WITH_DEVICES to WITH_HWMike Frysinger12-178/+361
The m32r port was using the device framework to handle two devices: the cache and uart registers. Both can be implemented in the newer hardware framework instead which allows us to drop the device logic entirely, as well as delete the tconfig.h file. While creating the new uart device model, I also added support for using stdin to read/write data rather than only supporting sockets. This has been lightly tested as there doesn't appear to be test coverage for the code already. If anyone still cares about this port, then they should (hopefully) file bug reports.
2015-12-25sim: cris: migrate from WITH_DEVICES to WITH_HWMike Frysinger10-126/+113
The cris port was using the device framework to handle two addresses when the --cris-900000xx flag was specified. That can be implemented using the newer hardware framework instead which allows us to drop the device logic entirely, as well as delete the tconfig.h file. Basically we create a new cris_900000xx device model and move the read logic out of devices.c and into that. The rest of the devices logic was callback to the hardware framework already.
2015-12-25sim: cris: clean up rvdummy a bitMike Frysinger2-2/+6
This fixes a few warnings when compiling the rvdummy tool.
2015-12-25sim: cris: set up sane default path to rvdummyMike Frysinger2-1/+14
Much like we autodetect the path to the run program when there is none set explicitly, do the same for the rvdummy program. Otherwise the default make check fails to execute the helper properly.