aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2015-03-11 17:53:57 +0000
committerGary Benson <gbenson@redhat.com>2015-03-11 17:53:57 +0000
commit791c00567a7ccbae3d71e3b63ac43c0b555079dc (patch)
tree68724b3653527fe78f166e1d50e320db8c2e1cbf /gdb/gdbserver
parent1390d0efa6a03a3780541aa8100c7b52402e793d (diff)
downloadgdb-791c00567a7ccbae3d71e3b63ac43c0b555079dc.zip
gdb-791c00567a7ccbae3d71e3b63ac43c0b555079dc.tar.gz
gdb-791c00567a7ccbae3d71e3b63ac43c0b555079dc.tar.bz2
Move remote_fileio_to_fio_stat to gdb/common
This commit moves remote_fileio_to_fio_stat and its supporting functions into new files common/common-remote-fileio.[ch]. gdb/ChangeLog: * common/common-remote-fileio.h: New file. * common/common-remote-fileio.c: Likewise. * Makefile.in (SFILES): Add common/common-remote-fileio.c. (HFILES_NO_SRCDIR): Add common/common-remote-fileio.h. (COMMON_OBS): Add common-remote-fileio.o. (common-remote-fileio.o): New rule. * remote-fileio.h (common-remote-fileio.h): New include. * remote-fileio.c (gdb/fileio.h): Do not include. (remote_fileio_to_be): Moved to common-remote-fileio.h. (remote_fileio_to_fio_uint): Likewise. (remote_fileio_to_fio_time): Likewise. (remote_fileio_mode_to_target): Moved to common-remote-fileio.c. (remote_fileio_to_fio_mode): Likewise. (remote_fileio_to_fio_ulong): Likewise. (remote_fileio_to_fio_stat): Likewise. gdb/gdbserver/ChangeLog: * configure.ac (AC_CHECK_MEMBERS): Add checks for struct stat.st_blocks and struct stat.st_blksize. * configure: Regenerate. * config.in: Likewise. * Makefile.in (SFILES): Add common/common-remote-fileio.c. (OBS): Add common-remote-fileio.o. (common-remote-fileio.o): New rule.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog10
-rw-r--r--gdb/gdbserver/Makefile.in8
-rw-r--r--gdb/gdbserver/config.in6
-rwxr-xr-xgdb/gdbserver/configure77
-rw-r--r--gdb/gdbserver/configure.ac2
5 files changed, 101 insertions, 2 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index d611bfd..1a57867 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,13 @@
+2015-03-11 Gary Benson <gbenson@redhat.com>
+
+ * configure.ac (AC_CHECK_MEMBERS): Add checks for
+ struct stat.st_blocks and struct stat.st_blksize.
+ * configure: Regenerate.
+ * config.in: Likewise.
+ * Makefile.in (SFILES): Add common/common-remote-fileio.c.
+ (OBS): Add common-remote-fileio.o.
+ (common-remote-fileio.o): New rule.
+
2015-03-09 Pedro Alves <palves@redhat.com>
* tracepoint.c (gdb_agent_helper_thread): Cast '&sockaddr' to
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 6dddf26..b425ee2 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -179,7 +179,8 @@ SFILES= $(srcdir)/gdbreplay.c $(srcdir)/inferiors.c $(srcdir)/dll.c \
$(srcdir)/common/rsp-low.c $(srcdir)/common/errors.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/btrace-common.c \
+ $(srcdir)/common/common-remote-fileio.c
DEPFILES = @GDBSERVER_DEPFILES@
@@ -193,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-exceptions.o symbol.o btrace-common.o common-remote-fileio.o \
$(XML_BUILTIN) $(DEPFILES) $(LIBOBJS)
GDBREPLAY_OBS = gdbreplay.o version.o
GDBSERVER_LIBS = @GDBSERVER_LIBS@
@@ -572,6 +573,9 @@ common-exceptions.o: ../common/common-exceptions.c
waitstatus.o: ../target/waitstatus.c
$(COMPILE) $<
$(POSTCOMPILE)
+common-remote-fileio.o: ../common/common-remote-fileio.c
+ $(COMPILE) $<
+ $(POSTCOMPILE)
# Native object files rules from ../nat
diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in
index 8114628..3c3bfca 100644
--- a/gdb/gdbserver/config.in
+++ b/gdb/gdbserver/config.in
@@ -210,6 +210,12 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
+/* Define to 1 if `struct stat' is a member of `st_blksize'. */
+#undef HAVE_STRUCT_STAT_ST_BLKSIZE
+
+/* Define to 1 if `struct stat' is a member of `st_blocks'. */
+#undef HAVE_STRUCT_STAT_ST_BLOCKS
+
/* Define to 1 if the target supports __sync_*_compare_and_swap */
#undef HAVE_SYNC_BUILTINS
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index cbf4b4e..75860dd 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -2109,6 +2109,63 @@ rm -f conftest.val
return $ac_retval
} # ac_fn_c_compute_int
+
+# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
+# ----------------------------------------------------
+# Tries to find if the field MEMBER exists in type AGGR, after including
+# INCLUDES, setting cache variable VAR accordingly.
+ac_fn_c_check_member ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+$as_echo_n "checking for $2.$3... " >&6; }
+if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (ac_aggr.$3)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$4=yes"
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (sizeof ac_aggr.$3)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$4=yes"
+else
+ eval "$4=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$4
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_member
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
@@ -6085,6 +6142,26 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
+ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default"
+if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BLOCKS 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default"
+if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
+_ACEOF
+
+
+fi
+
+
ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include <sys/types.h>
#include <sys/socket.h>
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 0381aa9..34af269 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -226,6 +226,8 @@ libiberty_INIT
AC_CHECK_DECLS([strerror, perror, vasprintf, vsnprintf])
+AC_CHECK_MEMBERS([struct stat.st_blocks, struct stat.st_blksize])
+
AC_CHECK_TYPES(socklen_t, [], [],
[#include <sys/types.h>
#include <sys/socket.h>