From: Jason Molenda Date: Tue, 6 Oct 1998 22:24:40 +0000 (+0000) Subject: 1998-10-06 Jason Molenda (jsm@bugshack.cygnus.com) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=87feff9dabae11e6df45924c733a6ea9368713d1;p=binutils-gdb.git 1998-10-06 Jason Molenda (jsm@bugshack.cygnus.com) Eliminate a few warnings from the compiler. * breakpoint.h: Add prototype. * breakpoint.c (do_enable_breakpoint): cast mem_cnt, i to (void). * configure.in: Check if strdup declaration is necessary. * configure: Regenerated. * defs.h: Add prototypes. * gdb_string.h: Only define strdup if necessary. * gdbthread.h: Add prototypes. * printcmd.c: Add prototyptes. (disassemble_command): Remove unused variable 'section'. * symtab.c: Add prototypes. * symtab.h: Include gnu-regex.h, add prototype. * thread.c: Add prototype. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 224193c6cde..9e9789737cd 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,19 @@ +1998-10-06 Jason Molenda (jsm@bugshack.cygnus.com) + + Eliminate a few warnings from the compiler. + * breakpoint.h: Add prototype. + * breakpoint.c (do_enable_breakpoint): cast mem_cnt, i to (void). + * configure.in: Check if strdup declaration is necessary. + * configure: Regenerated. + * defs.h: Add prototypes. + * gdb_string.h: Only define strdup if necessary. + * gdbthread.h: Add prototypes. + * printcmd.c: Add prototyptes. + (disassemble_command): Remove unused variable 'section'. + * symtab.c: Add prototypes. + * symtab.h: Include gnu-regex.h, add prototype. + * thread.c: Add prototype. + Mon Oct 5 19:44:39 1998 Stan Shebs From David Purves : diff --git a/gdb/configure b/gdb/configure index 424ef425272..b0ee7855033 100755 --- a/gdb/configure +++ b/gdb/configure @@ -37,12 +37,10 @@ ac_help="$ac_help --with-tkinclude=DIR Directory where tk private headers are" ac_help="$ac_help --with-x use the X Window System" -# start-sanitize-sky ac_help="$ac_help --with-sim-gpu2=DIR Use GPU2 library under given DIR" ac_help="$ac_help --with-sim-funit=DIR Use target FP lib under given DIR" -# end-sanitize-sky ac_help="$ac_help --enable-shared Use shared libraries" @@ -3599,6 +3597,247 @@ EOF fi +echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 +echo "configure:3602: checking whether malloc must be declared" >&5 +if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +int main() { +char *(*pfn) = (char *(*)) malloc +; return 0; } +EOF +if { (eval echo configure:3628: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_decl_needed_malloc=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + bfd_cv_decl_needed_malloc=yes +fi +rm -f conftest* +fi + +echo "$ac_t""$bfd_cv_decl_needed_malloc" 1>&6 +if test $bfd_cv_decl_needed_malloc = yes; then + bfd_tr_decl=NEED_DECLARATION_`echo malloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +echo "configure:3650: checking whether realloc must be declared" >&5 +if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +int main() { +char *(*pfn) = (char *(*)) realloc +; return 0; } +EOF +if { (eval echo configure:3676: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_decl_needed_realloc=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + bfd_cv_decl_needed_realloc=yes +fi +rm -f conftest* +fi + +echo "$ac_t""$bfd_cv_decl_needed_realloc" 1>&6 +if test $bfd_cv_decl_needed_realloc = yes; then + bfd_tr_decl=NEED_DECLARATION_`echo realloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +echo "configure:3698: checking whether free must be declared" >&5 +if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +int main() { +char *(*pfn) = (char *(*)) free +; return 0; } +EOF +if { (eval echo configure:3724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_decl_needed_free=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + bfd_cv_decl_needed_free=yes +fi +rm -f conftest* +fi + +echo "$ac_t""$bfd_cv_decl_needed_free" 1>&6 +if test $bfd_cv_decl_needed_free = yes; then + bfd_tr_decl=NEED_DECLARATION_`echo free | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +echo "configure:3746: checking whether strerror must be declared" >&5 +if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +int main() { +char *(*pfn) = (char *(*)) strerror +; return 0; } +EOF +if { (eval echo configure:3772: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_decl_needed_strerror=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + bfd_cv_decl_needed_strerror=yes +fi +rm -f conftest* +fi + +echo "$ac_t""$bfd_cv_decl_needed_strerror" 1>&6 +if test $bfd_cv_decl_needed_strerror = yes; then + bfd_tr_decl=NEED_DECLARATION_`echo strerror | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +echo "configure:3794: checking whether strdup must be declared" >&5 +if eval "test \"`echo '$''{'bfd_cv_decl_needed_strdup'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +int main() { +char *(*pfn) = (char *(*)) strdup +; return 0; } +EOF +if { (eval echo configure:3820: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_decl_needed_strdup=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + bfd_cv_decl_needed_strdup=yes +fi +rm -f conftest* +fi + +echo "$ac_t""$bfd_cv_decl_needed_strdup" 1>&6 +if test $bfd_cv_decl_needed_strdup = yes; then + bfd_tr_decl=NEED_DECLARATION_`echo strdup | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 -echo "configure:3618: checking for gregset_t type" >&5 +echo "configure:3859: checking for gregset_t type" >&5 if eval "test \"`echo '$''{'gdb_cv_have_gregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { gregset_t *gregsetp = 0 ; return 0; } EOF -if { (eval echo configure:3630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gdb_cv_have_gregset_t=yes else @@ -3649,19 +3888,19 @@ EOF fi echo $ac_n "checking for fpregset_t type""... $ac_c" 1>&6 -echo "configure:3651: checking for fpregset_t type" >&5 +echo "configure:3892: checking for fpregset_t type" >&5 if eval "test \"`echo '$''{'gdb_cv_have_fpregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { fpregset_t *fpregsetp = 0 ; return 0; } EOF -if { (eval echo configure:3663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gdb_cv_have_fpregset_t=yes else @@ -3682,7 +3921,7 @@ EOF fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:3684: checking for main in -lm" >&5 +echo "configure:3925: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3690,14 +3929,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3727,12 +3966,12 @@ fi echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6 -echo "configure:3729: checking for long long support in compiler" >&5 +echo "configure:3970: checking for long long support in compiler" >&5 if eval "test \"`echo '$''{'gdb_cv_c_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3985: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_c_long_long=yes else @@ -3764,7 +4003,7 @@ fi echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6 -echo "configure:3766: checking for long long support in printf" >&5 +echo "configure:4007: checking for long long support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3772,7 +4011,7 @@ else gdb_cv_printf_has_long_long=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_long=yes else @@ -3810,19 +4049,19 @@ echo "$ac_t""$gdb_cv_printf_has_long_long" 1>&6 echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6 -echo "configure:3812: checking for long double support in compiler" >&5 +echo "configure:4053: checking for long double support in compiler" >&5 if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4065: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_long_double=yes else @@ -3844,7 +4083,7 @@ fi echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6 -echo "configure:3846: checking for long double support in printf" >&5 +echo "configure:4087: checking for long double support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3852,7 +4091,7 @@ else gdb_cv_printf_has_long_double=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_double=yes else @@ -3886,7 +4125,7 @@ echo "$ac_t""$gdb_cv_printf_has_long_double" 1>&6 echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6 -echo "configure:3888: checking for long double support in scanf" >&5 +echo "configure:4129: checking for long double support in scanf" >&5 if eval "test \"`echo '$''{'gdb_cv_scanf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3894,7 +4133,7 @@ else gdb_cv_scanf_has_long_double=no else cat > conftest.$ac_ext < 3.14159 && f < 3.14160); } EOF -if { (eval echo configure:3906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_scanf_has_long_double=yes else @@ -3930,17 +4169,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3932: checking for $ac_hdr" >&5 +echo "configure:4173: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3942: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4183: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3969,12 +4208,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3971: checking for $ac_func" >&5 +echo "configure:4212: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4022,7 +4261,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:4024: checking for working mmap" >&5 +echo "configure:4265: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4030,7 +4269,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -4193,207 +4432,13 @@ EOF fi -echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:4196: checking whether malloc must be declared" >&5 -if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#ifdef HAVE_STRING_H -#include -#else -#ifdef HAVE_STRINGS_H -#include -#endif -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -int main() { -char *(*pfn) = (char *(*)) malloc -; return 0; } -EOF -if { (eval echo configure:4222: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - bfd_cv_decl_needed_malloc=no -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - bfd_cv_decl_needed_malloc=yes -fi -rm -f conftest* -fi - -echo "$ac_t""$bfd_cv_decl_needed_malloc" 1>&6 -if test $bfd_cv_decl_needed_malloc = yes; then - bfd_tr_decl=NEED_DECLARATION_`echo malloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -echo "configure:4244: checking whether realloc must be declared" >&5 -if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#ifdef HAVE_STRING_H -#include -#else -#ifdef HAVE_STRINGS_H -#include -#endif -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -int main() { -char *(*pfn) = (char *(*)) realloc -; return 0; } -EOF -if { (eval echo configure:4270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - bfd_cv_decl_needed_realloc=no -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - bfd_cv_decl_needed_realloc=yes -fi -rm -f conftest* -fi - -echo "$ac_t""$bfd_cv_decl_needed_realloc" 1>&6 -if test $bfd_cv_decl_needed_realloc = yes; then - bfd_tr_decl=NEED_DECLARATION_`echo realloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -echo "configure:4292: checking whether free must be declared" >&5 -if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#ifdef HAVE_STRING_H -#include -#else -#ifdef HAVE_STRINGS_H -#include -#endif -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -int main() { -char *(*pfn) = (char *(*)) free -; return 0; } -EOF -if { (eval echo configure:4318: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - bfd_cv_decl_needed_free=no -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - bfd_cv_decl_needed_free=yes -fi -rm -f conftest* -fi - -echo "$ac_t""$bfd_cv_decl_needed_free" 1>&6 -if test $bfd_cv_decl_needed_free = yes; then - bfd_tr_decl=NEED_DECLARATION_`echo free | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -echo "configure:4341: checking whether strerror must be declared" >&5 -if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#ifdef HAVE_STRING_H -#include -#else -#ifdef HAVE_STRINGS_H -#include -#endif -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -int main() { -char *(*pfn) = (char *(*)) strerror -; return 0; } -EOF -if { (eval echo configure:4367: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - bfd_cv_decl_needed_strerror=no -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - bfd_cv_decl_needed_strerror=yes -fi -rm -f conftest* -fi - -echo "$ac_t""$bfd_cv_decl_needed_strerror" 1>&6 -if test $bfd_cv_decl_needed_strerror = yes; then - bfd_tr_decl=NEED_DECLARATION_`echo strerror | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -echo "configure:4395: checking for HPUX/OSF thread support" >&5 +echo "configure:4442: checking for HPUX/OSF thread support" >&5 if test -f /usr/include/dce/cma_config.h ; then if test "$GCC" = "yes" ; then echo "$ac_t""yes" 1>&6 @@ -4412,7 +4457,7 @@ EOF ;; solaris*) echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6 -echo "configure:4414: checking for Solaris thread debugging library" >&5 +echo "configure:4461: checking for Solaris thread debugging library" >&5 if test -f /usr/lib/libthread_db.so.1 ; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -4422,7 +4467,7 @@ EOF CONFIG_OBS="${CONFIG_OBS} sol-thread.o" CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c" echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:4424: checking for dlopen in -ldl" >&5 +echo "configure:4471: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4430,7 +4475,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4473,17 +4518,17 @@ fi # all symbols visible in the dynamic symbol table. hold_ldflags=$LDFLAGS echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6 -echo "configure:4475: checking for the ld -export-dynamic flag" >&5 +echo "configure:4522: checking for the ld -export-dynamic flag" >&5 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* found=yes else @@ -4676,12 +4721,12 @@ fi # In the cygwin32 environment, we need some additional flags. echo $ac_n "checking for cygwin32""... $ac_c" 1>&6 -echo "configure:4678: checking for cygwin32" >&5 +echo "configure:4725: checking for cygwin32" >&5 if eval "test \"`echo '$''{'gdb_cv_os_cygwin32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:4740: checking for Tcl configuration" >&5 +echo "configure:4787: checking for Tcl configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4846,7 +4891,7 @@ if test "${with_tkconfig+set}" = set; then fi echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6 -echo "configure:4848: checking for Tk configuration" >&5 +echo "configure:4895: checking for Tk configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tkconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4942,7 +4987,7 @@ fi no_tcl=true echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6 -echo "configure:4944: checking for Tcl private headers. dir=${configdir}" >&5 +echo "configure:4991: checking for Tcl private headers. dir=${configdir}" >&5 # Check whether --with-tclinclude or --without-tclinclude was given. if test "${with_tclinclude+set}" = set; then withval="$with_tclinclude" @@ -5008,17 +5053,17 @@ fi if test x"${ac_cv_c_tclh}" = x ; then ac_safe=`echo "tclInt.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6 -echo "configure:5010: checking for tclInt.h" >&5 +echo "configure:5057: checking for tclInt.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5020: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5067: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5078,7 +5123,7 @@ fi # no_tk=true echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6 -echo "configure:5080: checking for Tk private headers" >&5 +echo "configure:5127: checking for Tk private headers" >&5 # Check whether --with-tkinclude or --without-tkinclude was given. if test "${with_tkinclude+set}" = set; then withval="$with_tkinclude" @@ -5144,17 +5189,17 @@ fi if test x"${ac_cv_c_tkh}" = x ; then ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tk.h""... $ac_c" 1>&6 -echo "configure:5146: checking for tk.h" >&5 +echo "configure:5193: checking for tk.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5156: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5203: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5200,7 +5245,7 @@ fi echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:5202: checking for Itcl private headers. srcdir=${srcdir}" >&5 +echo "configure:5249: checking for Itcl private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_itclh}" = x ; then for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ; do if test -f $i/src/itcl.h ; then @@ -5223,7 +5268,7 @@ fi echo $ac_n "checking for Tix private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:5225: checking for Tix private headers. srcdir=${srcdir}" >&5 +echo "configure:5272: checking for Tix private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_tixh}" = x ; then for i in ${srcdir}/../tix ${srcdir}/../../tix ${srcdir}/../../../tix ; do if test -f $i/generic/tix.h ; then @@ -5317,7 +5362,7 @@ fi # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:5319: checking for X" >&5 +echo "configure:5366: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -5379,12 +5424,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5386: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5433: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5453,14 +5498,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -5581,7 +5626,7 @@ fi # end-sanitize-sky echo $ac_n "checking for wctype in -lw""... $ac_c" 1>&6 -echo "configure:5583: checking for wctype in -lw" >&5 +echo "configure:5630: checking for wctype in -lw" >&5 ac_lib_var=`echo w'_'wctype | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5589,7 +5634,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lw $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5764,7 +5809,7 @@ links="${links} nm.h" fi # start-sanitize-gdbtk echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:5766: checking whether ln -s works" >&5 +echo "configure:5813: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5799,19 +5844,19 @@ fi echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6 -echo "configure:5801: checking for Cygwin32 environment" >&5 +echo "configure:5848: checking for Cygwin32 environment" >&5 if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_cygwin32=yes else @@ -5828,19 +5873,19 @@ echo "$ac_t""$am_cv_cygwin32" 1>&6 CYGWIN32= test "$am_cv_cygwin32" = yes && CYGWIN32=yes echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6 -echo "configure:5830: checking for Mingw32 environment" >&5 +echo "configure:5877: checking for Mingw32 environment" >&5 if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5889: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_mingw32=yes else @@ -5859,7 +5904,7 @@ test "$am_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:5861: checking for executable suffix" >&5 +echo "configure:5908: checking for executable suffix" >&5 if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else diff --git a/gdb/configure.in b/gdb/configure.in index a177c4b5970..70bcb42b2ff 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -1,5 +1,5 @@ dnl Autoconf configure script for GDB, the GNU debugger. -dnl Copyright 1995, 1996 Free Software Foundation, Inc. +dnl Copyright 1995, 1996, 1997, 1998 Free Software Foundation, Inc. dnl dnl This file is part of GDB. dnl @@ -82,6 +82,12 @@ AC_CHECK_FUNCS(setpgid sbrk select poll sigaction isascii bzero bcopy \ memcpy btowc) AC_FUNC_ALLOCA +BFD_NEED_DECLARATION(malloc) +BFD_NEED_DECLARATION(realloc) +BFD_NEED_DECLARATION(free) +BFD_NEED_DECLARATION(strerror) +BFD_NEED_DECLARATION(strdup) + # If we are configured native on GNU/Linux, work around problems with sys/procfs.h if test "${target}" = "${host}"; then case "${host}" in @@ -203,12 +209,6 @@ AC_MSG_RESULT($gdb_cv_scanf_has_long_double) AC_FUNC_MMAP -BFD_NEED_DECLARATION(malloc) -BFD_NEED_DECLARATION(realloc) -BFD_NEED_DECLARATION(free) - -BFD_NEED_DECLARATION(strerror) - dnl See if thread_db library is around for Solaris thread debugging. Note that dnl we must explicitly test for version 1 of the library because version 0 dnl (present on Solaris 2.4 or earlier) doesn't have the same API. diff --git a/gdb/gdb_string.h b/gdb/gdb_string.h index 4001fab7942..944eec14ad9 100644 --- a/gdb/gdb_string.h +++ b/gdb/gdb_string.h @@ -1,5 +1,5 @@ /* Portable - Copyright 1995 Free Software Foundation, Inc. + Copyright 1995, 1998 Free Software Foundation, Inc. This file is part of GDB. @@ -61,7 +61,7 @@ extern char *strerror PARAMS ((int)); /* X3.159-1989 4.11.6.2 */ #endif #endif -#ifndef strdup +#ifdef NEED_DECLARATION_STRDUP extern char *strdup (); /* full prototype collides w/ some OSes (AIX 3.2.5) */ #endif diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index f71276f2348..c298b1d288d 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -1,5 +1,5 @@ /* Multi-process/thread control defs for GDB, the GNU debugger. - Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1993 + Copyright 1987, 88, 89, 90, 91, 92, 1993, 1998 Contributed by Lynx Real-Time Systems, Inc. Los Gatos, CA. Free Software Foundation, Inc. @@ -27,6 +27,10 @@ extern void init_thread_list PARAMS ((void)); extern void add_thread PARAMS ((int pid)); +extern void delete_thread PARAMS ((int)); + +extern int thread_id_to_pid PARAMS ((int)); + extern int in_thread_list PARAMS ((int pid)); extern int pid_to_thread_id PARAMS ((int pid)); @@ -46,4 +50,6 @@ extern void save_infrun_state PARAMS ((int, CORE_ADDR, CORE_ADDR, char *, /* Commands with a prefix of `thread'. */ extern struct cmd_list_element *thread_cmd_list; +extern void _initialize_thread PARAMS ((void)); + #endif /* GDBTHREAD_H */ diff --git a/gdb/thread.c b/gdb/thread.c index 8c61a564cd8..dba66219a6d 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -1,5 +1,5 @@ /* Multi-process/thread control for GDB, the GNU debugger. - Copyright 1986, 1987, 1988, 1993 + Copyright 1986, 1987, 1988, 1993, 1998 Contributed by Lynx Real-Time Systems, Inc. Los Gatos, CA. Free Software Foundation, Inc. @@ -82,6 +82,9 @@ thread_apply_all_command PARAMS ((char *, int)); static void thread_apply_command PARAMS ((char *, int)); +static int +thread_alive PARAMS ((struct thread_info *)); + void init_thread_list () {