#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
send "set listsize $arg\n"
expect {
- -re "set listsize $arg\r\n$prompt $" {}
+ -re "set listsize $arg\[\r\n\]+$prompt $" {}
-re ".*$prompt $" { fail "setting listsize to $arg" ; return 0 }
timeout { fail "set listsize to $arg (timeout)" ; return 0 }
}
}
# Show the default lines
+ # The second case is for optimized code, it is still correct.
# This doesn't work for COFF targets.
setup_xfail "a29k-*-udi"
send "list\n"
expect {
-re "1\[ \t\]+#include \"list0.h\".*10\[ \t\]+x = 0;\r\n$prompt $" {
- pass "show default lines around main"
+ pass "list default lines around main"
+ }
+ -re "2.*11\[ \t\]+foo .x\[+)\]+;\r\n$prompt $" {
+ pass "list default lines around main"
}
-re ".*$prompt $" {
fail "list default lines around main"
send "set listsize 0\n"
expect {
- -re "set listsize 0\r\n$prompt $" {
+ -re "set listsize 0\[\r\n\]+$prompt $" {
setup_xfail "*-*-*"
send "show listsize\n"
expect {
}
send "list 1\n"
expect {
- -re "list 1\r\n$prompt $" {
+ -re "list 1\[\r\n\]+$prompt $" {
pass "listsize of 0 suppresses output"
}
-re ".*$prompt $" {
send "set listsize -1\n"
expect {
- -re "set listsize -1\r\n$prompt $" {
+ -re "set listsize -1\[\r\n\]+$prompt $" {
send "show listsize\n"
expect {
-re "Number of source lines .* is unlimited.\r\n.*$prompt $" {
-re "1\[ \t\]+#include .*\r\n39\[ \t\]+\}\r\n$prompt $" {
pass "list line 1 with unlimited listsize"
}
- -re "list 1\r\n$prompt $" {
+ -re "list 1\[\r\n\]+$prompt $" {
fail "listsize of -1 (unlimited) suppresses output"
}
timeout {
-re "1\[ \t\]+#include .*8\[ \t\]+breakpoint\[(\]\[)\]+;\r\n$prompt $" {
pass "list function in source file 1"
}
- -re "2\[ \t\]+.*11\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$prompt $" {
+ -re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$prompt $" {
pass "list function in source file 1"
}
-re ".*$prompt $" { fail "list main" ; return }
# SunPRO cc is the third case.
# FIXME This fails on DWARF
setup_xfail "*-*-sysv4*"
+ setup_xfail "powerpc-*-*"
send "list foo\n"
expect {
-re "2\[ \t\]+including file.*11\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$prompt $" {
-re "1\[ \t\]+#include .*8\[ \t\]+breakpoint\[(\]\[)\]+;\r\n$prompt $" {
incr testcnt
}
- -re "2\[ \t\]+.*11\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$prompt $" {
+ -re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$prompt $" {
pass "list function in source file 1"
}
-re ".*$prompt $" { fail "list list0.c:main" }
-re "36\[ \t\]+\}.*42\[ \t\]+\}\r\n$prompt $" {
incr testcnt
}
- -re "36.*42\[ \t\]+\}\r\n$prompt $" {
+ -re "37.*42\[ \t\]+\}\r\n$prompt $" {
incr testcnt
}
-re ".*$prompt $" { fail "list list0.c:unused" }
# SunPRO cc is the third case.
# FIXME This fails on DWARF
setup_xfail "rs6000-*-*" 1804
+ setup_xfail "powerpc-*-*" 1804
setup_xfail "*-*-sysv4*"
# FIXME Fails for COFF as well, I think.
setup_xfail "a29k-*-udi"
}
proc test_forward_search {} {
- global timeout
gdb_test "set listsize 4" ""
# On SunOS4, this gives us lines 19-22. On AIX, it gives us
# In any case, we just want GDB to not crash if the line
# being searched is extremely long.
- set oldtimeout $timeout
set timeout 30
gdb_test "search 1234" ""
- set timeout $oldtimeout
}
# Start with a fresh gdb.
# being told they are ints or functions returning int like old
# versions of gdb used to do.
- # On alpha (and other ecoff systems, even stabs in ecoff) GCC
- # puts out stProc and related symbols which cause GDB to think
- # it knows the type. GDB probably could be fixed to do
- # better, but for now xfail these tests. Irix5, even though
- # it is ELF, counts as "ecoff" because gcc puts out a .mdebug
- # section even without -g. Personally, I think that is pretty
- # dubious, but maybe dbx requires it.
- setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
+ # On alpha (and other ecoff systems) the native compilers put
+ # out debugging info for non-aggregate return values of functions
+ # even without -g, which should be accepted.
+ # Irix5, even though it is ELF, counts as "ecoff" because it
+ # encapsulates ecoff debugging info in a .mdebug section.
+
gdb_test "p top" \
- "{<(text variable|function), no debug info>} \[0-9a-fx]* <top>"
- setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
- gdb_test "whatis top" "<(text variable|function), no debug info>"
- setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
- gdb_test "ptype top" "int \\((|<non-float parameter>)\\)"
+ "{(<(text variable|function), no debug info>|short \\(\\))} \[0-9a-fx]* <top>"
+ gdb_test "whatis top" \
+ "(<(text variable|function), no debug info>|short \\(\\))"
+ gdb_test "ptype top" "(short|int) \\((|<non-float parameter>|<non-float parameter>, <non-float parameter>)\\)"
- setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
gdb_test "p middle" \
- "{<(text variable|function), no debug info>} \[0-9a-fx]* <middle>"
- setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
- gdb_test "whatis middle" "<(text variable|function), no debug info>"
- setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
- gdb_test "ptype middle" "int \\((|<non-float parameter>)\\)"
+ "{(<(text variable|function), no debug info>|short \\(\\))} \[0-9a-fx]* <middle>"
+ gdb_test "whatis middle" \
+ "(<(text variable|function), no debug info>|short \\(\\))"
+ gdb_test "ptype middle" "(short|int) \\((|<non-float parameter>|<non-float parameter>, <non-float parameter>)\\)"
gdb_test "p dataglobal" "= 3"
- setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
gdb_test "whatis dataglobal" \
"<(data variable|variable), no debug info>"
- setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
gdb_test "ptype dataglobal" "<(data variable|variable), no debug info>"
# The only symbol xcoff puts out for statics is for the TOC entry.
# Possible, but hairy, for gdb to deal. Right now it doesn't, it
# doesn't know the variables exist at all.
setup_xfail "rs6000*-*-aix*"
+ setup_xfail "powerpc*-*-aix*"
gdb_test "p datalocal" "= 4"
setup_xfail "rs6000*-*-aix*"
- setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
+ setup_xfail "powerpc*-*-aix*"
gdb_test "whatis datalocal" "<(data variable|variable), no debug info>"
setup_xfail "rs6000*-*-aix*"
- setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
+ setup_xfail "powerpc*-*-aix*"
gdb_test "ptype datalocal" "<(data variable|variable), no debug info>"
gdb_test "p bssglobal" "= 0"
- setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
gdb_test "whatis bssglobal" "<(data variable|variable), no debug info>"
- setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
gdb_test "ptype bssglobal" "<(data variable|variable), no debug info>"
setup_xfail "rs6000*-*-aix*"
+ setup_xfail "powerpc*-*-aix*"
gdb_test "p bsslocal" "= 0"
setup_xfail "rs6000*-*-aix*"
- setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
+ setup_xfail "powerpc*-*-aix*"
gdb_test "whatis bsslocal" "<(data variable|variable), no debug info>"
setup_xfail "rs6000*-*-aix*"
- setup_xfail "alpha*-*-osf*" "mips*-*-irix*" "*-*-ultrix*"
+ setup_xfail "powerpc*-*-aix*"
gdb_test "ptype bsslocal" "<(data variable|variable), no debug info>"
gdb_test "backtrace" "#0.*inner.*#1.*middle.*#2.*top.*#3.*main.*" \
- "backtrace in nodebug.exp"
+ "backtrace from inner in nodebug.exp"
# Or if that doesn't work, at least hope for the external symbols
# Commented out because if we aren't going to xfail the above test
# ever, why bother with a weaker test?
#gdb_test "backtrace" "#0.*inner.*#1.*#2.*top.*#3.*main.*" \
- # "backtrace in nodebug.exp for externals"
+ # "backtrace from inner in nodebug.exp for externals"
# This test is not as obscure as it might look. `p getenv ("TERM")'
# is a real-world example, at least on many systems.
# Now, try that we can give names of file-local symbols which happen
# to be unique, and have it still work
if [runto middle] then {
- gdb_test "backtrace" "#0.*middle.*#1.*top.*#2.*main.*"
+ gdb_test "backtrace" "#0.*middle.*#1.*top.*#2.*main.*" \
+ "backtrace from middle in nodebug.exp"
}
}
}
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
# Print scope0.c::filelocal_ro, which is 201
+ # No clue why the powerpc fails this test.
+ setup_xfail "powerpc-*-*"
send "print filelocal_ro\n"
expect {
-re "\\\$$decimal = 201\r\n$prompt $" { pass "print filelocal_ro" }
}
setup_xfail "rs6000-*-*"
+ setup_xfail "powerpc-*-*"
send "print 'scope0.c'::filelocal_ro\n"
expect {
-re "\\\$$decimal = 201\r\n$prompt $" {
}
}
- # Print scope0.c::filelocal_bss, which is 101
+ # Print scope0.c::filelocal_bss, which is 101
setup_xfail "rs6000-*-*"
send "print 'scope0.c'::filelocal_bss\n"
}
}
- # Print scope0.c::filelocal_ro, which is 201
+ # Print scope0.c::filelocal_ro, which is 201
setup_xfail "rs6000-*-*"
+ setup_xfail "powerpc-*-*"
send "print 'scope0.c'::filelocal_ro\n"
expect {
-re "\\\$$decimal = 201\r\n$prompt $" { pass "print 'scope0.c'::filelocal_ro" }
}
}
- # Print scope1.c::filelocal, which is 2
+ gdb_test "print filelocal" "\\\$$decimal = 2" "print filelocal at foo"
- send "print filelocal\n"
- expect {
- -re "\\\$$decimal = 2\r\n$prompt $" { pass "print filelocal" }
- -re "$prompt $" { fail "print filelocal" ; return }
- timeout {
- fail "(timeout) print filelocal" ; return
- }
- }
+ # Print scope1.c::filelocal, which is 2
setup_xfail "rs6000-*-*"
send "print 'scope1.c'::filelocal\n"
expect {
- -re "\\\$$decimal = 2\r\n$prompt $" { pass "print 'scope1.c'::filelocal" }
+ -re "\\\$$decimal = 2\r\n$prompt $" {
+ pass "print 'scope1.c'::filelocal at foo"
+ }
-re "No symbol \"scope1.c\" in current context.*$prompt $" {
send "print '$srcdir/$subdir/scope1.c'::filelocal\n"
exp_continue
}
- -re "$prompt $" { fail "print 'scope1.c'::filelocal" ; return }
+ -re "$prompt $" { fail "print 'scope1.c'::filelocal at foo" ; return }
timeout {
- fail "(timeout) print 'scope1.c'::filelocal" ; return
+ fail "(timeout) print 'scope1.c'::filelocal at foo" ; return
}
}
- # Print scope1.c::filelocal_bss, which is 102
-
- send "print filelocal_bss\n"
- expect {
- -re "\\\$$decimal = 102\r\n$prompt $" { pass "print filelocal_bss" }
- -re "$prompt $" { fail "print filelocal_bss" ; return }
- timeout {
- fail "(timeout) print filelocal_bss" ; return
- }
- }
+ gdb_test "print filelocal_bss" "\\\$$decimal = 102" \
+ "print filelocal_bss at foo"
setup_xfail "rs6000-*-*"
send "print 'scope1.c'::filelocal_bss\n"
expect {
- -re "\\\$$decimal = 102\r\n$prompt $" { pass "print 'scope1.c'::filelocal_bss" }
+ -re "\\\$$decimal = 102\r\n$prompt $" {
+ pass "print 'scope1.c'::filelocal_bss at foo"
+ }
-re "No symbol \"scope1.c\" in current context.*$prompt $" {
send "print '$srcdir/$subdir/scope1.c'::filelocal_bss\n"
exp_continue
}
- -re "$prompt $" { fail "print 'scope1.c'::filelocal_bss" ; return }
+ -re "$prompt $" { fail "print 'scope1.c'::filelocal_bss at foo" }
timeout {
- fail "(timeout) print 'scope1.c'::filelocal_bss" ; return
+ fail "(timeout) print 'scope1.c'::filelocal_bss at foo"
}
}
- # Print scope1.c::filelocal_ro, which is 202
-
- send "print filelocal_ro\n"
- expect {
- -re "\\\$$decimal = 202\r\n$prompt $" { pass "print filelocal_ro" }
- -re "$prompt $" { fail "print filelocal_ro" ; return }
- timeout {
- fail "(timeout) print filelocal_ro" ; return
- }
- }
+ gdb_test "print filelocal_ro" "\\\$$decimal = 202" \
+ "print filelocal_ro at foo"
setup_xfail "rs6000-*-*"
send "print 'scope1.c'::filelocal_ro\n"
expect {
- -re "\\\$$decimal = 202\r\n$prompt $" { pass "print 'scope1.c'::filelocal_ro" }
+ -re "\\\$$decimal = 202\r\n$prompt $" { pass "print 'scope1.c'::filelocal_ro at foo" }
-re "No symbol \"scope1.c\" in current context.*$prompt $" {
send "print '$srcdir/$subdir/scope1.c'::filelocal_ro\n"
exp_continue
}
- -re "$prompt $" { fail "print 'scope1.c'::filelocal_ro" ; return }
+ -re "$prompt $" { fail "print 'scope1.c'::filelocal_ro at foo" }
timeout {
- fail "(timeout) print 'scope1.c'::filelocal_ro" ; return
+ fail "(timeout) print 'scope1.c'::filelocal_ro at foo"
}
}
# Print scope1.c::foo::funclocal, which is 3
- send "print funclocal\n"
- expect {
- -re "\\\$$decimal = 3\r\n$prompt $" { pass "print funclocal" }
- -re "$prompt $" { fail "print funclocal" ; return }
- timeout {
- fail "(timeout) print funclocal" ; return
- }
- }
+ gdb_test "print funclocal" "\\\$$decimal = 3" "print funclocal at foo"
- send "print foo::funclocal\n"
- expect {
- -re "\\\$$decimal = 3\r\n$prompt $" { pass "print foo::funclocal" }
- -re "$prompt $" { fail "print foo::funclocal" ; return }
- timeout {
- fail "(timeout) print foo::funclocal" ; return
- }
- }
+ gdb_test "print foo::funclocal" "\\\$$decimal = 3" \
+ "print foo::funclocal at foo"
setup_xfail "rs6000-*-*"
send "print 'scope1.c'::foo::funclocal\n"
expect {
- -re "\\\$$decimal = 3\r\n$prompt $" { pass "print 'scope1.c'::foo::funclocal" }
+ -re "\\\$$decimal = 3\r\n$prompt $" {
+ pass "print 'scope1.c'::foo::funclocal at foo"
+ }
-re "No symbol \"scope1.c\" in current context.*$prompt $" {
send "print '$srcdir/$subdir/scope1.c'::foo::funclocal\n"
exp_continue
}
- -re "$prompt $" { fail "print 'scope1.c'::foo::funclocal" ; return }
+ -re "$prompt $" { fail "print 'scope1.c'::foo::funclocal at foo" }
timeout {
- fail "(timeout) print 'scope1.c'::foo::funclocal" ; return
+ fail "(timeout) print 'scope1.c'::foo::funclocal at foo"
}
}
# Print scope1.c::foo::funclocal_bss, which is 103
- send "print funclocal_bss\n"
- expect {
- -re "\\\$$decimal = 103\r\n$prompt $" { pass "print funclocal_bss" }
- -re "$prompt $" { fail "print funclocal_bss" ; return }
- timeout {
- fail "(timeout) print funclocal_bss" ; return
- }
- }
+ gdb_test "print funclocal_bss" "\\\$$decimal = 103" \
+ "print funclocal_bss at foo"
- send "print foo::funclocal_bss\n"
- expect {
- -re "\\\$$decimal = 103\r\n$prompt $" { pass "print foo::funclocal_bss" }
- -re "$prompt $" { fail "print foo::funclocal_bss" ; return }
- timeout {
- fail "(timeout) print foo::funclocal_bss" ; return
- }
- }
+ gdb_test "print foo::funclocal_bss" "\\\$$decimal = 103" \
+ "print foo::funclocal_bss at foo"
setup_xfail "rs6000-*-*"
send "print 'scope1.c'::foo::funclocal_bss\n"
expect {
- -re "\\\$$decimal = 103\r\n$prompt $" { pass "print 'scope1.c'::foo::funclocal_bss" }
+ -re "\\\$$decimal = 103\r\n$prompt $" {
+ pass "print 'scope1.c'::foo::funclocal_bss at foo"
+ }
-re "No symbol \"scope1.c\" in current context.*$prompt $" {
send "print '$srcdir/$subdir/scope1.c'::foo::funclocal_bss\n"
exp_continue
}
- -re "$prompt $" { fail "print 'scope1.c'::foo::funclocal_bss" ; return }
+ -re "$prompt $" {
+ fail "print 'scope1.c'::foo::funclocal_bss at foo"
+ }
timeout {
- fail "(timeout) print 'scope1.c'::foo::funclocal_bss" ; return
+ fail "(timeout) print 'scope1.c'::foo::funclocal_bss at foo"
}
}
# Print scope1.c::foo::funclocal_ro, which is 203
- send "print funclocal_ro\n"
- expect {
- -re "\\\$$decimal = 203\r\n$prompt $" { pass "print funclocal_ro" }
- -re "$prompt $" { fail "print funclocal_ro" ; return }
- timeout {
- fail "(timeout) print funclocal_ro" ; return
- }
- }
+ gdb_test "print funclocal_ro" "\\\$$decimal = 203" \
+ "print funclocal_ro at foo"
- send "print foo::funclocal_ro\n"
- expect {
- -re "\\\$$decimal = 203\r\n$prompt $" { pass "print foo::funclocal_ro" }
- -re "$prompt $" { fail "print foo::funclocal_ro" ; return }
- timeout {
- fail "(timeout) print foo::funclocal_ro" ; return
- }
- }
+ gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203" \
+ "print foo::funclocal_ro at foo"
setup_xfail "rs6000-*-*"
send "print 'scope1.c'::foo::funclocal_ro\n"
expect {
- -re "\\\$$decimal = 203\r\n$prompt $" { pass "print 'scope1.c'::foo::funclocal_ro" }
+ -re "\\\$$decimal = 203\r\n$prompt $" {
+ pass "print 'scope1.c'::foo::funclocal_ro at foo"
+ }
-re "No symbol \"scope1.c\" in current context.*$prompt $" {
send "print '$srcdir/$subdir/scope1.c'::foo::funclocal_ro\n"
exp_continue
}
- -re "$prompt $" { fail "print 'scope1.c'::foo::funclocal_ro" ; return }
+ -re "$prompt $" { fail "print 'scope1.c'::foo::funclocal_ro at foo" }
timeout {
- fail "(timeout) print 'scope1.c'::foo::funclocal_ro" ; return
+ fail "(timeout) print 'scope1.c'::foo::funclocal_ro at foo"
}
}
# Print scope1.c::bar::funclocal, which is 4
- send "print bar::funclocal\n"
- expect {
- -re "\\\$$decimal = 4\r\n$prompt $" { pass "print bar::funclocal" }
- -re "$prompt $" { fail "print bar::funclocal" ; return }
- timeout {
- fail "(timeout) print bar::funclocal" ; return
- }
- }
+ gdb_test "print bar::funclocal" "\\\$$decimal = 4" \
+ "print bar::funclocal at foo"
setup_xfail "rs6000-*-*"
send "print 'scope1.c'::bar::funclocal\n"
expect {
- -re "\\\$$decimal = 4\r\n$prompt $" { pass "print 'scope1.c'::bar::funclocal" }
+ -re "\\\$$decimal = 4\r\n$prompt $" {
+ pass "print 'scope1.c'::bar::funclocal at foo"
+ }
-re "No symbol \"scope1.c\" in current context.*$prompt $" {
send "print '$srcdir/$subdir/scope1.c'::bar::funclocal\n"
exp_continue
}
- -re "$prompt $" { fail "print 'scope1.c'::bar::funclocal" ; return }
+ -re "$prompt $" { fail "print 'scope1.c'::bar::funclocal at foo" }
timeout {
- fail "(timeout) print 'scope1.c'::bar::funclocal" ; return
+ fail "(timeout) print 'scope1.c'::bar::funclocal at foo"
}
}
}
# Print scope0.c::filelocal_ro, which is 201
setup_xfail "rs6000-*-*"
+ setup_xfail "powerpc-*-*"
send "print 'scope0.c'::filelocal_ro\n"
expect {
-re "\\\$$decimal = 201\r\n$prompt $" { pass "print 'scope0.c'::filelocal_ro" }
}
}
-# FIXME: This test was originally part of some local scope resolution
-# tests. It probably belongs somewhere else now.
+# This test has little to do with local scopes, but it is in scope.exp anyway.
+# That's life.
proc test_at_autovars {} {
global prompt
# Should be at first (outermost) scope. Check values.
- send "print localval\n"
- expect {
- -re ".* = 10\r\n$prompt $" { pass "bad value for localval, outer scope" }
- -re "$prompt $" { fail "bad value for localval, outer scope" ; return }
- default {
- fail "(timeout) bad value for localval, outer scope" ; return
- }
- }
- send "print localval1\n"
- expect {
- -re ".* = 11\r\n$prompt $" { pass "bad value for localval1" }
- -re "$prompt $" { fail "bad value for localval1" ; return }
- timeout { fail "(timeout) bad value for localval1" ; return }
- }
- send "print localval2\n"
- expect {
- -re "No symbol \"localval2\" in current context.\r\n$prompt $" {
- pass "bad value for localval2"
- }
- -re "$prompt $" { fail "bad value for localval2" ; return }
- timeout { fail "(timeout) bad value for localval2" ; return }
- }
- send "print localval3\n"
- expect {
- -re "No symbol \"localval3\" in current context.\r\n$prompt $" {
- pass "bad value for localval3"
- }
- -re "$prompt $" { fail "bad value for localval3" ; return }
- timeout { fail "(timeout) bad value for localval3" ; return }
- }
+ gdb_test "print localval" " = 10" "print localval, outer scope"
+ gdb_test "print localval1" " = 11" "print localval1, outer scope"
+ gdb_test "print localval2" "No symbol \"localval2\" in current context." \
+ "print localval2, outer scope"
+ gdb_test "print localval3" "No symbol \"localval3\" in current context." \
+ "print localval3, outer scope"
- send "cont\n"
- expect {
- -re "Break.* marker3 \\(\\) at .*:$decimal.*$prompt $" {
- send "up\n"
- expect {
- -re ".*$prompt $" {}
- timeout { fail "up from marker3" ; return }
- }
- }
- -re "$prompt $" { fail "continue to marker3" ; return }
- timeout { fail "(timeout) continue to marker3" ; return }
- }
+ if [gdb_test "cont" "Break.* marker3 \\(\\) at .*:$decimal.*" \
+ "continue to marker3 in scope.exp"] then { return }
+ if [gdb_test "up" "" "up from marker3 in scope.exp"] then { return }
# Should be at next (first nested) scope. Check values.
- send "print localval\n"
- expect {
- -re ".* = 20\r\n$prompt $" { pass "bad value for localval, first nested scope" }
- -re "$prompt $" {
- fail "bad value for localval, first nested scope" ; return
- }
- timeout {
- fail "(timeout) bad value for localval, first nested scope" ;
- return
- }
- }
- send "print localval1\n"
- expect {
- -re ".* = 11\r\n$prompt $" { pass "bad value for localval1" }
- -re "$prompt $" { fail "bad value for localval1" ; return }
- timeout { fail "(timeout) bad value for localval1" ; return }
- }
- send "print localval2\n"
- expect {
- -re ".* = 12\r\n$prompt $" { pass "bad value for localval2" }
- -re "$prompt $" { fail "bad value for localval2" ; return }
- timeout { fail "(timeout) bad value for localval2" ; return }
- }
- send "print localval3\n"
- expect {
- -re "No symbol \"localval3\" in current context.\r\n$prompt $" {
- pass "bad value for localval3"
- }
- -re "$prompt $" { fail "bad value for localval3" ; return }
- timeout { fail "(timeout) bad value for localval3" ; return }
- }
+ gdb_test "print localval" " = 20" \
+ "print localval, first nested scope"
+ gdb_test "print localval1" " = 11" "print localval1, first nested scope"
+ gdb_test "print localval2" " = 12" "print localval2, first nested scope"
+ gdb_test "print localval3" "No symbol \"localval3\" in current context." \
+ "print localval3, first nested scope"
# This test will only fail if the file was compiled by gcc, but
# there's no way to check that.
setup_xfail "a29k-*-udi" 2423
- send "cont\n"
- expect {
- -re "Break.* marker4.*at .*:$decimal.*$prompt $" {
- pass "continue to marker4"
- send "up\n"
- expect {
- -re ".*$prompt $" { pass "up from marker4" }
- timeout { fail "up from marker4" ; return }
- }
- }
- -re "$prompt $" { fail "continue to marker4" ; return }
- timeout { fail "(timeout) continue to marker4" ; return }
- }
-
- send "print localval\n"
- expect {
- -re ".* = 30\r\n$prompt $" { pass "bad value for localval, innermost scope" }
- -re "$prompt $" {
- fail "bad value for localval, innermost scope" ; return
- }
- timeout {
- fail "(timeout) bad value for localval, innermost scope" ; return
- }
- }
- send "print localval1\n"
- expect {
- -re ".* = 11\r\n$prompt $" { pass "bad value for localval1" }
- -re "$prompt $" { fail "bad value for localval1" ; return }
- timeout { fail "(timeout) bad value for localval1" ; return }
- }
- send "print localval2\n"
- expect {
- -re ".* = 12\r\n$prompt $" { pass "bad value for localval2" }
- -re "$prompt $" { fail "bad value for localval2" ; return }
- timeout { fail "(timeout) bad value for localval2" ; return }
- }
- send "print localval3\n"
- expect {
- -re ".* = 13\r\n$prompt $" { pass "bad value for localval3" }
- -re "$prompt $" { fail "bad value for localval3" ; return }
- timeout { fail "(timeout) bad value for localval3" ; return }
- }
+ if [gdb_test "cont" "Break.* marker4.*at .*:$decimal.*" \
+ "continue to marker4 in scope.exp"] then { return }
+ if [gdb_test "up" "" "up from marker4 in scope.exp"] then { return }
+
+ gdb_test "print localval" " = 30" "print localval, innermost scope"
+ gdb_test "print localval1" " = 11" "print localval1, innermost scope"
+ gdb_test "print localval2" " = 12" "print localval2, innermost scope"
+ gdb_test "print localval3" " = 13" "print localval3, innermost scope"
}
# Start with a fresh gdb.
# AIX--sections get mapped to the same address so we can't get the right one.
setup_xfail "rs6000-*-*"
+setup_xfail "powerpc-*-*"
gdb_test "print 'scope0.c'::filelocal_ro" "= 201"
gdb_test "print 'scope0.c'::filelocal" "= 1" \
"print 'scope0.c'::filelocal before run"
-if [runto main] then { test_at_main }
+if [runto_main] then { test_at_main }
if [istarget "mips-idt-*"] then {
# Restart because IDT/SIM runs out of file descriptors.
gdb_exit
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
# uses in the stabs. So we need to deal with names both from gcc and
# native compilers.
#
-# On the i960, which defaults to unsigned characters, gdb
-# misinterprets char as unsigned char.
-# Likewise with the rs6000; the compiler doesn't give us enough information
-# to distinguish between char and unsigned char
-setup_xfail "rs6000-*-*"
-setup_xfail "i960-*-*" 1821
-setup_xfail "mips-idt-*" "mips-sgi-*" "a29k-*-*"
gdb_test "whatis v_char" \
- "type = char" \
+ "type = (unsigned char|char)" \
"whatis char"
setup_xfail "a29k-*-*"
"whatis int"
gdb_test "whatis v_signed_int" \
- "type = int" \
+ "type = (signed |)int" \
"whatis signed int"
gdb_test "whatis v_unsigned_int" \
# AIX xlc gets this wrong and unsigned long right. Go figure.
if {!$gcc_compiled} then {setup_xfail "rs6000-*-aix*"}
gdb_test "whatis v_signed_long" \
- "type = (long|long int)" \
+ "type = (signed |)(long|long int)" \
"whatis signed long"
setup_xfail_on_long_vs_int
pass "whatis short array"
gdb_test "whatis v_signed_short_array" \
- "type = (short|short int) \\\[2\\\]" \
+ "type = (signed |)(short|short int) \\\[2\\\]" \
"whatis signed short array"
gdb_test "whatis v_unsigned_short_array" \
"whatis int array"
gdb_test "whatis v_signed_int_array" \
- "type = int \\\[2\\\]" \
+ "type = (signed |)int \\\[2\\\]" \
"whatis signed int array"
gdb_test "whatis v_unsigned_int_array" \
pass "whatis short pointer"
gdb_test "whatis v_signed_short_pointer" \
- "type = (short|short int) \\*" \
+ "type = (signed |)(short|short int) \\*" \
"whatis signed short pointer"
gdb_test "whatis v_unsigned_short_pointer" \
"whatis int pointer"
gdb_test "whatis v_signed_int_pointer" \
- "type = int \\*" \
+ "type = (signed |)int \\*" \
"whatis signed int pointer"
gdb_test "whatis v_unsigned_int_pointer" \
"whatis short function"
gdb_test "whatis v_signed_short_func" \
- "type = short (int |)\\(\\)" \
+ "type = (signed |)short (int |)\\(\\)" \
"whatis signed short function"
gdb_test "whatis v_unsigned_short_func" \
"whatis int function"
gdb_test "whatis v_signed_int_func" \
- "type = int \\(\\)" \
+ "type = (signed |)int \\(\\)" \
"whatis signed int function"
gdb_test "whatis v_unsigned_int_func" \
"whatis long function"
gdb_test "whatis v_signed_long_func" \
- "type = (int|long|long int) \\(\\)" \
+ "type = (signed |)(int|long|long int) \\(\\)" \
"whatis signed long function"
gdb_test "whatis v_unsigned_long_func" \