diff options
author | Simon Marchi <simon.marchi@ericsson.com> | 2016-01-28 10:28:56 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2016-01-28 10:28:56 -0500 |
commit | 8424cc978c8c76aca7945d50408762de65646095 (patch) | |
tree | 3525c71e308de0a6e4eab6ea409ac6fe67a5f94b /gdb/gnulib/configure | |
parent | 7fe8399de97e50f631ce28ceb42515862a927556 (diff) | |
download | gdb-8424cc978c8c76aca7945d50408762de65646095.zip gdb-8424cc978c8c76aca7945d50408762de65646095.tar.gz gdb-8424cc978c8c76aca7945d50408762de65646095.tar.bz2 |
Import strchrnul from gnulib and use it
For a forthcoming patch, I need a "skip_to_colon" function. I noticed
there are two skip_to_semicolon (one in gdb and one in gdbserver). I
thought we could put it in common/, and generalize it for any character.
It turns out that the strchrnul function does exactly that. I imported
the corresponding module from gnulib, for those systems that do not have
it.
There are probably more places where this function can be used instead
of doing the work by hand (I am looking at
remote-utils.c::look_up_one_symbol).
gdb/ChangeLog:
* remote.c (skip_to_semicolon): Remove.
(remote_parse_stop_reply): Use strchrnul instead of
skip_to_semicolon.
* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add
strchrnul.
* gnulib/aclocal.m4: Regenerate.
* gnulib/config.in: Regenerate.
* gnulib/configure: Regenerate.
* gnulib/import/Makefile.am: Regenerate.
* gnulib/import/Makefile.in: Regenerate.
* gnulib/import/m4/gnulib-cache.m4: Regenerate.
* gnulib/import/m4/gnulib-comp.m4: Regenerate.
* gnulib/import/m4/rawmemchr.m4: New file.
* gnulib/import/m4/strchrnul.m4: New file.
* gnulib/import/rawmemchr.c: New file.
* gnulib/import/rawmemchr.valgrind: New file.
* gnulib/import/strchrnul.c: New file.
* gnulib/import/strchrnul.valgrind: New file.
gdb/gdbserver/ChangeLog:
* server.c (skip_to_semicolon): Remove.
(process_point_options): Use strchrnul instead of
skip_to_semicolon.
Diffstat (limited to 'gdb/gnulib/configure')
-rw-r--r-- | gdb/gnulib/configure | 158 |
1 files changed, 158 insertions, 0 deletions
diff --git a/gdb/gnulib/configure b/gdb/gnulib/configure index 23ff364..540bad3 100644 --- a/gdb/gnulib/configure +++ b/gdb/gnulib/configure @@ -5320,6 +5320,7 @@ fi # Code from module multiarch: # Code from module nocrash: # Code from module pathmax: + # Code from module rawmemchr: # Code from module readlink: # Code from module rename: # Code from module rmdir: @@ -5336,6 +5337,7 @@ fi # Code from module stdint: # Code from module stdio: # Code from module stdlib: + # Code from module strchrnul: # Code from module streq: # Code from module string: # Code from module strnlen1: @@ -16121,6 +16123,53 @@ $as_echo "#define GNULIB_TEST_MEMMEM 1" >>confdefs.h + + for ac_func in rawmemchr +do : + ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr" +if test "x$ac_cv_func_rawmemchr" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_RAWMEMCHR 1 +_ACEOF + +fi +done + + if test $ac_cv_func_rawmemchr = no; then + HAVE_RAWMEMCHR=0 + fi + + if test $HAVE_RAWMEMCHR = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS rawmemchr.$ac_objext" + + : + fi + + + + + + GNULIB_RAWMEMCHR=1 + + + + + +$as_echo "#define GNULIB_TEST_RAWMEMCHR 1" >>confdefs.h + + + + + + if test $ac_cv_func_readlink = no; then HAVE_READLINK=0 else @@ -17428,6 +17477,115 @@ fi + for ac_func in strchrnul +do : + ac_fn_c_check_func "$LINENO" "strchrnul" "ac_cv_func_strchrnul" +if test "x$ac_cv_func_strchrnul" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRCHRNUL 1 +_ACEOF + +fi +done + + if test $ac_cv_func_strchrnul = no; then + HAVE_STRCHRNUL=0 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strchrnul works" >&5 +$as_echo_n "checking whether strchrnul works... " >&6; } +if test "${gl_cv_func_strchrnul_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if defined __CYGWIN__ + #include <cygwin/version.h> + #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 9) + Lucky user + #endif +#else + Lucky user +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Lucky user" >/dev/null 2>&1; then : + gl_cv_func_strchrnul_works="guessing yes" +else + gl_cv_func_strchrnul_works="guessing no" +fi +rm -f conftest* + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <string.h> /* for strchrnul */ + +int +main () +{ +const char *buf = "a"; + return strchrnul (buf, 'b') != buf + 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_strchrnul_works=yes +else + gl_cv_func_strchrnul_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strchrnul_works" >&5 +$as_echo "$gl_cv_func_strchrnul_works" >&6; } + case "$gl_cv_func_strchrnul_works" in + *yes) ;; + *) REPLACE_STRCHRNUL=1 ;; + esac + fi + + if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strchrnul.$ac_objext" + + : + fi + + + + + + GNULIB_STRCHRNUL=1 + + + + + +$as_echo "#define GNULIB_TEST_STRCHRNUL 1" >>confdefs.h + + + + + + + if test $REPLACE_STRSTR = 0; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works in linear time" >&5 |