From: Gary Benson Date: Thu, 9 Apr 2015 13:22:56 +0000 (+0100) Subject: Rename common-remote-fileio.[ch] as fileio.[ch] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7823a9415b2919241f7a7425d9dcc3c62ada0779;p=binutils-gdb.git Rename common-remote-fileio.[ch] as fileio.[ch] This commit renames common-remote-fileio.[ch] as fileio.[ch] and renames all functions in these files. gdb/ChangeLog: * common/common-remote-fileio.h: Rename to... * common/fileio.h: ...this. Update all references. (remote_fileio_to_fio_error): Rename to... (host_to_fileio_error): ...this. (remote_fileio_to_be): Rename to... (host_to_bigendian): ...this. Update all callers. (remote_fileio_to_fio_uint): Rename to... (host_to_fileio_uint): ...this. Update all callers. (remote_fileio_to_fio_time): Rename to... (host_to_fileio_time): ...this. Update all callers. (remote_fileio_to_fio_stat): Rename to... (host_to_fileio_stat): ...this. Update all references. * common/common-remote-fileio.c: Rename to... * common/fileio.c: ...this. Update all references. (remote_fileio_to_fio_error): Rename to... (host_to_fileio_error): ...this. Update all callers. (remote_fileio_mode_to_target): Rename to... (fileio_mode_pack): ...this. Update all callers. (remote_fileio_to_fio_mode): Rename to... (host_to_fileio_mode): ...this. Update all callers. (remote_fileio_to_fio_ulong): Rename to... (host_to_fileio_ulong): ...this. Update all callers. (remote_fileio_to_fio_stat): Rename to... (host_to_fileio_stat): ...this. Update all callers. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8519fea6a75..777dfa57132 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,31 @@ +2015-04-09 Gary Benson + + * common/common-remote-fileio.h: Rename to... + * common/fileio.h: ...this. Update all references. + (remote_fileio_to_fio_error): Rename to... + (host_to_fileio_error): ...this. + (remote_fileio_to_be): Rename to... + (host_to_bigendian): ...this. Update all callers. + (remote_fileio_to_fio_uint): Rename to... + (host_to_fileio_uint): ...this. Update all callers. + (remote_fileio_to_fio_time): Rename to... + (host_to_fileio_time): ...this. Update all callers. + (remote_fileio_to_fio_stat): Rename to... + (host_to_fileio_stat): ...this. + Update all references. + * common/common-remote-fileio.c: Rename to... + * common/fileio.c: ...this. Update all references. + (remote_fileio_to_fio_error): Rename to... + (host_to_fileio_error): ...this. Update all callers. + (remote_fileio_mode_to_target): Rename to... + (fileio_mode_pack): ...this. Update all callers. + (remote_fileio_to_fio_mode): Rename to... + (host_to_fileio_mode): ...this. Update all callers. + (remote_fileio_to_fio_ulong): Rename to... + (host_to_fileio_ulong): ...this. Update all callers. + (remote_fileio_to_fio_stat): Rename to... + (host_to_fileio_stat): ...this. Update all callers. + 2015-04-09 Andy Wingo * guile/scm-frame.c (gdbscm_frame_read_register): New function. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 87645cdb45b..95104ef1a4b 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -888,7 +888,7 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \ common/format.c common/filestuff.c btrace.c record-btrace.c ctf.c \ target/waitstatus.c common/print-utils.c common/rsp-low.c \ common/errors.c common/common-debug.c common/common-exceptions.c \ - common/btrace-common.c common/common-remote-fileio.c \ + common/btrace-common.c common/fileio.c \ $(SUBDIR_GCC_COMPILE_SRCS) LINTFILES = $(SFILES) $(YYFILES) $(CONFIG_SRCS) init.c @@ -979,7 +979,7 @@ i386-linux-nat.h common/common-defs.h common/errors.h common/common-types.h \ common/common-debug.h common/cleanups.h common/gdb_setjmp.h \ common/common-exceptions.h target/target.h common/symbol.h \ common/common-regcache.h fbsd-tdep.h nat/linux-personality.h \ -common/common-remote-fileio.h nat/x86-linux.h nat/x86-linux-dregs.h +common/fileio.h nat/x86-linux.h nat/x86-linux-dregs.h # Header files that already have srcdir in them, or which are in objdir. @@ -1079,7 +1079,7 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \ common-utils.o buffer.o ptid.o gdb-dlfcn.o common-agent.o \ format.o registry.o btrace.o record-btrace.o waitstatus.o \ print-utils.o rsp-low.o errors.o common-debug.o debug.o \ - common-exceptions.o btrace-common.o common-remote-fileio.o \ + common-exceptions.o btrace-common.o fileio.o \ $(SUBDIR_GCC_COMPILE_OBS) TSOBS = inflow.o @@ -2257,8 +2257,8 @@ btrace-common.o: ${srcdir}/common/btrace-common.c $(COMPILE) $(srcdir)/common/btrace-common.c $(POSTCOMPILE) -common-remote-fileio.o: ${srcdir}/common/common-remote-fileio.c - $(COMPILE) $(srcdir)/common/common-remote-fileio.c +fileio.o: ${srcdir}/common/fileio.c + $(COMPILE) $(srcdir)/common/fileio.c $(POSTCOMPILE) # # gdb/target/ dependencies diff --git a/gdb/common/common-remote-fileio.c b/gdb/common/common-remote-fileio.c deleted file mode 100644 index 30c2c6b55dc..00000000000 --- a/gdb/common/common-remote-fileio.c +++ /dev/null @@ -1,172 +0,0 @@ -/* Remote File-I/O communications - - Copyright (C) 2003-2015 Free Software Foundation, Inc. - - This file is part of GDB. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -#include "common-defs.h" -#include "common-remote-fileio.h" -#include - -/* See common-remote-fileio.h. */ - -int -remote_fileio_to_fio_error (int error) -{ - switch (error) - { - case EPERM: - return FILEIO_EPERM; - case ENOENT: - return FILEIO_ENOENT; - case EINTR: - return FILEIO_EINTR; - case EIO: - return FILEIO_EIO; - case EBADF: - return FILEIO_EBADF; - case EACCES: - return FILEIO_EACCES; - case EFAULT: - return FILEIO_EFAULT; - case EBUSY: - return FILEIO_EBUSY; - case EEXIST: - return FILEIO_EEXIST; - case ENODEV: - return FILEIO_ENODEV; - case ENOTDIR: - return FILEIO_ENOTDIR; - case EISDIR: - return FILEIO_EISDIR; - case EINVAL: - return FILEIO_EINVAL; - case ENFILE: - return FILEIO_ENFILE; - case EMFILE: - return FILEIO_EMFILE; - case EFBIG: - return FILEIO_EFBIG; - case ENOSPC: - return FILEIO_ENOSPC; - case ESPIPE: - return FILEIO_ESPIPE; - case EROFS: - return FILEIO_EROFS; - case ENOSYS: - return FILEIO_ENOSYS; - case ENAMETOOLONG: - return FILEIO_ENAMETOOLONG; - } - return FILEIO_EUNKNOWN; -} - -/* Convert a host-format mode_t into a bitmask of File-I/O flags. */ - -static LONGEST -remote_fileio_mode_to_target (mode_t mode) -{ - mode_t tmode = 0; - - if (S_ISREG (mode)) - tmode |= FILEIO_S_IFREG; - if (S_ISDIR (mode)) - tmode |= FILEIO_S_IFDIR; - if (S_ISCHR (mode)) - tmode |= FILEIO_S_IFCHR; - if (mode & S_IRUSR) - tmode |= FILEIO_S_IRUSR; - if (mode & S_IWUSR) - tmode |= FILEIO_S_IWUSR; - if (mode & S_IXUSR) - tmode |= FILEIO_S_IXUSR; -#ifdef S_IRGRP - if (mode & S_IRGRP) - tmode |= FILEIO_S_IRGRP; -#endif -#ifdef S_IWRGRP - if (mode & S_IWGRP) - tmode |= FILEIO_S_IWGRP; -#endif -#ifdef S_IXGRP - if (mode & S_IXGRP) - tmode |= FILEIO_S_IXGRP; -#endif - if (mode & S_IROTH) - tmode |= FILEIO_S_IROTH; -#ifdef S_IWOTH - if (mode & S_IWOTH) - tmode |= FILEIO_S_IWOTH; -#endif -#ifdef S_IXOTH - if (mode & S_IXOTH) - tmode |= FILEIO_S_IXOTH; -#endif - return tmode; -} - -/* Pack a host-format mode_t into an fio_mode_t. */ - -static void -remote_fileio_to_fio_mode (mode_t num, fio_mode_t fnum) -{ - remote_fileio_to_be (remote_fileio_mode_to_target (num), - (char *) fnum, 4); -} - -/* Pack a host-format integer into an fio_ulong_t. */ - -static void -remote_fileio_to_fio_ulong (LONGEST num, fio_ulong_t fnum) -{ - remote_fileio_to_be (num, (char *) fnum, 8); -} - -/* See common-remote-fileio.h. */ - -void -remote_fileio_to_fio_stat (struct stat *st, struct fio_stat *fst) -{ - LONGEST blksize; - - remote_fileio_to_fio_uint ((long) st->st_dev, fst->fst_dev); - remote_fileio_to_fio_uint ((long) st->st_ino, fst->fst_ino); - remote_fileio_to_fio_mode (st->st_mode, fst->fst_mode); - remote_fileio_to_fio_uint ((long) st->st_nlink, fst->fst_nlink); - remote_fileio_to_fio_uint ((long) st->st_uid, fst->fst_uid); - remote_fileio_to_fio_uint ((long) st->st_gid, fst->fst_gid); - remote_fileio_to_fio_uint ((long) st->st_rdev, fst->fst_rdev); - remote_fileio_to_fio_ulong ((LONGEST) st->st_size, fst->fst_size); -#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE - blksize = st->st_blksize; -#else - blksize = 512; -#endif - remote_fileio_to_fio_ulong (blksize, fst->fst_blksize); -#if HAVE_STRUCT_STAT_ST_BLOCKS - remote_fileio_to_fio_ulong ((LONGEST) st->st_blocks, fst->fst_blocks); -#else - /* FIXME: This is correct for DJGPP, but other systems that don't - have st_blocks, if any, might prefer 512 instead of st_blksize. - (eliz, 30-12-2003) */ - remote_fileio_to_fio_ulong (((LONGEST) st->st_size + blksize - 1) - / blksize, - fst->fst_blocks); -#endif - remote_fileio_to_fio_time (st->st_atime, fst->fst_atime); - remote_fileio_to_fio_time (st->st_mtime, fst->fst_mtime); - remote_fileio_to_fio_time (st->st_ctime, fst->fst_ctime); -} diff --git a/gdb/common/common-remote-fileio.h b/gdb/common/common-remote-fileio.h deleted file mode 100644 index 96e4aa5eb98..00000000000 --- a/gdb/common/common-remote-fileio.h +++ /dev/null @@ -1,65 +0,0 @@ -/* Remote File-I/O communications - - Copyright (C) 2003-2015 Free Software Foundation, Inc. - - This file is part of GDB. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -#ifndef COMMON_REMOTE_FILEIO_H -#define COMMON_REMOTE_FILEIO_H - -#include "gdb/fileio.h" -#include - -/* Convert a errno error number to a File-I/O error number for - transmission over the remote protocol. */ - -extern int remote_fileio_to_fio_error (int error); - -/* Pack a host-format integer into a byte buffer in big-endian format - ready for transmission over the remote protocol. BYTES specifies - the size of the integer to pack in bytes. */ - -static inline void -remote_fileio_to_be (LONGEST num, char *buf, int bytes) -{ - int i; - - for (i = 0; i < bytes; ++i) - buf[i] = (num >> (8 * (bytes - i - 1))) & 0xff; -} - -/* Pack a host-format integer into an fio_uint_t. */ - -static inline void -remote_fileio_to_fio_uint (long num, fio_uint_t fnum) -{ - remote_fileio_to_be ((LONGEST) num, (char *) fnum, 4); -} - -/* Pack a host-format time_t into an fio_time_t. */ - -static inline void -remote_fileio_to_fio_time (time_t num, fio_time_t fnum) -{ - remote_fileio_to_be ((LONGEST) num, (char *) fnum, 4); -} - -/* Pack a host-format struct stat into a struct fio_stat. */ - -extern void remote_fileio_to_fio_stat (struct stat *st, - struct fio_stat *fst); - -#endif /* COMMON_REMOTE_FILEIO_H */ diff --git a/gdb/common/fileio.c b/gdb/common/fileio.c new file mode 100644 index 00000000000..5d3e6aedf3f --- /dev/null +++ b/gdb/common/fileio.c @@ -0,0 +1,171 @@ +/* File-I/O functions for GDB, the GNU debugger. + + Copyright (C) 2003-2015 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include "common-defs.h" +#include "fileio.h" +#include + +/* See fileio.h. */ + +int +host_to_fileio_error (int error) +{ + switch (error) + { + case EPERM: + return FILEIO_EPERM; + case ENOENT: + return FILEIO_ENOENT; + case EINTR: + return FILEIO_EINTR; + case EIO: + return FILEIO_EIO; + case EBADF: + return FILEIO_EBADF; + case EACCES: + return FILEIO_EACCES; + case EFAULT: + return FILEIO_EFAULT; + case EBUSY: + return FILEIO_EBUSY; + case EEXIST: + return FILEIO_EEXIST; + case ENODEV: + return FILEIO_ENODEV; + case ENOTDIR: + return FILEIO_ENOTDIR; + case EISDIR: + return FILEIO_EISDIR; + case EINVAL: + return FILEIO_EINVAL; + case ENFILE: + return FILEIO_ENFILE; + case EMFILE: + return FILEIO_EMFILE; + case EFBIG: + return FILEIO_EFBIG; + case ENOSPC: + return FILEIO_ENOSPC; + case ESPIPE: + return FILEIO_ESPIPE; + case EROFS: + return FILEIO_EROFS; + case ENOSYS: + return FILEIO_ENOSYS; + case ENAMETOOLONG: + return FILEIO_ENAMETOOLONG; + } + return FILEIO_EUNKNOWN; +} + +/* Convert a host-format mode_t into a bitmask of File-I/O flags. */ + +static LONGEST +fileio_mode_pack (mode_t mode) +{ + mode_t tmode = 0; + + if (S_ISREG (mode)) + tmode |= FILEIO_S_IFREG; + if (S_ISDIR (mode)) + tmode |= FILEIO_S_IFDIR; + if (S_ISCHR (mode)) + tmode |= FILEIO_S_IFCHR; + if (mode & S_IRUSR) + tmode |= FILEIO_S_IRUSR; + if (mode & S_IWUSR) + tmode |= FILEIO_S_IWUSR; + if (mode & S_IXUSR) + tmode |= FILEIO_S_IXUSR; +#ifdef S_IRGRP + if (mode & S_IRGRP) + tmode |= FILEIO_S_IRGRP; +#endif +#ifdef S_IWRGRP + if (mode & S_IWGRP) + tmode |= FILEIO_S_IWGRP; +#endif +#ifdef S_IXGRP + if (mode & S_IXGRP) + tmode |= FILEIO_S_IXGRP; +#endif + if (mode & S_IROTH) + tmode |= FILEIO_S_IROTH; +#ifdef S_IWOTH + if (mode & S_IWOTH) + tmode |= FILEIO_S_IWOTH; +#endif +#ifdef S_IXOTH + if (mode & S_IXOTH) + tmode |= FILEIO_S_IXOTH; +#endif + return tmode; +} + +/* Pack a host-format mode_t into an fio_mode_t. */ + +static void +host_to_fileio_mode (mode_t num, fio_mode_t fnum) +{ + host_to_bigendian (fileio_mode_pack (num), (char *) fnum, 4); +} + +/* Pack a host-format integer into an fio_ulong_t. */ + +static void +host_to_fileio_ulong (LONGEST num, fio_ulong_t fnum) +{ + host_to_bigendian (num, (char *) fnum, 8); +} + +/* See fileio.h. */ + +void +host_to_fileio_stat (struct stat *st, struct fio_stat *fst) +{ + LONGEST blksize; + + host_to_fileio_uint ((long) st->st_dev, fst->fst_dev); + host_to_fileio_uint ((long) st->st_ino, fst->fst_ino); + host_to_fileio_mode (st->st_mode, fst->fst_mode); + host_to_fileio_uint ((long) st->st_nlink, fst->fst_nlink); + host_to_fileio_uint ((long) st->st_uid, fst->fst_uid); + host_to_fileio_uint ((long) st->st_gid, fst->fst_gid); + host_to_fileio_uint ((long) st->st_rdev, fst->fst_rdev); + host_to_fileio_ulong ((LONGEST) st->st_size, fst->fst_size); +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + blksize = st->st_blksize; +#else + blksize = 512; +#endif + host_to_fileio_ulong (blksize, fst->fst_blksize); +#if HAVE_STRUCT_STAT_ST_BLOCKS + host_to_fileio_ulong ((LONGEST) st->st_blocks, fst->fst_blocks); +#else + /* FIXME: This is correct for DJGPP, but other systems that don't + have st_blocks, if any, might prefer 512 instead of st_blksize. + (eliz, 30-12-2003) */ + host_to_fileio_ulong (((LONGEST) st->st_size + blksize - 1) + / blksize, + fst->fst_blocks); +#endif + host_to_fileio_time (st->st_atime, fst->fst_atime); + host_to_fileio_time (st->st_mtime, fst->fst_mtime); + host_to_fileio_time (st->st_ctime, fst->fst_ctime); +} diff --git a/gdb/common/fileio.h b/gdb/common/fileio.h new file mode 100644 index 00000000000..69a735f9e7c --- /dev/null +++ b/gdb/common/fileio.h @@ -0,0 +1,63 @@ +/* File-I/O functions for GDB, the GNU debugger. + + Copyright (C) 2003-2015 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef FILEIO_H +#define FILEIO_H + +#include "gdb/fileio.h" +#include + +/* Convert a host-format errno value to a File-I/O error number. */ + +extern int host_to_fileio_error (int error); + +/* Pack a host-format integer into a byte buffer in big-endian + format. BYTES specifies the size of the integer to pack in + bytes. */ + +static inline void +host_to_bigendian (LONGEST num, char *buf, int bytes) +{ + int i; + + for (i = 0; i < bytes; ++i) + buf[i] = (num >> (8 * (bytes - i - 1))) & 0xff; +} + +/* Pack a host-format integer into an fio_uint_t. */ + +static inline void +host_to_fileio_uint (long num, fio_uint_t fnum) +{ + host_to_bigendian ((LONGEST) num, (char *) fnum, 4); +} + +/* Pack a host-format time_t into an fio_time_t. */ + +static inline void +host_to_fileio_time (time_t num, fio_time_t fnum) +{ + host_to_bigendian ((LONGEST) num, (char *) fnum, 4); +} + +/* Pack a host-format struct stat into a struct fio_stat. */ + +extern void host_to_fileio_stat (struct stat *st, struct fio_stat *fst); + +#endif /* FILEIO_H */ diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index 9d698c6a23d..a981ee80e16 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -180,7 +180,7 @@ SFILES= $(srcdir)/gdbreplay.c $(srcdir)/inferiors.c $(srcdir)/dll.c \ $(srcdir)/common/common-debug.c $(srcdir)/common/cleanups.c \ $(srcdir)/common/common-exceptions.c $(srcdir)/symbol.c \ $(srcdir)/common/btrace-common.c \ - $(srcdir)/common/common-remote-fileio.c + $(srcdir)/common/fileio.c DEPFILES = @GDBSERVER_DEPFILES@ @@ -194,7 +194,7 @@ OBS = agent.o ax.o inferiors.o regcache.o remote-utils.o server.o signals.o \ mem-break.o hostio.o event-loop.o tracepoint.o xml-utils.o \ common-utils.o ptid.o buffer.o format.o filestuff.o dll.o notif.o \ tdesc.o print-utils.o rsp-low.o errors.o common-debug.o cleanups.o \ - common-exceptions.o symbol.o btrace-common.o common-remote-fileio.o \ + common-exceptions.o symbol.o btrace-common.o fileio.o \ $(XML_BUILTIN) $(DEPFILES) $(LIBOBJS) GDBREPLAY_OBS = gdbreplay.o version.o GDBSERVER_LIBS = @GDBSERVER_LIBS@ @@ -573,7 +573,7 @@ common-exceptions.o: ../common/common-exceptions.c waitstatus.o: ../target/waitstatus.c $(COMPILE) $< $(POSTCOMPILE) -common-remote-fileio.o: ../common/common-remote-fileio.c +fileio.o: ../common/fileio.c $(COMPILE) $< $(POSTCOMPILE) diff --git a/gdb/gdbserver/hostio-errno.c b/gdb/gdbserver/hostio-errno.c index 01d4b32cba4..452ec9f874f 100644 --- a/gdb/gdbserver/hostio-errno.c +++ b/gdb/gdbserver/hostio-errno.c @@ -22,12 +22,12 @@ on top of errno. */ #include "server.h" -#include "common-remote-fileio.h" +#include "fileio.h" void hostio_last_error_from_errno (char *buf) { int error = errno; - int fileio_error = remote_fileio_to_fio_error (error); + int fileio_error = host_to_fileio_error (error); sprintf (buf, "F-1,%x", fileio_error); } diff --git a/gdb/gdbserver/hostio.c b/gdb/gdbserver/hostio.c index aa659e24745..b03b5ad11bf 100644 --- a/gdb/gdbserver/hostio.c +++ b/gdb/gdbserver/hostio.c @@ -27,7 +27,7 @@ #include #include #include -#include "common-remote-fileio.h" +#include "fileio.h" extern int remote_debug; @@ -438,7 +438,7 @@ handle_fstat (char *own_buf, int *new_packet_len) return; } - remote_fileio_to_fio_stat (&st, &fst); + host_to_fileio_stat (&st, &fst); bytes_sent = hostio_reply_with_data (own_buf, (char *) &fst, sizeof (fst), diff --git a/gdb/inf-child.c b/gdb/inf-child.c index 5e5763bda5e..713c9d43b55 100644 --- a/gdb/inf-child.c +++ b/gdb/inf-child.c @@ -30,7 +30,7 @@ #include "inferior.h" #include #include "inf-child.h" -#include "common-remote-fileio.h" +#include "fileio.h" #include "agent.h" #include "gdb_wait.h" #include "filestuff.h" @@ -260,7 +260,7 @@ inf_child_fileio_open (struct target_ops *self, the standard values. */ fd = gdb_open_cloexec (filename, nat_flags, mode); if (fd == -1) - *target_errno = remote_fileio_to_fio_error (errno); + *target_errno = host_to_fileio_error (errno); return fd; } @@ -289,7 +289,7 @@ inf_child_fileio_pwrite (struct target_ops *self, } if (ret == -1) - *target_errno = remote_fileio_to_fio_error (errno); + *target_errno = host_to_fileio_error (errno); return ret; } @@ -318,7 +318,7 @@ inf_child_fileio_pread (struct target_ops *self, } if (ret == -1) - *target_errno = remote_fileio_to_fio_error (errno); + *target_errno = host_to_fileio_error (errno); return ret; } @@ -332,7 +332,7 @@ inf_child_fileio_fstat (struct target_ops *self, int fd, ret = fstat (fd, sb); if (ret == -1) - *target_errno = remote_fileio_to_fio_error (errno); + *target_errno = host_to_fileio_error (errno); return ret; } @@ -346,7 +346,7 @@ inf_child_fileio_close (struct target_ops *self, int fd, int *target_errno) ret = close (fd); if (ret == -1) - *target_errno = remote_fileio_to_fio_error (errno); + *target_errno = host_to_fileio_error (errno); return ret; } @@ -361,7 +361,7 @@ inf_child_fileio_unlink (struct target_ops *self, ret = unlink (filename); if (ret == -1) - *target_errno = remote_fileio_to_fio_error (errno); + *target_errno = host_to_fileio_error (errno); return ret; } @@ -383,7 +383,7 @@ inf_child_fileio_readlink (struct target_ops *self, len = readlink (filename, buf, sizeof buf); if (len < 0) { - *target_errno = remote_fileio_to_fio_error (errno); + *target_errno = host_to_fileio_error (errno); return NULL; } diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c index 36c3849e2c9..a33acf91ef6 100644 --- a/gdb/remote-fileio.c +++ b/gdb/remote-fileio.c @@ -290,13 +290,13 @@ remote_fileio_extract_ptr_w_len (char **buf, CORE_ADDR *ptrval, int *length) static void remote_fileio_to_fio_long (LONGEST num, fio_long_t fnum) { - remote_fileio_to_be (num, (char *) fnum, 8); + host_to_bigendian (num, (char *) fnum, 8); } static void remote_fileio_to_fio_timeval (struct timeval *tv, struct fio_timeval *ftv) { - remote_fileio_to_fio_time (tv->tv_sec, ftv->ftv_sec); + host_to_fileio_time (tv->tv_sec, ftv->ftv_sec); remote_fileio_to_fio_long (tv->tv_usec, ftv->ftv_usec); } @@ -408,7 +408,7 @@ static void remote_fileio_return_errno (int retcode) { remote_fileio_reply (retcode, retcode < 0 - ? remote_fileio_to_fio_error (errno) : 0); + ? host_to_fileio_error (errno) : 0); } static void @@ -953,8 +953,8 @@ remote_fileio_func_stat (char *buf) } if (statptr) { - remote_fileio_to_fio_stat (&st, &fst); - remote_fileio_to_fio_uint (0, fst.fst_dev); + host_to_fileio_stat (&st, &fst); + host_to_fileio_uint (0, fst.fst_dev); errno = target_write_memory (statptr, (gdb_byte *) &fst, sizeof fst); if (errno != 0) @@ -1000,7 +1000,7 @@ remote_fileio_func_fstat (char *buf) remote_fio_no_longjmp = 1; if (fd == FIO_FD_CONSOLE_IN || fd == FIO_FD_CONSOLE_OUT) { - remote_fileio_to_fio_uint (1, fst.fst_dev); + host_to_fileio_uint (1, fst.fst_dev); memset (&st, 0, sizeof (st)); st.st_mode = S_IFCHR | (fd == FIO_FD_CONSOLE_IN ? S_IRUSR : S_IWUSR); st.st_nlink = 1; @@ -1032,7 +1032,7 @@ remote_fileio_func_fstat (char *buf) } if (ptrval) { - remote_fileio_to_fio_stat (&st, &fst); + host_to_fileio_stat (&st, &fst); errno = target_write_memory (ptrval, (gdb_byte *) &fst, sizeof fst); if (errno != 0) diff --git a/gdb/remote-fileio.h b/gdb/remote-fileio.h index d30ae6a35bc..21096a0f515 100644 --- a/gdb/remote-fileio.h +++ b/gdb/remote-fileio.h @@ -22,7 +22,7 @@ #ifndef REMOTE_FILEIO_H #define REMOTE_FILEIO_H -#include "common-remote-fileio.h" +#include "fileio.h" struct cmd_list_element;