aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog10
-rw-r--r--gdb/gdbserver/config.in4
-rwxr-xr-xgdb/gdbserver/configure108
-rw-r--r--gdb/gdbserver/configure.ac2
-rw-r--r--gdb/gdbserver/server.c19
-rw-r--r--gdb/gdbserver/server.h4
6 files changed, 128 insertions, 19 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 8dc4716..df51593 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,13 @@
+2008-07-31 Rolf Jansen <rj@surtec.com>
+ Pedro Alves <pedro@codesourcery.com>
+
+ * configure.ac: Check for memmem declaration.
+ * server.c [HAVE_MALLOC_H]: Include malloc.h.
+ (disable_packet_vCont, disable_packet_Tthread, disable_packet_qC)
+ (disable_packet_qfThreadInfo): Unconditionally compile.
+ * server.h [!HAVE_DECL_MEMMEM]: Declare memmem.
+ * configure, config.in: Regenerate.
+
2008-07-28 Doug Kwan <dougkwan@google.com>
* linux-low.c (sys/dir.h, sys/user.h): Remove includes.
diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in
index e636f82..ea957aa 100644
--- a/gdb/gdbserver/config.in
+++ b/gdb/gdbserver/config.in
@@ -3,6 +3,10 @@
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
+/* Define to 1 if you have the declaration of `memmem', and to 0 if you don't.
+ */
+#undef HAVE_DECL_MEMMEM
+
/* Define to 1 if you have the declaration of `perror', and to 0 if you don't.
*/
#undef HAVE_DECL_PERROR
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index 00df01d..7cd62da 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -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_val'" >&2;}
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 conftest.*; do
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
@@ -3590,6 +3608,76 @@ _ACEOF
fi
+echo "$as_me:$LINENO: checking whether memmem is declared" >&5
+echo $ECHO_N "checking whether memmem is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_memmem+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+#ifndef memmem
+ char *p = (char *) memmem;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ 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'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_have_decl_memmem=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_memmem=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_memmem" >&5
+echo "${ECHO_T}$ac_cv_have_decl_memmem" >&6
+if test $ac_cv_have_decl_memmem = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_MEMMEM 1
+_ACEOF
+
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_MEMMEM 0
+_ACEOF
+
+
+fi
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 7cfbaf6..e6b4bc5 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -61,7 +61,7 @@ AC_TRY_LINK([
[AC_MSG_RESULT(no)])
fi
-AC_CHECK_DECLS([strerror, perror])
+AC_CHECK_DECLS([strerror, perror, memmem])
AC_CHECK_TYPES(socklen_t, [], [],
[#include <sys/types.h>
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index da9d83c..1fa1694 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -28,6 +28,9 @@
#if HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
+#if HAVE_MALLOC_H
+#include <malloc.h>
+#endif
unsigned long cont_thread;
unsigned long general_thread;
@@ -67,14 +70,6 @@ int terminal_fd;
/* TERMINAL_FD's original foreground group. */
pid_t old_foreground_pgrp;
-/* Set if you want to disable optional thread related packets support
- in gdbserver, for the sake of testing GDB against stubs that don't
- support them. */
-int disable_packet_vCont;
-int disable_packet_Tthread;
-int disable_packet_qC;
-int disable_packet_qfThreadInfo;
-
/* Hand back terminal ownership to the original foreground group. */
static void
@@ -84,6 +79,14 @@ restore_old_foreground_pgrp (void)
}
#endif
+/* Set if you want to disable optional thread related packets support
+ in gdbserver, for the sake of testing GDB against stubs that don't
+ support them. */
+int disable_packet_vCont;
+int disable_packet_Tthread;
+int disable_packet_qC;
+int disable_packet_qfThreadInfo;
+
static int
target_running (void)
{
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index aedd14a..b519696 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -50,6 +50,10 @@ extern void perror (const char *);
#endif
#endif
+#if !HAVE_DECL_MEMMEM
+extern void *memmem (const void *, size_t , const void *, size_t);
+#endif
+
#ifndef ATTR_NORETURN
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7))
#define ATTR_NORETURN __attribute__ ((noreturn))