aboutsummaryrefslogtreecommitdiff
path: root/sim/common/syscall.c
AgeCommit message (Collapse)AuthorFilesLines
2016-01-09sim: drop common/cconfig.h in favor of a single config.hMike Frysinger1-1/+1
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-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-06-17sim: syscall: add common sim_syscall helpersMike Frysinger1-1/+1
Many ports have the same sim syscall logic, so add some helpers to handle all the common details. The arches still have to deal with the unpacking and packing of the syscall arguments, but the rest of the sim<->callback glue is now shared.
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-12-03callback.h:struct host_callback_struct compilation error on Windows hosts.Joel Brobecker1-3/+3
On Windows, a recent gnulib update imported the lstat module, and this caused a remote-sim.c build failure in struct host_callback_struct: In file included from /[...]/gdb/remote-sim.c:34:0: /[...]/gdb/../include/gdb/callback.h:93:9: error: duplicate member '_stati64' int (*lstat) (host_callback *, const char *, struct stat *); ^ What happens it that gnulib's stat.h makes the following defines: /* Large File Support on native Windows. */ #if 1 # define stat _stati64 #endif and then: #if 1 # if ! 0 /* mingw does not support symlinks, therefore it does not have lstat. But without links, stat does just fine. */ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define lstat stat # endif So, the following fields in struct host_callback_struct... int (*stat) (host_callback *, const char *, struct stat *); int (*fstat) (host_callback *, int, struct stat *); int (*lstat) (host_callback *, const char *, struct stat *); ... get translated to... int (*_stati64) (host_callback *, const char *, struct _stati64 *); int (*_fstati64) (host_callback *, int, struct _stati64 *); int (*_stati64) (host_callback *, const char *, struct _stati64 *); ... which causes two fields to have the same name. This patch fixes the issue by renaming the stat-related fields by adding a "to_" prefix, similar to what is done in GDB's target_ops vector. include/gdb/ChangeLog: * callback.h (struct host_callback_struct) <to_stat>: Renamed from "stat". <to_fstat>: Renamed from "fstat". <to_lstat>: Renamed from "lstat". sim/common/ChangeLog: * sim-io.c (sim_io_stat, sim_io_fstat): Adjust calls to "stat" and "fstat" callbacks by calls to "to_stat" and "to_fstat" (resp) callbacks following renaming in callback.h. * syscall.c (cb_syscall): Likewise. Adjust calls to "lstat" callback by call to "to_lstat" callback sim/cris/ChangeLog: * traps.c (cris_break_13_handler): Adjust call to "fstat" callback by call to "to_fstat" following renaming in callback.h. sim/h8300/ChangeLog: * compile.c (sim_resume): Adjust calls to "stat" and "fstat" callbacks by calls to "to_stat" and "to_fstat" (resp) callbacks following renaming in callback.h.
2014-03-04sim: convert old style prototypesMike Frysinger1-14/+4
Most of these prototypes have been killed off, but we have a few left in the sim tree. Clean them up so we can enable the -W flag for it.
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-2/+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-2/+2
gdb/ChangeLog: Copyright year update in most files of the GDB Project.
2011-12-03sim: export cb_get_string for people to useMike Frysinger1-3/+3
The common sim code provides a useful "get_string" function which reads a C string out of the target's memory space. So rename and export it for other people to use. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-11sim: fix func call style (space before paren)Mike Frysinger1-2/+2
Committed this as obvious: -foo(...); +foo (...); Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-03-15sim: common: trim trailing whitespaceMike Frysinger1-1/+1
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/+2
in the previous copyright update.
2008-01-01 Updated copyright notices for most files.Daniel Jacobowitz1-1/+1
2007-10-112007-10-11 Jesper Nilsson <jesper.nilsson@axis.com>Daniel Jacobowitz1-2/+2
* callback.c (cb_is_stdin, cb_is_stdout, cb_is_stderr): Add functions. * syscall.c (cb_syscall): Test for stdin/out/err, not just fd 0/1/2. 2007-10-11 Jesper Nilsson <jesper.nilsson@axis.com> * callback.h (cb_is_stdin, cb_is_stdout, cb_is_stderr): Add prototypes. 2007-10-11 Jesper Nilsson <jesper.nilsson@axis.com> * sim/cris/c/freopen2.c: Added testcase.
2007-10-112007-10-11 Jesper Nilsson <jesper.nilsson@axis.com>Daniel Jacobowitz1-1/+1
* callback.c (cb_is_stdin): Add. * syscall.c (cb_syscall): Test for stdin, not just fd 0. 2007-10-11 Jesper Nilsson <jesper.nilsson@axis.com> * callback.h (cb_is_stdin): Add prototype.
2007-08-24 Switch the license of all files explicitly copyright the FSFJoel Brobecker1-3/+2
to GPLv3.
2007-01-09Copyright updates for 2007.Daniel Jacobowitz1-1/+1
2005-07-08 * callback.c: Remove ANSI_PROTOTYPES conditional code.Ben Elliston1-4/+0
* sim-load.c: Likewise. * syscall.c: Likewise.
2005-01-28 * syscall.c (cb_syscall) <case CB_SYS_pipe>: New case.Hans-Peter Nilsson1-0/+27
* callback.c [HAVE_LIMITS_H]: Include limits.h. Include libiberty.h. (os_close, os_read, os_write, os_fstat, os_ftruncate): Support fd being either end of a pipe. (os_pipe, os_pipe_empty, os_pipe_nonempty): New functions. (os_shutdown): Clear pipe state. (default_callback): Initialize new members.
2004-12-15 * syscall.c (cb_syscall) <case CB_SYS_truncate>Hans-Peter Nilsson1-0/+30
<case CB_SYS_ftruncate>: New cases.
2004-12-13 * syscall.c (cb_syscall) <case CB_SYS_rename>: New case.Hans-Peter Nilsson1-0/+27
2004-12-13 * syscall.c (cb_syscall) <case CB_SYS_lstat>: New case.Hans-Peter Nilsson1-0/+44
* callback.c (os_lstat): New function.
2004-12-08 * run.1: Document --sysroot=filepath.Hans-Peter Nilsson1-3/+30
* sim-options.c (STANDARD_OPTIONS): New member OPTION_SYSROOT. (standard_options): Support --sysroot=<path>. (standard_option_handler): Handle OPTION_SYSROOT. * syscall.c (simulator_sysroot): Define, initialized empty. (get_path): Prepend simulator_sysroot to absolute file path. [HAVE_STRING_H]: Include string.h. [!HAVE_STRING_H && HAVE_STRINGS_H]: Include strings.h. * nrun.c [HAVE_UNISTD_H]: Include unistd.h. (main): If simulator_sysroot is not empty, chdir there. * sim-config.h (simulator_sysroot): Declare.
2004-05-10 * callback.c: Update copyright dates.Daniel Jacobowitz1-2/+2
* run.c: Likewise. * sim-basics.h: Likewise. * sim-load.c: Likewise. * syscall.c: Likewise. From Maciej W. Rozycki <macro@ds2.pg.gda.pl> * callback.c: Include cconfig.h instead of config.h. * run.c: Likewise. * sim-basics.h: Likewise. * sim-load.c: Likewise. * syscall.c: Likewise.
2002-06-09Move include/callback.h and include/remote-sim.h to include/gdb/.Andrew Cagney1-1/+1
Update accordingly.
1999-04-16Initial creation of sourceware repositorygdb-4_18-branchpointStan Shebs1-0/+482
1999-04-16Initial creation of sourceware repositoryStan Shebs1-482/+0
1998-02-23Handle short reads and EOFMichael Meissner1-1/+6
1997-11-26Flush writes to stdout, stderrMichael Meissner1-2/+8
1997-11-26Delete magic number FIXME.Doug Evans1-2/+0
1997-11-26Undo last change. callback.h changed instead.Doug Evans1-12/+8
Plus: * syscall.c (cb_syscall): Test CB_SYSCALL struct magic number.
1997-11-26 * syscall.c (cb_syscall, cases stat, fstat): Handle -Wall -Werror.Doug Evans1-2/+8
1997-11-25Add comment.Doug Evans1-0/+2
1997-11-25 * callback.c (os_stat): Make 3rd arg a host struct stat ptr.Doug Evans1-38/+201
(os_fstat): Likewise. Validate fd argument. (cb_host_to_target_stat): Delete big_p arg. If HS arg is NULL, just compute target stat struct length. * syscall.c: #include "libiberty.h", <sys/types.h>, <sys/stat.h>. (ENOSYS,ENAMETOOLONG): Provide definitions if missing. (get_string): Return host errno values so they can be properly translated later. (cb_syscall): Likewise. (cb_syscall, cases open,unlink): Use get_path instead of get_string. (cb_syscall, case read): Use read_stdin for file descriptor 0. (cb_syscall, case write): Use write_stderr for file descriptor 2. (cb_syscall): Add cases for lseek, unlink, stat, fstat, time. (get_path): New function.
1997-11-17 * Make-common.in (DEP, COMMON_DEP_CFLAGS): Define.Doug Evans1-0/+306
(LIB_OBJS): Add syscall.o. (gentmap): Pass $(NL_TARGET) to $(CC). (syscall.o): Add rule for. (sim_main_headers): Add $(SIM_EXTRA_DEPS). (sim-bits.o): Depend on $(sim-n-bits_h). (sim-load.o): Depend on callback.h. * Make-common.in (cgen-*.o): Update dependencies, mem-ops.h renamed to cgen-mem.h, sem-ops.h renamed to cgen-ops.h. * cgen-mem.h, cgen-ops.h: New files. * aclocal.m4 (--enable-sim-scache): Pass -DWITH_SCACHE=0 for "=no". * Makefile.in (nltvals.def): Depend on gennltvals.sh. Rewrite build rule. * callback.c: #include string.h or strings.h. #include sys/types.h and sys/stat.h. (cb_init_syscall_map,cb_init_errno_map,cb_init_open_map): Declare. (enosys): New function. (os_get_errno,os_open): Update. (os_stat,os_fstat): New functions. (os_init): Initialize syscall_map, errno_map, open_map. (default_callback): Add entries for os_stat, os_fstat, syscall_map, errno_map, open_map, signal_map, stat_map. (cb_read_target_syscall_maps): New function. (cb_target_to_host_syscall): New function. (cb_host_to_target_errno): Renamed from host_to_target_errno. (cb_target_to_host_open): Renamed from target_to_host_open. (store): New function. (cb_host_to_target_stat): New function. * gentmap.c (sys_tdefs): New global. (gen_targ_vals_h): Output target syscall numbers. (gen_targ_map_c): Update. Output target syscall translation map. * gentvals.sh: New first argument `target'. Preface table with #ifdef NL_TARGET_$target if non-null target passed. * gennltvals.sh: New file. * nltvals.def: Regenerated.