This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Cygwin test suite fixes
- To: Nick Duffek <nsd at redhat dot com>
- Subject: Re: [RFA] Cygwin test suite fixes
- From: Fernando Nasser <fnasser at cygnus dot com>
- Date: Fri, 17 Nov 2000 16:09:34 +0000
- CC: gdb-patches at sources dot redhat dot com
- Organization: Red Hat Canada Ltd. - Toronto
- References: <200011170627.eAH6RqS14197@rtl.cygnus.com>
Nick Duffek wrote:
>
> The attached patch fixes a bunch of Cygwin host failures, most of them
> resulting from the .exe extension.
>
> No regressions on i686-pc-linux-gnu or sparc-sun-solaris2.5.1. Okay to
> apply?
>
Of course, go ahead.
And thanks again.
Fernando
> ChangeLog:
>
> * configure.in: Add AC_EXEEXT.
> * configure: Regenerate.
> * Makefile.in (just-check): Export EXEEXT.
> * lib/gdb.exp ($EXEEXT): Import from environment.
> * gdb.base/maint.exp: Expect $EXEEXT in executable name. Don't
> expect "maint dump-me" on Cygwin.
> * gdb.base/reread.exp ($binfile, $binfile1, $binfile2): Append
> $EXEEXT.
>
> Nick
>
> Index: gdb/testsuite/Makefile.in
> ===================================================================
> diff -up gdb/testsuite/Makefile.in gdb/testsuite/Makefile.in
> --- gdb/testsuite/Makefile.in Thu Nov 16 19:28:11 2000
> +++ gdb/testsuite/Makefile.in Thu Nov 16 19:28:04 2000
> @@ -31,6 +31,7 @@ target_canonical = @target@
> target_cpu = @gdb_target_cpu@
>
> SHELL = @SHELL@
> +EXEEXT = @EXEEXT@
> SUBDIRS = @subdirs@
> RPATH_ENVVAR = @RPATH_ENVVAR@
>
> @@ -125,6 +126,7 @@ just-check:
> rootme=`pwd`; export rootme; \
> srcdir=${srcdir} ; export srcdir ; \
> EXPECT=${EXPECT} ; export EXPECT ; \
> + EXEEXT=${EXEEXT} ; export EXEEXT ; \
> $(RPATH_ENVVAR)=$$rootme/../../expect:$$rootme/../../libstdc++:$$rootme/../../tk/unix:$$rootme/../../tcl/unix:$$rootme/../../bfd:$$rootme/../../opcodes:$$$(RPATH_ENVVAR); \
> export $(RPATH_ENVVAR); \
> if [ -f $${rootme}/../../expect/expect ] ; then \
> Index: gdb/testsuite/gdb.base/maint.exp
> ===================================================================
> diff -up gdb/testsuite/gdb.base/maint.exp gdb/testsuite/gdb.base/maint.exp
> --- gdb/testsuite/gdb.base/maint.exp Thu Nov 16 19:28:19 2000
> +++ gdb/testsuite/gdb.base/maint.exp Thu Nov 16 19:28:04 2000
> @@ -198,7 +198,7 @@ set keep_looking 1
> while {$keep_looking} {
> gdb_expect {
>
> - -re ".*Object file.*break: Objfile at $hex, bfd at $hex, \[0-9\]* minsyms\[\r\t \]+\n" { set header 1 }
> + -re ".*Object file.*break$EXEEXT: Objfile at $hex, bfd at $hex, \[0-9\]* minsyms\[\r\t \]+\n" { set header 1 }
> -re ".*Psymtabs:\[\r\t \]+\n" { set psymtabs 1 }
> -re ".*Symtabs:\[\r\t \]+\n" { set symtabs 1 }
>
> @@ -377,7 +377,7 @@ set timeout [expr $timeout + 300]
> #
> send_gdb "maint info sections\n"
> gdb_expect {
> - -re "Exec file:\r\n.*break., file type.*$gdb_prompt $"\
> + -re "Exec file:\r\n.*break$EXEEXT., file type.*$gdb_prompt $"\
> { pass "maint info sections" }
> -re ".*$gdb_prompt $" { fail "maint info sections" }
> timeout { fail "(timeout) maint info sections" }
> @@ -443,7 +443,7 @@ set timeout $oldtimeout
>
> send_gdb "help maint\n"
> gdb_expect {
> - -re "Commands for use by GDB maintainers\\..*Includes commands to dump specific internal GDB structures in.*a human readable form, to cause GDB to deliberately dump core,.*to test internal functions such as the C.. demangler, etc\\..*List of maintenance subcommands:.*maintenance check-symtabs.*maintenance demangle.*maintenance dump-me.*maintenance info.*maintenance internal-error.*maintenance print.*maintenance space.*maintenance time.*Type.*help maintenance.*followed by maintenance subcommand name for full documentation\\..*Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
> + -re "Commands for use by GDB maintainers\\..*Includes commands to dump specific internal GDB structures in.*a human readable form, to cause GDB to deliberately dump core,.*to test internal functions such as the C.. demangler, etc\\..*List of maintenance subcommands:.*maintenance check-symtabs.*maintenance demangle.*(maintenance dump-me.*)?maintenance info.*maintenance internal-error.*maintenance print.*maintenance space.*maintenance time.*Type.*help maintenance.*followed by maintenance subcommand name for full documentation\\..*Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
> { pass "help maint" }
> -re ".*$gdb_prompt $" { fail "help maint" }
> timeout { fail "(timeout) help maint" }
> @@ -482,6 +482,10 @@ gdb_expect {
> timeout { fail "(timeout) help maint demangle" }
> }
>
> +# dump-me is disabled ifdef _WIN32.
> +if [ishost *cygwin*] {
> + setup_xfail "*-*-*"
> +}
> send_gdb "help maint dump-me\n"
> gdb_expect {
> -re "Get fatal error; make debugger dump its core\\.\r\nGDB sets it's handling of SIGQUIT back to SIG_DFL and then sends\r\nitself a SIGQUIT signal\\..*$gdb_prompt $"\
> @@ -608,6 +612,9 @@ gdb_expect {
> #set oldtimeout $timeout
> #set timeout [expr $timeout + 300]
>
> +if [ishost *cygwin*] {
> + setup_xfail "*-*-*"
> +}
> send_gdb "maint dump-me\n"
> gdb_expect {
> -re "Should GDB dump core.*\\(y or n\\) $"\
> Index: gdb/testsuite/gdb.base/reread.exp
> ===================================================================
> diff -up gdb/testsuite/gdb.base/reread.exp gdb/testsuite/gdb.base/reread.exp
> --- gdb/testsuite/gdb.base/reread.exp Thu Nov 16 19:28:23 2000
> +++ gdb/testsuite/gdb.base/reread.exp Thu Nov 16 19:28:04 2000
> @@ -30,7 +30,8 @@ set prototypes 1
>
> set testfile1 "reread1"
> set srcfile1 ${testfile1}.c
> -set binfile1 ${objdir}/${subdir}/${testfile1}
> +# Cygwin needs $EXEEXT.
> +set binfile1 ${objdir}/${subdir}/${testfile1}$EXEEXT
>
> if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile1}" executable {debug additional_flags=-w}] != "" } {
> gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
> @@ -40,7 +41,7 @@ if { [gdb_compile "${srcdir}/${subdir}/
>
> set testfile2 "reread2"
> set srcfile2 ${testfile2}.c
> -set binfile2 ${objdir}/${subdir}/${testfile2}
> +set binfile2 ${objdir}/${subdir}/${testfile2}$EXEEXT
>
> if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {debug additional_flags=-w}] != "" } {
> gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
> @@ -49,7 +50,7 @@ if { [gdb_compile "${srcdir}/${subdir}/
> # Start with a fresh gdb.
>
> set testfile "reread"
> -set binfile ${objdir}/${subdir}/${testfile}
> +set binfile ${objdir}/${subdir}/${testfile}$EXEEXT
>
> gdb_start
> gdb_reinitialize_dir $srcdir/$subdir
> Index: gdb/testsuite/lib/gdb.exp
> ===================================================================
> diff -up gdb/testsuite/lib/gdb.exp gdb/testsuite/lib/gdb.exp
> --- gdb/testsuite/lib/gdb.exp Thu Nov 16 19:28:31 2000
> +++ gdb/testsuite/lib/gdb.exp Thu Nov 16 19:28:05 2000
> @@ -63,6 +63,16 @@ if ![info exists gdb_prompt] then {
> set gdb_prompt "\[(\]gdb\[)\]"
> }
>
> +# Needed for some tests under Cygwin.
> +global EXEEXT
> +global env
> +
> +if ![info exists env(EXEEXT)] {
> + set EXEEXT ""
> +} else {
> + set EXEEXT $env(EXEEXT)
> +}
> +
> ### Only procedures should come after this point.
>
> #
> Index: gdb/testsuite/configure.in
> ===================================================================
> diff -up gdb/testsuite/configure.in gdb/testsuite/configure.in
> --- gdb/testsuite/configure.in Thu Nov 16 19:28:36 2000
> +++ gdb/testsuite/configure.in Thu Nov 16 19:28:05 2000
> @@ -106,6 +106,9 @@ if test "${enable_gdbtk}" = "yes"; then
> fi
> # End stuff to support --enable-shared
>
> +dnl Check for exe extension set on certain hosts (e.g. Win32)
> +AC_EXEEXT
> +
> # configure the subdirectories too
> AC_CONFIG_SUBDIRS($configdirs)
>
> Index: gdb/testsuite/configure
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/configure,v
> retrieving revision 1.3
> diff -u -r1.3 configure
> --- gdb/testsuite/configure 2000/07/24 04:34:52 1.3
> +++ gdb/testsuite/configure 2000/11/17 06:21:36
> @@ -748,6 +748,102 @@
> fi
> # End stuff to support --enable-shared
>
> +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
> +echo "configure:753: checking for Cygwin environment" >&5
> +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
> + echo $ac_n "(cached) $ac_c" 1>&6
> +else
> + cat > conftest.$ac_ext <<EOF
> +#line 758 "configure"
> +#include "confdefs.h"
> +
> +int main() {
> +
> +#ifndef __CYGWIN__
> +#define __CYGWIN__ __CYGWIN32__
> +#endif
> +return __CYGWIN__;
> +; return 0; }
> +EOF
> +if { (eval echo configure:769: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
> + rm -rf conftest*
> + ac_cv_cygwin=yes
> +else
> + echo "configure: failed program was:" >&5
> + cat conftest.$ac_ext >&5
> + rm -rf conftest*
> + ac_cv_cygwin=no
> +fi
> +rm -f conftest*
> +rm -f conftest*
> +fi
> +
> +echo "$ac_t""$ac_cv_cygwin" 1>&6
> +CYGWIN=
> +test "$ac_cv_cygwin" = yes && CYGWIN=yes
> +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
> +echo "configure:786: checking for mingw32 environment" >&5
> +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
> + echo $ac_n "(cached) $ac_c" 1>&6
> +else
> + cat > conftest.$ac_ext <<EOF
> +#line 791 "configure"
> +#include "confdefs.h"
> +
> +int main() {
> +return __MINGW32__;
> +; return 0; }
> +EOF
> +if { (eval echo configure:798: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
> + rm -rf conftest*
> + ac_cv_mingw32=yes
> +else
> + echo "configure: failed program was:" >&5
> + cat conftest.$ac_ext >&5
> + rm -rf conftest*
> + ac_cv_mingw32=no
> +fi
> +rm -f conftest*
> +rm -f conftest*
> +fi
> +
> +echo "$ac_t""$ac_cv_mingw32" 1>&6
> +MINGW32=
> +test "$ac_cv_mingw32" = yes && MINGW32=yes
> +
> +
> +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
> +echo "configure:817: checking for executable suffix" >&5
> +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
> + echo $ac_n "(cached) $ac_c" 1>&6
> +else
> + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
> + ac_cv_exeext=.exe
> +else
> + rm -f conftest*
> + echo 'int main () { return 0; }' > conftest.$ac_ext
> + ac_cv_exeext=
> + if { (eval echo configure:827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
> + for file in conftest.*; do
> + case $file in
> + *.c | *.o | *.obj | *.ilk | *.pdb) ;;
> + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
> + esac
> + done
> + else
> + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
> + fi
> + rm -f conftest*
> + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
> +fi
> +fi
> +
> +EXEEXT=""
> +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
> +echo "$ac_t""${ac_cv_exeext}" 1>&6
> +ac_exeext=$EXEEXT
> +
> +
> # configure the subdirectories too
> subdirs="$configdirs"
>
> @@ -913,6 +1009,7 @@
> s%@build_vendor@%$build_vendor%g
> s%@build_os@%$build_os%g
> s%@RPATH_ENVVAR@%$RPATH_ENVVAR%g
> +s%@EXEEXT@%$EXEEXT%g
> s%@subdirs@%$subdirs%g
>
> CEOF
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9