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"
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 "*-*-*"
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
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}"
}
# 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