mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-26 05:47:26 +08:00
* gdb.stabs/wierd.exp: Rewrite to properly handling a missing
wierd.o, make more modular.
This commit is contained in:
@ -1,5 +1,7 @@
|
|||||||
Sat May 29 17:57:01 1993 Fred Fish (fnf@cygnus.com)
|
Sat May 29 17:57:01 1993 Fred Fish (fnf@cygnus.com)
|
||||||
|
|
||||||
|
* gdb.stabs/wierd.exp: Rewrite to properly handling a missing
|
||||||
|
wierd.o, make more modular.
|
||||||
* gdb.stabs/wierd.def (bad_neg0type, bad_neg0const): Remove
|
* gdb.stabs/wierd.def (bad_neg0type, bad_neg0const): Remove
|
||||||
spurious newlines that caused problems.
|
spurious newlines that caused problems.
|
||||||
|
|
||||||
|
@ -4,36 +4,13 @@
|
|||||||
if $tracelevel then {
|
if $tracelevel then {
|
||||||
strace $tracelevel
|
strace $tracelevel
|
||||||
}
|
}
|
||||||
|
|
||||||
set prms_id 0
|
set prms_id 0
|
||||||
set bug_id 0
|
set bug_id 0
|
||||||
|
|
||||||
gdb_reinitialize_dir $srcdir/$subdir
|
proc do_tests {} {
|
||||||
|
global binfile
|
||||||
# Don't use gdb_load; it doesn't bitch if the loading produced some
|
global prompt
|
||||||
# error messages during symbol reading.
|
|
||||||
set binfile $objdir/$subdir/wierd.o
|
|
||||||
|
|
||||||
if ![file exists $binfile] then {
|
|
||||||
error "$binfile does not exist."
|
|
||||||
alldone
|
|
||||||
}
|
|
||||||
|
|
||||||
# xcoffread.c wrongly bitches about the lack of a text section.
|
|
||||||
setup_xfail "rs*-*-aix*"
|
|
||||||
send "file $binfile\n"
|
|
||||||
expect {
|
|
||||||
-re "^file $binfile\r*\nReading symbols from $binfile\.\.\.done\.\r*\n$prompt $" {
|
|
||||||
pass "wierd.o read without error"
|
|
||||||
}
|
|
||||||
-re ".*$prompt $" {
|
|
||||||
fail "Errors reading wierd.o"
|
|
||||||
}
|
|
||||||
timeout {
|
|
||||||
error "couldn't load $binfile into $GDB (timed out)."
|
|
||||||
return -1
|
|
||||||
}
|
|
||||||
eof { fail "(eof) cannot read wierd.o" }
|
|
||||||
}
|
|
||||||
|
|
||||||
# Do this first because the bug only exhibits itself before partial
|
# Do this first because the bug only exhibits itself before partial
|
||||||
# symbols have been expanded.
|
# symbols have been expanded.
|
||||||
@ -42,38 +19,6 @@ setup_xfail "*-*-*"
|
|||||||
clear_xfail "rs*-*-aix*"
|
clear_xfail "rs*-*-aix*"
|
||||||
gdb_test "ptype red" "type = enum \{red, green, blue\}" "ptype unnamed enum"
|
gdb_test "ptype red" "type = enum \{red, green, blue\}" "ptype unnamed enum"
|
||||||
|
|
||||||
proc print_wierd_var { var } {
|
|
||||||
global prompt
|
|
||||||
|
|
||||||
# GDB does not yet understand type attributes
|
|
||||||
setup_xfail "*-*-*"
|
|
||||||
|
|
||||||
# Make sure that the variable gets printed out correctly, without
|
|
||||||
# any sort of warning message.
|
|
||||||
send "print $var\n"
|
|
||||||
expect {
|
|
||||||
-re "^print $var\r*\n.\[0-9\]* = 42.*$prompt $" {
|
|
||||||
pass "variable $var printed properly"
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
-re ".*$prompt $" {
|
|
||||||
fail "variable $var not printed properly"
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
timeout { fail "variable $var not printed (timeout)" }
|
|
||||||
eof { fail "(eof) variable $var not printed" }
|
|
||||||
}
|
|
||||||
|
|
||||||
# GDB does not yet understand type attributes
|
|
||||||
setup_xfail "*-*-*"
|
|
||||||
|
|
||||||
# Make sure that the stabs did get loaded in a sensible way.
|
|
||||||
# If somehow the stabs got skipped, then the above test can
|
|
||||||
# pass because GDB assumes int for variables without a stab.
|
|
||||||
|
|
||||||
gdb_test "whatis $var\n" "type = (unsigned int|inttype)" "whatis on $var"
|
|
||||||
}
|
|
||||||
|
|
||||||
print_wierd_var var0
|
print_wierd_var var0
|
||||||
print_wierd_var var1
|
print_wierd_var var1
|
||||||
print_wierd_var var2
|
print_wierd_var var2
|
||||||
@ -214,8 +159,70 @@ setup_xfail "*-*-*"
|
|||||||
gdb_test "whatis pointer_to_int_var" "type = int \*" "whatis p t i v"
|
gdb_test "whatis pointer_to_int_var" "type = int \*" "whatis p t i v"
|
||||||
setup_xfail "*-*-*"
|
setup_xfail "*-*-*"
|
||||||
gdb_test "whatis intp_var" "type = intp" "whatis intp_var"
|
gdb_test "whatis intp_var" "type = intp" "whatis intp_var"
|
||||||
|
}
|
||||||
|
|
||||||
|
proc print_wierd_var { var } {
|
||||||
|
global prompt
|
||||||
|
|
||||||
|
# GDB does not yet understand type attributes
|
||||||
|
setup_xfail "*-*-*"
|
||||||
|
|
||||||
|
# Make sure that the variable gets printed out correctly, without
|
||||||
|
# any sort of warning message.
|
||||||
|
send "print $var\n"
|
||||||
|
expect {
|
||||||
|
-re "^print $var\r*\n.\[0-9\]* = 42.*$prompt $" {
|
||||||
|
pass "variable $var printed properly"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
-re ".*$prompt $" {
|
||||||
|
fail "variable $var not printed properly"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
timeout { fail "variable $var not printed (timeout)" }
|
||||||
|
eof { fail "(eof) variable $var not printed" }
|
||||||
|
}
|
||||||
|
|
||||||
|
# GDB does not yet understand type attributes
|
||||||
|
setup_xfail "*-*-*"
|
||||||
|
|
||||||
|
# Make sure that the stabs did get loaded in a sensible way.
|
||||||
|
# If somehow the stabs got skipped, then the above test can
|
||||||
|
# pass because GDB assumes int for variables without a stab.
|
||||||
|
|
||||||
|
gdb_test "whatis $var\n" "type = (unsigned int|inttype)" "whatis on $var"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Start with a fresh gdb
|
||||||
|
|
||||||
#Prevent some failures in default.exp, which are probably GDB bugs
|
|
||||||
# (but trivial ones).
|
|
||||||
gdb_exit
|
gdb_exit
|
||||||
gdb_start
|
gdb_start
|
||||||
|
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/wierd.o
|
||||||
|
|
||||||
|
if ![file exists $binfile] 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"
|
||||||
|
expect {
|
||||||
|
-re "^file $binfile\r*\nReading symbols from $binfile\.\.\.done\.\r*\n$prompt $" {
|
||||||
|
pass "wierd.o read without error"
|
||||||
|
}
|
||||||
|
-re ".*$prompt $" {
|
||||||
|
fail "Errors reading wierd.o"
|
||||||
|
}
|
||||||
|
timeout {
|
||||||
|
error "couldn't load $binfile into $GDB (timed out)."
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
eof { fail "(eof) cannot read wierd.o" }
|
||||||
|
}
|
||||||
|
do_tests
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0
|
||||||
|
Reference in New Issue
Block a user