From a9424716eaef1fc9e97439758a0812a83d5ea43f Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Wed, 20 Mar 1996 02:58:28 +0000 Subject: [PATCH] From Peter Schauer * gdb.base/funcargs.c: Patch for SPARCworks alloca compatibility * gdb.c++/templates.exp: Only match on basename of file since some formats like xcoff don't encode directory information. * gdb.stabs/weird.exp: Use the right sed script for powerpc and rs6000 AIX xcoff targets. * configure.in: Add stabsdirs to configdirs for powerpc-*-aix*. * configure: Regenerate. * gdb.base/Makefile.in (clean): Remove generated file twice-tmp.c here, rather than in distclean. --- gdb/testsuite/ChangeLog | 13 +++++ gdb/testsuite/configure.in | 1 + gdb/testsuite/gdb.stabs/weird.exp | 115 ++++++++++++++++++++++++-------------- 3 files changed, 86 insertions(+), 43 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 6dd4e0f..86c6619 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,16 @@ +Tue Mar 19 16:52:49 1996 Fred Fish + + From Peter Schauer + * gdb.base/funcargs.c: Patch for SPARCworks alloca compatibility + * gdb.c++/templates.exp: Only match on basename of file since + some formats like xcoff don't encode directory information. + * gdb.stabs/weird.exp: Use the right sed script for powerpc + and rs6000 AIX xcoff targets. + * configure.in: Add stabsdirs to configdirs for powerpc-*-aix*. + * configure: Regenerate. + * gdb.base/Makefile.in (clean): Remove generated file twice-tmp.c + here, rather than in distclean. + Sun Mar 17 13:35:31 1996 Fred Fish * gdb.base/mips_pro.exp: Create mips_pro.ci to get gcc_compiled diff --git a/gdb/testsuite/configure.in b/gdb/testsuite/configure.in index 2b88e9a..e13fce0 100644 --- a/gdb/testsuite/configure.in +++ b/gdb/testsuite/configure.in @@ -21,6 +21,7 @@ stabsdirs="gdb.stabs" # this section is for targets that use stabs # add stabs tests for appropriate targets case "${target}" in + powerpc-*-aix*) configdirs="${configdirs} ${stabsdirs}" ;; rs6000-*-aix*) configdirs="${configdirs} ${stabsdirs}" ;; *-*-bsd*) configdirs="${configdirs} ${stabsdirs}" ;; *-*-go32*) configdirs="${configdirs} ${stabsdirs}" ;; diff --git a/gdb/testsuite/gdb.stabs/weird.exp b/gdb/testsuite/gdb.stabs/weird.exp index d5ecc3f..c0efab9 100644 --- a/gdb/testsuite/gdb.stabs/weird.exp +++ b/gdb/testsuite/gdb.stabs/weird.exp @@ -122,15 +122,9 @@ proc do_tests {} { gdb_test "p const69" " = 69" "'e' constant on non-enum type" gdb_test "whatis const69" "type = (unsigned int|inttype)" "whatis const69" - # Haven't investigated - setup_xfail "*-*-*" gdb_test "p sizeof (const70)" " = 2" "'e' constant with embedded type" - # field3 is printing out a bogus value; haven't investigated - setup_xfail "*-*-*" gdb_test "p bad_neg0" " = \{field0 = 42, field2 =.*field3 = 45\}" "p bad_neg0" - # test that it at least gets field0 right - gdb_test "p bad_neg0" " = \{field0 = 42, field2 =" "p bad_neg0, test 2" gdb_test "ptype inttype" "type = (unsigned int|inttype)" "ptype on inttype" gdb_test "p sizeof (float72type)" " = 9" "unrecognized floating point type" @@ -146,8 +140,8 @@ proc do_tests {} { gdb_test "p/x bad_neg0const" " = \{field0 = 0x11222211, field2 =.*\ field3 = 0x77888877\}" "print struct constant" - gdb_test "ptype bad_type0" "type = " "print bad_type0" - gdb_test "ptype bad_type1" "type = " "print bad_type1" + gdb_test "ptype bad_type0" "type = .*" "print bad_type0" + gdb_test "ptype bad_type1" "type = .*" "print bad_type1" # GDB does not yet support arrays indexed by anything at all unusual setup_xfail "*-*-*" @@ -173,8 +167,6 @@ field3 = 0x77888877\}" "print struct constant" setup_xfail "*-*-*" gdb_test "whatis intp_var" "type = intp" - # xcoffread.c doesn't understand common blocks at all - setup_xfail "rs6*-*-aix*" gdb_test "p common0var0" "= 42" # GDB seems to only understand common blocks local to a function. # These variables never get relocated to be relative to the common @@ -187,6 +179,8 @@ field3 = 0x77888877\}" "print struct constant" gdb_test "p common0var2" "= 22" # this long line must be continous, not with "/" escaping the newline + # This apparently worked at one time and is now broken on some configs + setup_xfail "sparc-sun-sunos4*" "sparc-sun-solaris*" "hppa*-*-*" gdb_test "p v_comb" "{<> = {<> = {x = 42}, \[_a-zA-Z$.\]* = \[0-9xa-fA-F\]*, a = 43}, <> = {\[_a-zA-Z$.\]* = \[0-9xa-fA-F\]*, b = 44}, comb = 45}" } @@ -227,40 +221,75 @@ gdb_reinitialize_dir $srcdir/$subdir # Don't use gdb_load; it doesn't bitch if the loading produced some # error messages during symbol reading. -set binfile $objdir/$subdir/weird.o +set testfile weird +set srcfile ${objdir}/${subdir}/weird.s +set binfile ${objdir}/${subdir}/weird.o -if ![file exists $binfile] then { - if $all_flag then { - warning "$binfile does not exist; tests suppressed" - } -} else { - # xcoffread.c wrongly bitches about the lack of a text section. - setup_xfail "rs*-*-aix*" - send "file $binfile\n" - # If $binfile is very long, a \r (but not a \n) will echo in the - # middle of the echo of the command. So to match the echo, we - # would like to match anything not containing \n - # (we would prefer to be sure not to match any warning message). - # But \[^\n\]* doesn't seem to work, so instead use the heuristic - # that a filename won't contain a space and a warning message will. - expect { - -re "^file \[^ \]*\r*\nReading symbols from $binfile\.\.\.done\.\r*\n$prompt $" { - pass "weird.o read without error" - } - -re "A program is being debugged already. Kill it\? \(y or n\)" { - send "y\n" - continue -expect - } - -re ".*$prompt $" { - fail "Errors reading weird.o" - } - timeout { - perror "couldn't load $binfile into $GDB (timed out)." - return -1 - } - eof { fail "(eof) cannot read weird.o" } - } - do_tests +global target_os +set sedscript ${srcdir}/${subdir}/aout.sed +switch -glob ${target_triplet} { + "hppa*-*-*" { + set sedscript ${srcdir}/${subdir}/hppa.sed + } + "mips-*-ecoff" { + set sedscript ${srcdir}/${subdir}/ecoff.sed + } + "powerpc-*-aix*" { + set sedscript ${srcdir}/${subdir}/xcoff.sed + } + "rs6000-*-aix*" { + set sedscript ${srcdir}/${subdir}/xcoff.sed + } + "*-*-aout" { + set sedscript ${srcdir}/${subdir}/aout.sed + } + "*-*-xcoff" { + set sedscript ${srcdir}/${subdir}/xcoff.sed + } + "alpha-*-*" { + set sedscript ${srcdir}/${subdir}/ecoff.sed + } } + +set exec_output [execute_anywhere "sed -f ${sedscript} < ${srcdir}/${subdir}/weird.def > ${srcfile}"] +if { $exec_output != "" } { + perror "Couldn't make test case." + return -1 +} + +if { [compile "${srcfile} -c -o ${binfile}"] != "" } { + perror "Couldn't compile ${srcfile}" + return -1 +} + +set exec_output [execute_anywhere "rm -f ${srcfile}"] +exp_send "file $binfile\n" +# If $binfile is very long, a \r (but not a \n) will echo in the +# middle of the echo of the command. So to match the echo, we +# would like to match anything not containing \n +# (we would prefer to be sure not to match any warning message). +# But \[^\n\]* doesn't seem to work, so instead use the heuristic +# that a filename won't contain a space and a warning message will. +# But spaces following by backspaces aren't really spaces. +expect { + -re "^file (\[^ \]| +\008)*\r*\nReading symbols from $binfile\.\.\.done\.\r*\n$prompt $" { + pass "weird.o read without error" + } + -re "A program is being debugged already. Kill it\? \(y or n\)" { + send "y\n" + exp_continue + } + -re ".*$prompt $" { + fail "Errors reading weird.o" + } + timeout { + perror "couldn't load $binfile into $GDB (timed out)." + return -1 + } + eof { fail "(eof) cannot read weird.o" } +} + +do_tests + return 0 -- 2.7.4