Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH][gdbserver] Check for sys/dir.h and sys.user.h in configuration.
@ 2008-07-23  1:00 Doug Kwan (關振德)
  2008-07-23  3:49 ` Michael Snyder
  2008-07-23  7:57 ` Andreas Schwab
  0 siblings, 2 replies; 12+ messages in thread
From: Doug Kwan (關振德) @ 2008-07-23  1:00 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]

Hi,

    gdbserver does not compile for the Android operating system
because of missing headers sys/user.h and sys/dir.h and a declaration
of errno inside a function.  The following patch fixes these problem.
Does it look okay? If so, could someone approve and commit it for me?
Thanks.

-Doug

2008-07-22  Doug Kwan  <dougkwan@google.com>

        * configure.ac: Check for sys/dir.h and sys.user.h.
        * config.in configure: Regenerate.
        * linux-low.c: Include <sys/dir.h> if HAVE_SYS_DIR_H is defined.
        Include <sys/user.h> if HAVE_SYS_USER_H is defined.
        (linux_write_memory): Declare errno if STDC_HEADERS is not defined.

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 20299 bytes --]

Index: gdb/gdbserver/config.in
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/config.in,v
retrieving revision 1.21
diff -u -u -p -r1.21 config.in
--- gdb/gdbserver/config.in	5 Jun 2008 22:36:57 -0000	1.21
+++ gdb/gdbserver/config.in	23 Jul 2008 00:36:56 -0000
@@ -102,6 +102,9 @@
 /* Define to 1 if you have the <string.h> header file. */
 #undef HAVE_STRING_H
 
+/* Define to 1 if you have the <sys/dir.h> header file. */
+#undef HAVE_SYS_DIR_H
+
 /* Define to 1 if you have the <sys/file.h> header file. */
 #undef HAVE_SYS_FILE_H
 
@@ -123,6 +126,9 @@
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
+/* Define to 1 if you have the <sys/user.h> header file. */
+#undef HAVE_SYS_USER_H
+
 /* Define to 1 if you have the <sys/wait.h> header file. */
 #undef HAVE_SYS_WAIT_H
 
Index: gdb/gdbserver/configure
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/configure,v
retrieving revision 1.36
diff -u -u -p -r1.36 configure
--- gdb/gdbserver/configure	5 Jun 2008 22:36:57 -0000	1.36
+++ gdb/gdbserver/configure	23 Jul 2008 00:36:56 -0000
@@ -312,6 +312,7 @@ ac_includes_default="\
 
 ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP LIBOBJS PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI RDYNAMIC GDBSERVER_DEPFILES GDBSERVER_LIBS USE_THREAD_DB srv_xmlbuiltin srv_xmlfiles LTLIBOBJS'
 ac_subst_files=''
+ac_pwd=`pwd`
 
 # Initialize some variables set by options.
 ac_init_help=
@@ -954,7 +955,7 @@ esac
     else
       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
     fi
-    cd $ac_popdir
+    cd "$ac_popdir"
   done
 fi
 
@@ -1279,6 +1280,8 @@ echo "$as_me:   current value: \`$ac_new
   fi
 done
 if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
   { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
   { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
@@ -1310,6 +1313,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
+
+
+
           ac_config_headers="$ac_config_headers config.h:config.in"
 
 
@@ -1623,11 +1629,13 @@ fi
 fi
 
 
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+test -z "$CC" && { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&5
 echo "$as_me: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 
 # Provide some information about the compiler.
 echo "$as_me:$LINENO:" \
@@ -1713,11 +1721,13 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+{ { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
 { { echo "$as_me:$LINENO: error: C compiler cannot create executables
 See \`config.log' for more details." >&5
 echo "$as_me: error: C compiler cannot create executables
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
 fi
 
 ac_exeext=$ac_cv_exeext
@@ -1742,13 +1752,15 @@ if test "$cross_compiling" != yes; then
     if test "$cross_compiling" = maybe; then
 	cross_compiling=yes
     else
-	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+	{ { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
     fi
   fi
 fi
@@ -1786,11 +1798,13 @@ for ac_file in conftest.exe conftest con
   esac
 done
 else
-  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+  { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 fi
 
 rm -f conftest$ac_cv_exeext
@@ -1837,11 +1851,13 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+{ { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute suffix of object files: cannot compile
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 fi
 
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
@@ -1882,8 +1898,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -1941,8 +1956,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2058,8 +2072,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2113,8 +2126,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2159,8 +2171,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2204,8 +2215,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2675,11 +2685,13 @@ rm -f conftest.err conftest.$ac_ext
 if $ac_preproc_ok; then
   :
 else
-  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+  { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
 See \`config.log' for more details." >&5
 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 fi
 
 ac_ext=c
@@ -2737,8 +2749,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2909,8 +2920,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -2966,7 +2976,9 @@ done
 
 
 
-for ac_header in sgtty.h termio.h termios.h sys/reg.h string.h 		 proc_service.h sys/procfs.h thread_db.h linux/elf.h 		 stdlib.h unistd.h  		 errno.h fcntl.h signal.h sys/file.h malloc.h 		 sys/ioctl.h netinet/in.h sys/socket.h netdb.h 		 netinet/tcp.h arpa/inet.h sys/wait.h
+
+
+for ac_header in sgtty.h termio.h termios.h sys/reg.h string.h 		 proc_service.h sys/procfs.h thread_db.h linux/elf.h 		 stdlib.h unistd.h  		 errno.h fcntl.h signal.h sys/file.h malloc.h 		 sys/ioctl.h netinet/in.h sys/socket.h netdb.h 		 netinet/tcp.h arpa/inet.h sys/wait.h sys/dir.h sys/user.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -2999,8 +3011,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3186,8 +3197,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3288,8 +3298,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3362,8 +3371,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3416,8 +3424,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3482,8 +3489,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3552,8 +3558,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3628,8 +3633,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3782,8 +3786,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3844,8 +3847,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3910,8 +3912,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3975,8 +3976,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4040,8 +4040,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4105,8 +4104,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4185,8 +4183,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4243,8 +4240,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4321,8 +4317,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4375,8 +4370,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4433,8 +4427,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -5317,11 +5310,6 @@ esac
   *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
   esac
 
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
   # Let's still pretend it is `configure' which instantiates (i.e., don't
   # use $as_me), people would be surprised to read:
   #    /* config.h.  Generated by config.status.  */
@@ -5360,6 +5348,12 @@ echo "$as_me: error: cannot find input f
 	 fi;;
       esac
     done` || { (exit 1); exit 1; }
+
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
   sed "$ac_vpsub
Index: gdb/gdbserver/configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/configure.ac,v
retrieving revision 1.23
diff -u -u -p -r1.23 configure.ac
--- gdb/gdbserver/configure.ac	5 Jun 2008 22:36:57 -0000	1.23
+++ gdb/gdbserver/configure.ac	23 Jul 2008 00:36:56 -0000
@@ -41,7 +41,7 @@ AC_CHECK_HEADERS(sgtty.h termio.h termio
 		 stdlib.h unistd.h dnl
  		 errno.h fcntl.h signal.h sys/file.h malloc.h dnl
 		 sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl
-		 netinet/tcp.h arpa/inet.h sys/wait.h)
+		 netinet/tcp.h arpa/inet.h sys/wait.h sys/dir.h sys/user.h)
 AC_CHECK_FUNCS(pread pwrite pread64)
 AC_REPLACE_FUNCS(memmem)
 
Index: gdb/gdbserver/linux-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-low.c,v
retrieving revision 1.78
diff -u -u -p -r1.78 linux-low.c
--- gdb/gdbserver/linux-low.c	12 Jul 2008 22:22:42 -0000	1.78
+++ gdb/gdbserver/linux-low.c	23 Jul 2008 00:36:56 -0000
@@ -23,9 +23,13 @@
 #include <sys/wait.h>
 #include <stdio.h>
 #include <sys/param.h>
+#ifdef HAVE_SYS_DIR_H
 #include <sys/dir.h>
+#endif
 #include <sys/ptrace.h>
+#ifdef HAVE_SYS_USER_H
 #include <sys/user.h>
+#endif
 #include <signal.h>
 #include <sys/ioctl.h>
 #include <fcntl.h>
@@ -1704,7 +1708,9 @@ linux_write_memory (CORE_ADDR memaddr, c
   = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1) / sizeof (PTRACE_XFER_TYPE);
   /* Allocate buffer of that many longwords.  */
   register PTRACE_XFER_TYPE *buffer = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
+#ifndef STDC_HEADERS
   extern int errno;
+#endif
 
   if (debug_threads)
     {

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][gdbserver] Check for sys/dir.h and sys.user.h in  configuration.
  2008-07-23  1:00 [PATCH][gdbserver] Check for sys/dir.h and sys.user.h in configuration Doug Kwan (關振德)
@ 2008-07-23  3:49 ` Michael Snyder
  2008-07-23  8:29   ` Doug Kwan (關振德)
  2008-07-23 14:15   ` Thiago Jung Bauermann
  2008-07-23  7:57 ` Andreas Schwab
  1 sibling, 2 replies; 12+ messages in thread
From: Michael Snyder @ 2008-07-23  3:49 UTC (permalink / raw)
  To: Doug Kwan (關振德); +Cc: gdb-patches

On Tue, 2008-07-22 at 17:59 -0700, Doug Kwan (關振德) wrote:
> Hi,
> 
>     gdbserver does not compile for the Android operating system
> because of missing headers sys/user.h and sys/dir.h and a declaration
> of errno inside a function.  The following patch fixes these problem.
> Does it look okay? If so, could someone approve and commit it for me?
> Thanks.
> 
> -Doug
> 
> 2008-07-22  Doug Kwan  <dougkwan@google.com>
> 
>         * configure.ac: Check for sys/dir.h and sys.user.h.
>         * config.in configure: Regenerate.
>         * linux-low.c: Include <sys/dir.h> if HAVE_SYS_DIR_H is defined.
>         Include <sys/user.h> if HAVE_SYS_USER_H is defined.
>         (linux_write_memory): Declare errno if STDC_HEADERS is not defined.

I'm surprised by some of the diffs in the generated configure
script -- wonder if you used a different version of autoconf
or something?

Otherwise looks pretty OK.  
I don't know enough to say whether STDC_HEADERS is the right
ifdef for the errno change in linux_write_memory.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][gdbserver] Check for sys/dir.h and sys.user.h in configuration.
  2008-07-23  1:00 [PATCH][gdbserver] Check for sys/dir.h and sys.user.h in configuration Doug Kwan (關振德)
  2008-07-23  3:49 ` Michael Snyder
@ 2008-07-23  7:57 ` Andreas Schwab
  2008-07-23  8:33   ` Doug Kwan (關振德)
  1 sibling, 1 reply; 12+ messages in thread
From: Andreas Schwab @ 2008-07-23  7:57 UTC (permalink / raw)
  To:  Doug Kwan ; +Cc: gdb-patches

""Doug Kwan (關振德)"" <dougkwan@google.com> writes:

> @@ -1704,7 +1708,9 @@ linux_write_memory (CORE_ADDR memaddr, c
>    = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1) / sizeof (PTRACE_XFER_TYPE);
>    /* Allocate buffer of that many longwords.  */
>    register PTRACE_XFER_TYPE *buffer = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
> +#ifndef STDC_HEADERS
>    extern int errno;
> +#endif

Just delete that declaration, errno is already used before that function
anyway.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][gdbserver] Check for sys/dir.h and sys.user.h in configuration.
  2008-07-23  3:49 ` Michael Snyder
@ 2008-07-23  8:29   ` Doug Kwan (關振德)
  2008-07-23 14:15   ` Thiago Jung Bauermann
  1 sibling, 0 replies; 12+ messages in thread
From: Doug Kwan (關振德) @ 2008-07-23  8:29 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches

Hi,

2008/7/22 Michael Snyder <msnyder@specifix.com>:

> I'm surprised by some of the diffs in the generated configure
> script -- wonder if you used a different version of autoconf
> or something?

I don't know.  My autoconf claims to be 2.59 and the original
configure is generated by autoconf 2.59 also.

> Otherwise looks pretty OK.
> I don't know enough to say whether STDC_HEADERS is the right
> ifdef for the errno change in linux_write_memory.

This is done in gdbreplay.c also.  I assume that's the correct way to
do it. But it's moot now as another reviewer suggests removing the
declaration altogether.

-Doug


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][gdbserver] Check for sys/dir.h and sys.user.h in configuration.
  2008-07-23  7:57 ` Andreas Schwab
@ 2008-07-23  8:33   ` Doug Kwan (關振德)
  0 siblings, 0 replies; 12+ messages in thread
From: Doug Kwan (關振德) @ 2008-07-23  8:33 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gdb-patches

Hi

2008/7/23 Andreas Schwab <schwab@suse.de>:
> ""Doug Kwan (關振德)"" <dougkwan@google.com> writes:

> Just delete that declaration, errno is already used before that function
> anyway.

So it's okay to commit this patch if I remove the declaration? Sorry,
I have never submitted a patch to gdb.

-Doug

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][gdbserver] Check for sys/dir.h and sys.user.h in  configuration.
  2008-07-23  3:49 ` Michael Snyder
  2008-07-23  8:29   ` Doug Kwan (關振德)
@ 2008-07-23 14:15   ` Thiago Jung Bauermann
  2008-07-23 14:33     ` Daniel Jacobowitz
  1 sibling, 1 reply; 12+ messages in thread
From: Thiago Jung Bauermann @ 2008-07-23 14:15 UTC (permalink / raw)
  To: Michael Snyder; +Cc: Doug Kwan (關振德), gdb-patches

On Tue, 2008-07-22 at 20:48 -0700, Michael Snyder wrote:
> I'm surprised by some of the diffs in the generated configure
> script -- wonder if you used a different version of autoconf
> or something?

When I regenerate configure in my system here I get the same spurious
diffs that Doug Kwan got. I'm using Debian, with autoconf package
version 2.59a-3.
-- 
[]'s
Thiago Jung Bauermann
Software Engineer
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][gdbserver] Check for sys/dir.h and sys.user.h in  configuration.
  2008-07-23 14:15   ` Thiago Jung Bauermann
@ 2008-07-23 14:33     ` Daniel Jacobowitz
  2008-07-23 17:15       ` Doug Kwan (關振德)
  2008-07-25 21:35       ` Doug Kwan (關振德)
  0 siblings, 2 replies; 12+ messages in thread
From: Daniel Jacobowitz @ 2008-07-23 14:33 UTC (permalink / raw)
  To: Thiago Jung Bauermann
  Cc: Michael Snyder, Doug Kwan (關振德), gdb-patches

On Wed, Jul 23, 2008 at 11:01:51AM -0300, Thiago Jung Bauermann wrote:
> On Tue, 2008-07-22 at 20:48 -0700, Michael Snyder wrote:
> > I'm surprised by some of the diffs in the generated configure
> > script -- wonder if you used a different version of autoconf
> > or something?
> 
> When I regenerate configure in my system here I get the same spurious
> diffs that Doug Kwan got. I'm using Debian, with autoconf package
> version 2.59a-3.

Yes.  If you want to get a clean diff, use the actual autoconf
release - not Debian's package of it.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][gdbserver] Check for sys/dir.h and sys.user.h in configuration.
  2008-07-23 14:33     ` Daniel Jacobowitz
@ 2008-07-23 17:15       ` Doug Kwan (關振德)
  2008-07-25 21:42         ` Daniel Jacobowitz
  2008-07-25 21:35       ` Doug Kwan (關振德)
  1 sibling, 1 reply; 12+ messages in thread
From: Doug Kwan (關振德) @ 2008-07-23 17:15 UTC (permalink / raw)
  To: Thiago Jung Bauermann, Michael Snyder,
	Doug Kwan (關振德),
	gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1154 bytes --]

I used the autoconf-2.59.tar.bz2 from ftp.gnu.org. I got fewer spurios
diffs than before but there still seems to be some left.  Here is an
updated patch.

-Doug

2008-07-23  Doug Kwan  <dougkwan@google.com>

        * configure.ac: Check for sys/dir.h and sys.user.h.
        * config.in configure: Regenerate.
        * linux-low.c: Include <sys/dir.h> if HAVE_SYS_DIR_H is defined.
        Include <sys/user.h> if HAVE_SYS_USER_H is defined.
        (linux_write_memory): Remove declaration of errno.



2008/7/23 Daniel Jacobowitz <drow@false.org>:
> On Wed, Jul 23, 2008 at 11:01:51AM -0300, Thiago Jung Bauermann wrote:
>> On Tue, 2008-07-22 at 20:48 -0700, Michael Snyder wrote:
>> > I'm surprised by some of the diffs in the generated configure
>> > script -- wonder if you used a different version of autoconf
>> > or something?
>>
>> When I regenerate configure in my system here I get the same spurious
>> diffs that Doug Kwan got. I'm using Debian, with autoconf package
>> version 2.59a-3.
>
> Yes.  If you want to get a clean diff, use the actual autoconf
> release - not Debian's package of it.
>
> --
> Daniel Jacobowitz
> CodeSourcery
>

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 8675 bytes --]

Index: gdb/gdbserver/config.in
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/config.in,v
retrieving revision 1.21
diff -u -u -p -r1.21 config.in
--- gdb/gdbserver/config.in	5 Jun 2008 22:36:57 -0000	1.21
+++ gdb/gdbserver/config.in	23 Jul 2008 17:07:04 -0000
@@ -102,6 +102,9 @@
 /* Define to 1 if you have the <string.h> header file. */
 #undef HAVE_STRING_H
 
+/* Define to 1 if you have the <sys/dir.h> header file. */
+#undef HAVE_SYS_DIR_H
+
 /* Define to 1 if you have the <sys/file.h> header file. */
 #undef HAVE_SYS_FILE_H
 
@@ -123,6 +126,9 @@
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
+/* Define to 1 if you have the <sys/user.h> header file. */
+#undef HAVE_SYS_USER_H
+
 /* Define to 1 if you have the <sys/wait.h> header file. */
 #undef HAVE_SYS_WAIT_H
 
Index: gdb/gdbserver/configure
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/configure,v
retrieving revision 1.36
diff -u -u -p -r1.36 configure
--- gdb/gdbserver/configure	5 Jun 2008 22:36:57 -0000	1.36
+++ gdb/gdbserver/configure	23 Jul 2008 17:07:04 -0000
@@ -312,6 +312,7 @@ ac_includes_default="\
 
 ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP LIBOBJS PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI RDYNAMIC GDBSERVER_DEPFILES GDBSERVER_LIBS USE_THREAD_DB srv_xmlbuiltin srv_xmlfiles LTLIBOBJS'
 ac_subst_files=''
+ac_pwd=`pwd`
 
 # Initialize some variables set by options.
 ac_init_help=
@@ -1279,6 +1280,8 @@ echo "$as_me:   current value: \`$ac_new
   fi
 done
 if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
   { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
   { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
@@ -1310,6 +1313,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
+
+
+
           ac_config_headers="$ac_config_headers config.h:config.in"
 
 
@@ -1623,11 +1629,13 @@ fi
 fi
 
 
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+test -z "$CC" && { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&5
 echo "$as_me: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 
 # Provide some information about the compiler.
 echo "$as_me:$LINENO:" \
@@ -1713,11 +1721,13 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+{ { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
 { { echo "$as_me:$LINENO: error: C compiler cannot create executables
 See \`config.log' for more details." >&5
 echo "$as_me: error: C compiler cannot create executables
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
 fi
 
 ac_exeext=$ac_cv_exeext
@@ -1742,13 +1752,15 @@ if test "$cross_compiling" != yes; then
     if test "$cross_compiling" = maybe; then
 	cross_compiling=yes
     else
-	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+	{ { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
     fi
   fi
 fi
@@ -1786,11 +1798,13 @@ for ac_file in conftest.exe conftest con
   esac
 done
 else
-  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+  { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 fi
 
 rm -f conftest$ac_cv_exeext
@@ -1837,11 +1851,13 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+{ { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot compute suffix of object files: cannot compile
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 fi
 
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
@@ -2675,11 +2691,13 @@ rm -f conftest.err conftest.$ac_ext
 if $ac_preproc_ok; then
   :
 else
-  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+  { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
 See \`config.log' for more details." >&5
 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 fi
 
 ac_ext=c
@@ -2966,7 +2984,9 @@ done
 
 
 
-for ac_header in sgtty.h termio.h termios.h sys/reg.h string.h 		 proc_service.h sys/procfs.h thread_db.h linux/elf.h 		 stdlib.h unistd.h  		 errno.h fcntl.h signal.h sys/file.h malloc.h 		 sys/ioctl.h netinet/in.h sys/socket.h netdb.h 		 netinet/tcp.h arpa/inet.h sys/wait.h
+
+
+for ac_header in sgtty.h termio.h termios.h sys/reg.h string.h 		 proc_service.h sys/procfs.h thread_db.h linux/elf.h 		 stdlib.h unistd.h  		 errno.h fcntl.h signal.h sys/file.h malloc.h 		 sys/ioctl.h netinet/in.h sys/socket.h netdb.h 		 netinet/tcp.h arpa/inet.h sys/wait.h sys/dir.h sys/user.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
Index: gdb/gdbserver/configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/configure.ac,v
retrieving revision 1.23
diff -u -u -p -r1.23 configure.ac
--- gdb/gdbserver/configure.ac	5 Jun 2008 22:36:57 -0000	1.23
+++ gdb/gdbserver/configure.ac	23 Jul 2008 17:07:04 -0000
@@ -41,7 +41,7 @@ AC_CHECK_HEADERS(sgtty.h termio.h termio
 		 stdlib.h unistd.h dnl
  		 errno.h fcntl.h signal.h sys/file.h malloc.h dnl
 		 sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl
-		 netinet/tcp.h arpa/inet.h sys/wait.h)
+		 netinet/tcp.h arpa/inet.h sys/wait.h sys/dir.h sys/user.h)
 AC_CHECK_FUNCS(pread pwrite pread64)
 AC_REPLACE_FUNCS(memmem)
 
Index: gdb/gdbserver/linux-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-low.c,v
retrieving revision 1.78
diff -u -u -p -r1.78 linux-low.c
--- gdb/gdbserver/linux-low.c	12 Jul 2008 22:22:42 -0000	1.78
+++ gdb/gdbserver/linux-low.c	23 Jul 2008 17:07:05 -0000
@@ -23,9 +23,13 @@
 #include <sys/wait.h>
 #include <stdio.h>
 #include <sys/param.h>
+#ifdef HAVE_SYS_DIR_H
 #include <sys/dir.h>
+#endif
 #include <sys/ptrace.h>
+#ifdef HAVE_SYS_USER_H
 #include <sys/user.h>
+#endif
 #include <signal.h>
 #include <sys/ioctl.h>
 #include <fcntl.h>
@@ -1704,7 +1708,6 @@ linux_write_memory (CORE_ADDR memaddr, c
   = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1) / sizeof (PTRACE_XFER_TYPE);
   /* Allocate buffer of that many longwords.  */
   register PTRACE_XFER_TYPE *buffer = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
-  extern int errno;
 
   if (debug_threads)
     {

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][gdbserver] Check for sys/dir.h and sys.user.h in configuration.
  2008-07-23 14:33     ` Daniel Jacobowitz
  2008-07-23 17:15       ` Doug Kwan (關振德)
@ 2008-07-25 21:35       ` Doug Kwan (關振德)
  1 sibling, 0 replies; 12+ messages in thread
From: Doug Kwan (關振德) @ 2008-07-25 21:35 UTC (permalink / raw)
  To: drow, gdb-patches

Hi Daniel,

   Sorry to bug you again. You are listed as the only maintainer of
gdbserver so I would like to ask if it is okay to commit the new
patch?  I've removed the declaration of errno and regenerated
configure using the autoconf-2.59 release.  I don't have write access
to the tree but I can find someone in Google to commit this if you
approve the patch.

Thanks

-Doug


2008/7/23 Daniel Jacobowitz <drow@false.org>:
> On Wed, Jul 23, 2008 at 11:01:51AM -0300, Thiago Jung Bauermann wrote:
>> On Tue, 2008-07-22 at 20:48 -0700, Michael Snyder wrote:
>> > I'm surprised by some of the diffs in the generated configure
>> > script -- wonder if you used a different version of autoconf
>> > or something?
>>
>> When I regenerate configure in my system here I get the same spurious
>> diffs that Doug Kwan got. I'm using Debian, with autoconf package
>> version 2.59a-3.
>
> Yes.  If you want to get a clean diff, use the actual autoconf
> release - not Debian's package of it.
>
> --
> Daniel Jacobowitz
> CodeSourcery
>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][gdbserver] Check for sys/dir.h and sys.user.h in  configuration.
  2008-07-23 17:15       ` Doug Kwan (關振德)
@ 2008-07-25 21:42         ` Daniel Jacobowitz
  2008-07-25 22:54           ` Doug Kwan (關振德)
  0 siblings, 1 reply; 12+ messages in thread
From: Daniel Jacobowitz @ 2008-07-25 21:42 UTC (permalink / raw)
  To: Doug Kwan (關振德)
  Cc: Thiago Jung Bauermann, Michael Snyder, gdb-patches

On Wed, Jul 23, 2008 at 10:14:52AM -0700, Doug Kwan (關振德) wrote:
> I used the autoconf-2.59.tar.bz2 from ftp.gnu.org. I got fewer spurios
> diffs than before but there still seems to be some left.  Here is an
> updated patch.
> 
> -Doug
> 
> 2008-07-23  Doug Kwan  <dougkwan@google.com>
> 
>         * configure.ac: Check for sys/dir.h and sys.user.h.
>         * config.in configure: Regenerate.
>         * linux-low.c: Include <sys/dir.h> if HAVE_SYS_DIR_H is defined.
>         Include <sys/user.h> if HAVE_SYS_USER_H is defined.
>         (linux_write_memory): Remove declaration of errno.

Just one question: if removing sys/user.h and sys/dir.h doesn't break
anything on android, does it break anything on other GNU/Linux
targets?

Removing the errno declaration is fine.  Removing the includes is fine
if they're not actually necessary, otherwise this patch is OK.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][gdbserver] Check for sys/dir.h and sys.user.h in configuration.
  2008-07-25 21:42         ` Daniel Jacobowitz
@ 2008-07-25 22:54           ` Doug Kwan (關振德)
  2008-07-25 23:02             ` Doug Kwan (關振德)
  0 siblings, 1 reply; 12+ messages in thread
From: Doug Kwan (關振德) @ 2008-07-25 22:54 UTC (permalink / raw)
  To: Doug Kwan (關振德),
	Thiago Jung Bauermann, Michael Snyder, gdb-patches

Hi,

2008/7/25 Daniel Jacobowitz <drow@false.org>:

> Just one question: if removing sys/user.h and sys/dir.h doesn't break
> anything on android, does it break anything on other GNU/Linux
> targets?

Android is not quite Linux.  The C library is not glibc so what works
on Android may not work on a GNU/Linux system. I don't know if that
works for all GNU/Linux but I tried an ubuntu system and gdbserver
built correctly for the target i686-unknown-linux-gnu.  So the headers
may be unncessary but I cannot say this for all Linux distributions.

> Removing the errno declaration is fine.  Removing the includes is fine
> if they're not actually necessary, otherwise this patch is OK.

My patch does not remove the includes unconditionally.  Are you
suggesting I should just remove the includes?  If so, I don't need to
change configure.ac and other related files.

-Doug


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][gdbserver] Check for sys/dir.h and sys.user.h in configuration.
  2008-07-25 22:54           ` Doug Kwan (關振德)
@ 2008-07-25 23:02             ` Doug Kwan (關振德)
  0 siblings, 0 replies; 12+ messages in thread
From: Doug Kwan (關振德) @ 2008-07-25 23:02 UTC (permalink / raw)
  To: Doug Kwan (關振德),
	Thiago Jung Bauermann, Michael Snyder, gdb-patches

sys/user.h may be removed.  I grepped for "struct.*user" in gdb/gdb
server and found no reference to any structures defined in the header.
 I did the same for macros and also found no reference.  I am not sure
about sys/dir.h though.

-Doug

2008/7/25 Doug Kwan (關振德) <dougkwan@google.com>:
> Hi,
>
> 2008/7/25 Daniel Jacobowitz <drow@false.org>:
>
>> Just one question: if removing sys/user.h and sys/dir.h doesn't break
>> anything on android, does it break anything on other GNU/Linux
>> targets?
>
> Android is not quite Linux.  The C library is not glibc so what works
> on Android may not work on a GNU/Linux system. I don't know if that
> works for all GNU/Linux but I tried an ubuntu system and gdbserver
> built correctly for the target i686-unknown-linux-gnu.  So the headers
> may be unncessary but I cannot say this for all Linux distributions.
>
>> Removing the errno declaration is fine.  Removing the includes is fine
>> if they're not actually necessary, otherwise this patch is OK.
>
> My patch does not remove the includes unconditionally.  Are you
> suggesting I should just remove the includes?  If so, I don't need to
> change configure.ac and other related files.
>
> -Doug
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-07-25 23:02 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-23  1:00 [PATCH][gdbserver] Check for sys/dir.h and sys.user.h in configuration Doug Kwan (關振德)
2008-07-23  3:49 ` Michael Snyder
2008-07-23  8:29   ` Doug Kwan (關振德)
2008-07-23 14:15   ` Thiago Jung Bauermann
2008-07-23 14:33     ` Daniel Jacobowitz
2008-07-23 17:15       ` Doug Kwan (關振德)
2008-07-25 21:42         ` Daniel Jacobowitz
2008-07-25 22:54           ` Doug Kwan (關振德)
2008-07-25 23:02             ` Doug Kwan (關振德)
2008-07-25 21:35       ` Doug Kwan (關振德)
2008-07-23  7:57 ` Andreas Schwab
2008-07-23  8:33   ` Doug Kwan (關振德)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox