diff options
author | Fred Fish <fnf@specifix.com> | 1996-03-20 02:58:28 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1996-03-20 02:58:28 +0000 |
commit | a9424716eaef1fc9e97439758a0812a83d5ea43f (patch) | |
tree | f57804c38c3c8855f193a811e6a01575c3242c46 /gdb/testsuite/gdb.stabs | |
parent | 60e42680304d607ba94d42382514a9ea313b7ce3 (diff) | |
download | gdb-a9424716eaef1fc9e97439758a0812a83d5ea43f.zip gdb-a9424716eaef1fc9e97439758a0812a83d5ea43f.tar.gz gdb-a9424716eaef1fc9e97439758a0812a83d5ea43f.tar.bz2 |
From Peter Schauer <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE>
* 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.
Diffstat (limited to 'gdb/testsuite/gdb.stabs')
-rw-r--r-- | gdb/testsuite/gdb.stabs/weird.exp | 115 |
1 files changed, 72 insertions, 43 deletions
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 |