aboutsummaryrefslogtreecommitdiff
path: root/sim/microblaze/interp.c
AgeCommit message (Collapse)AuthorFilesLines
2023-01-15sim: microblaze, mn10300: remove signal.h include in interp.cMark Wielaard1-1/+0
signal.h isn't needed in microblaze and mn10300 interp.c so don't include it.
2023-01-01sim: replace -I$srcroot/opcodes include with -I$srcrootMike Frysinger1-1/+1
Clean up includes a bit by making ports include opcodes/ headers explicitly. This matches other projects, and makes it more clear where these headers are coming from.
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-12-25sim: cpu: change default init to handle all cpusMike Frysinger1-1/+1
All the runtimes were only initializing a single CPU. When SMP is enabled, things quickly crash as none of the other CPU structs are setup. Change the default from 0 to the compile time value.
2022-12-23sim: microblaze: move arch-specific settings to internal headerMike Frysinger1-0/+1
There's no need for these settings to be in sim-main.h which is shared with common/ sim code, so move it all out to a new header which only this port will include.
2022-12-21sim: microblaze: invert sim_cpu storageMike Frysinger1-3/+4
2022-11-02sim: common: change sim_{fetch,store}_register helpers to use void* buffersMike Frysinger1-2/+2
When reading/writing arbitrary data to the system's memory, the unsigned char pointer type doesn't make that much sense. Switch it to void so we align a bit with standard C library read/write functions, and to avoid having to sprinkle casts everywhere.
2022-10-31sim: reg: constify store helperMike Frysinger1-1/+1
These functions only read from memory, so mark the pointer as const.
2022-10-31sim: constify various integer readersMike Frysinger1-1/+1
These functions only read from memory, so mark the pointer as const.
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-11-15sim: split program path out of argv vectorMike Frysinger1-4/+1
We use the program argv to both find the program to run (argv[0]) and to hold the arguments to the program. Most of the time this is fine, but if we want to let programs specify argv[0] independently (which is possible in standard *NIX programs), this double duty doesn't work. So let's split the path to the program to run out into a separate field by itself. This simplifies the various sim_open funcs too. By itself, this code is more of a logical cleanup than something that is super useful. But it will open up customization of argv[0] in a follow up commit. Split the changes to make it easier to review.
2021-09-08sim: microblaze: replace custom basic types with common onesMike Frysinger1-4/+4
The basic "byte" type conflicts with Windows headers, and we already have common types that provide the right sizes. So replace these with the common ones to avoid issues. CC dv-sockser.o In file included from /usr/i686-w64-mingw32/usr/include/wtypes.h:8, from /usr/i686-w64-mingw32/usr/include/winscard.h:10, from /usr/i686-w64-mingw32/usr/include/windows.h:97, from /usr/i686-w64-mingw32/usr/include/winsock2.h:23, from ../../gnulib/import/sys/socket.h:684, from ../../gnulib/import/netinet/in.h:43, from .../build/sim/../../../sim/microblaze/../common/dv-sockser.c:39: /usr/i686-w64-mingw32/usr/include/rpcndr.h:63:25: error: conflicting types for 'byte'; have 'unsigned char' 63 | typedef unsigned char byte; | ^~~~ In file included from .../buildsim/../../../sim/microblaze/sim-main.h:21, from .../buildsim/../../../sim/microblaze/../common/dv-sockser.c:24: .../buildsim/../../../sim/microblaze/microblaze.h:94:25: note: previous declaration of 'byte' with type 'byte' {aka 'char'} 94 | typedef char byte; | ^~~~ make: *** [Makefile:513: dv-sockser.o] Error 1
2021-06-18sim: split sim-signal.h include outMike Frysinger1-0/+1
The sim-basics.h is too big and includes too many things. This leads to some arch's sim-main.h having circular loop issues with defs, and makes it hard to separate out common objects from arch-specific defs. By splitting up sim-basics.h and killing off sim-main.h, it'll make it easier to separate out the two.
2021-05-16sim: switch config.h usage to defs.hMike Frysinger1-1/+3
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-05-14sim: create header namespaceMike Frysinger1-2/+2
The gdb/callback.h & gdb/remote-sim.h headers have nothing to do with gdb and are really definitions for the libsim API under the sim/ tree. While gdb uses those headers as a client, it's not specific to it. So create a new sim/ namespace and move the headers there.
2021-05-04sim: microblaze: enable some basic trace pointsMike Frysinger1-0/+2
This isn't super complete, but it's useful enough as-is.
2021-05-04sim: microblaze: hook up libgloss syscallsMike Frysinger1-2/+13
When in the virtual environment, have brki 8 trigger libgloss syscalls like other ports. This also matches the ABI that Linux uses for its syscalls (ignoring the syscall table differences).
2021-04-12sim: cgen: move cgen_cpu_max_extra_bytes logic into the common codeMike Frysinger1-1/+1
Every arch handles this the same way, so move it to the common code. This will also make unifying the sim_cpu structure easier.
2021-04-01Fix microblaze sim build errorMartin Liska1-1/+1
I see the following error for --target=microblaze-elf: ../../../sim/microblaze/interp.c: In function 'sim_engine_run': ../../../sim/microblaze/interp.c:147:39: error: passing argument 2 of 'get_insn_microblaze' from incompatible pointer type [-Werror=incompatible-pointer-types] 147 | op = get_insn_microblaze (inst, &imm_unsigned, &insn_type, | ^~~~~~~~~~~~~ | | | int * In file included from ../../bfd/bfd.h:45, from ../../../sim/microblaze/interp.c:24: ../../../sim/microblaze/../../opcodes/microblaze-dis.h:34:57: note: expected '_Bool *' but argument is of type 'int *' 34 | extern enum microblaze_instr get_insn_microblaze (long, bool *, | ^ sim/microblaze/ChangeLog: * interp.c (sim_engine_run): Use bool instead of int.
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-06-02Correct check for endiannessMichael Eager1-1/+1
* interp.c: (target_big_endian): target endianess recognition fix.
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-06sim: sim_{create_inferior,open,parse_args}: constify argv/env slightlyMike Frysinger1-2/+4
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-03sim: parse_args: display getopt error ourselvesMike Frysinger1-3/+1
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-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-12-30sim: arm/d10v/h8300/m68hc11/microblaze/mips/mn10300/moxie/sh/v850: convert ↵Mike Frysinger1-7/+6
to common sim_{fetch,store}_register
2015-11-15sim: sim-close: unify sim_close logicMike Frysinger1-6/+0
Other than the nice advantage of all sims having to declare one fewer common function, this also fixes leakage in pretty much every sim. Many were not freeing any resources, and a few were inconsistent as to the ones they did. Now we have a single module that takes care of all the logic for us. Most of the non-cgen based ones could be deleted outright. The cgen ones required adding a callback to the arch-specific cleanup func. The few that still have close callbacks are to manage their internal state. We do not convert erc32, m32c, ppc, rl78, or rx as they do not use the common sim core.
2015-06-11sim: microblaze: switch to common sim_resume/sim_stop_reasonMike Frysinger1-27/+16
This allows us to use the common code for all exception handling.
2015-04-17sim: microblaze: switch to common memory functionsMike Frysinger1-322/+7
Re-use the existing memory core that handles reads/writes. This drops support for the dumpmem command, but gdb itself has support for dumping memory regions. The verbose command is converted to the common --verbose flag since only two call sites use it now. Support for the clearstats command is dropped entirely, but no other sim really does this, and the same thing can be done by reloading. If it's important (clearing cycle stats) to someone, we can add a common function for it.
2015-04-17sim: arm/cr16/d10v/h8300/microblaze/sh: fill out sim-cpu pc fetch/store helpersMike Frysinger1-0/+15
This makes the common sim-cpu logic work.
2015-03-29sim: microblaze: convert to nrunMike Frysinger1-173/+113
This port already was storing its cpu state in the sim_cpu structure, so converting it over was pretty easy. It is allocating memory itself still, but we'll fix that up in the future at some point.
2015-03-29sim: mcore/microblaze: delete dead codeMike Frysinger1-99/+1
The mcore port had a few structs/defines that were never used. Similarly, the microblaze port, because it was copied from mcore, has that same dead code, and more. The watchpoint logic was never actually used. Punt it all.
2015-03-29sim: microblaze: start a testsuiteMike Frysinger1-1/+1
Since the sim doesn't have any debug support in it, we can only exit cleanly. But this is still better than nothing. Change the default microblaze sim to not dump the debug load output when running. No other does this, and it breaks the testsuite.
2015-03-16sim: mcore/microblaze: strip trailing whitespaceMike Frysinger1-5/+5
No functional changes here.
2015-03-16sim: mcore/microblaze: clean up a bitMike Frysinger1-144/+5
Fix some various warnings and enable the extra warnings options.
2015-03-08sim: microblaze: fix printf stringMike Frysinger1-1/+1
Since sizeof returns a size_t, use %zu to display it.
2015-02-20sim: drop unused headersMike Frysinger1-2/+3
These look like left over hacks from the days where we had to protect ourselves from the compiler and C library. None of these checks are relevant, and we have common configure logic to do header tests. Punt them all now.
2015-02-19sim: drop unused sim_kill functionMike Frysinger1-6/+0
This has been deprecated for a long time and no one calls it.
2015-02-03sim: Be sure of calling freeargv() after successfully call buildargv().Chen Gang1-0/+3
Or there will be memory leak. 2015-02-02 Chen Gang <gang.chen.5i5j@gmail.com> * microblaze/interp.c (sim_do_command): Call freeargv() before return.
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-06-30Sim - Use long int format instead of int to avoid compiling warningMichael Eager1-3/+3
2014-07-01 Chen Gang <gang.chen.5i5j@gmail.com> * sim/microblaze/interp.c: Use long int format instead of int format to avoid compiling warnings.
2014-03-10sim: constify arg to sim_do_commandMike Frysinger1-1/+1
It is rare for people to want to modify the cmd arg. In general, they really shouldn't be, but a few still do. For those who misbehave, dupe the string locally so they can bang on it.
2014-03-05sim: constify prog_nameMike Frysinger1-1/+1
There's no need for the prog_name handed down to the core to be mutable, so add const markings to it and all the related funcs.
2014-02-17sim: delete duplicate SIGINT handlingMike Frysinger1-10/+0
Many of the simulators change the SIGINT handler. E.g., moxie/interp.c: sigsave = signal (SIGINT, interrupt); However, this is unnecessary. remote-sim.h already provides an API for asynchronously stopping a sim; and both gdb and the drivers (run.c and nrun.c at least, I didn't check the others) install a SIGINT handler which calls this method. URL: https://sourceware.org/bugzilla/show_bug.cgi?id=16450 Reported-by: Tom Tromey <tromey@redhat.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-01-01Update Copyright year range in all files maintained by GDB.Joel Brobecker1-1/+1
2013-03-15gdb:Steve Ellcey1-1/+1
2013-03-15 Steve Ellcey <sellcey@mips.com> * remote-sim.c (sim_command_completer): Make char arguments const. include: 2013-03-15 Steve Ellcey <sellcey@mips.com> * gdb/remote-sim.h (sim_command_completer): Make char arguments const. sim: 2013-03-15 Steve Ellcey <sellcey@mips.com> * arm/wrapper.c (sim_complete_command): Make char arguments const. * avr/interp.c (sim_complete_command): Ditto. * common/sim-options.c (sim_complete_command): Ditto. * cr16/interp.c (sim_complete_command): Ditto. * erc32/interf.c (sim_complete_command): Ditto. * m32c/gdb-if.c (sim_complete_command): Ditto. * microblaze/interp.c (sim_complete_command): Ditto. * ppc/sim_calls.c (sim_complete_command): Ditto. * rl78/gdb-if.c (sim_complete_command): Ditto. * rx/gdb-if.c (sim_complete_command): Ditto. * sh/interp.c (sim_complete_command): Ditto.
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.