2001-05-19 Michael Chastain <chastain@redhat.com>
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / default.exp
index 0f5a408de9c8ce92ca9979acd86593509a6a20d5..bc43143ac9007e2f4bc682f7d54e980c368146ca 100644 (file)
@@ -1,3 +1,24 @@
+#   Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001
+#   Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# 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., 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
+
 # Start with a fresh gdb
 
 gdb_exit
@@ -20,6 +41,8 @@ gdb_expect {
                        { pass "attach" }
     -re "You can't do that when your target is `None'.*$gdb_prompt $"\
                        { pass "attach" }
+    -re "You can't do that without a process to debug.*$gdb_prompt $"\
+                       { pass "attach" }
     -re "Don't know how to attach.  Try \"help target\"..*$gdb_prompt $"\
                        { pass "attach" }
     -re "Kill it. .y or n." {
@@ -45,6 +68,11 @@ if ![target_info exists use_gdb_stub] {
     
     setup_xfail "mips-idt-*" "a29k-*-udi"
     gdb_test "backtrace" "No stack."
+
+    # ba and bac are no longer unique command prefixes. So these tests
+    # elict an error from GDB.
+    # GDB needs to be fixed to map unique alias here for ba bac.
+    #
     foreach i "bt ba bac" {
        setup_xfail "mips-idt-*" "a29k-*-udi"
        gdb_test $i "No stack." "backtrace \"$i\" abbreviation"
@@ -72,7 +100,7 @@ gdb_test "call" "The history is empty..*" "call"
 
 
 #test catch
-gdb_test "catch" "No selected frame..*" "catch"
+gdb_test "catch" "Catch requires an event name..*" "catch"
 
 #test cd
 gdb_test "cd" "Argument required .new working directory.*" "cd"
@@ -180,7 +208,7 @@ gdb_test "enable" "" "enable"
 #test exec-file
 send_gdb "exec-file\n"
 gdb_expect {
-    -re "No exec file now..*$gdb_prompt $" {
+    -re "No executable file now..*$gdb_prompt $" {
        pass "exec-file"
     }
     -re "exec-file.*A program is being debugged already.  Kill it. .y or n.*$" {
@@ -208,7 +236,7 @@ gdb_test "fg" "The program is not being run." "fg"
 #test file
 send_gdb "file\n"
 gdb_expect {
-    -re "No exec file now..*$gdb_prompt $"\
+    -re "No executable file now..*$gdb_prompt $"\
            { pass "file" }
     -re ".*A program is being debugged already.  Kill it. .y or n.*$" {
        send_gdb "n\n"
@@ -253,7 +281,7 @@ gdb_test "info bogus-gdb-command" "Undefined info command: \"bogus-gdb-command\"
 #test info breakpoints
 gdb_test "info breakpoints" "No breakpoints or watchpoints." "info breakpoints"
 #test info catch
-gdb_test "info catch" "No frame selected." "info catch"
+gdb_test "info catch" "You can't do that without a process to debug." "info catch"
 #test info copying
 # FIXME -- doesn't work worth a shit
 #send_gdb "info copying"
@@ -271,10 +299,14 @@ gdb_test "info frame" "No stack.|No selected frame." "info frame"
 #test info files
 gdb_test "info files" "" "info files"
 #test info float
-if [istarget "arm-*-*"] then {
+if [istarget "arm*-*-*"] then {
     gdb_test "info float" "Software FPU type.*mask:.*flags:.*" "info float"
-} elseif [istarget "thumb-*-*"] then {
+} elseif [istarget "thumb*-*-*"] then {
     gdb_test "info float" "Software FPU type.*mask:.*flags:.*" "info float"
+} elseif [istarget "strongarm*-*-*"] then {
+    gdb_test "info float" "Software FPU type.*mask:.*flags:.*" "info float"
+} elseif [istarget "i\[3456\]86-*-*"] then {
+    gdb_test "info float" "R7:.*Status Word:.*Opcode:.*" "info float"
 } else {
     gdb_test "info float" "No floating point info available for this processor." "info float"
 }
@@ -296,6 +328,8 @@ setup_xfail "a29k-*-udi"
 gdb_test "info stack" "No stack." "info stack"
 #test info set
 # FIXME -- needs to match the entire output
+# FIXME -- on native solaris 2.8, this test fails due to this line:
+#  prompt:  Gdb's prompt is "(gdb) ".^M
 gdb_test "info set" "confirm:  Whether to confirm potentially dangerous operations is o\[a-z\]*..*\[\r\n\]+history filename:  The filename in which to record the command history is .*\[\r\n\]+listsize:  Number of source lines gdb will list by default is 10.*" "info set"
 gdb_test "info symbol" "Argument required .address.."
 #test info source
@@ -311,6 +345,7 @@ gdb_test "info types" "All defined types:" "info types"
 #test info variables
 gdb_test "info variables" "All defined variables:" "info variables"
 #test info warranty
+setup_xfail "hppa*-hp-hpux*"
 gdb_test "info warranty" "NO WARRANTY.*\[\r\n\]+  *11.  *BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY.*\[\r\n\]+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN.*\[\r\n\]+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES.*\[\r\n\]+PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED.*\[\r\n\]+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF.*\[\r\n\]+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS.*\[\r\n\]+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE.*\[\r\n\]+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,.*\[\r\n\]+REPAIR OR CORRECTION..*\[\r\n\]+  *12.  *IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING.*\[\r\n\]+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR.*\[\r\n\]+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,.*\[\r\n\]+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING.*\[\r\n\]+OUT OF THE USE OR INABILITY TO USE THE PROGRAM .INCLUDING BUT NOT LIMITED.*\[\r\n\]+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY.*\[\r\n\]+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER.*\[\r\n\]+PROGRAMS., EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE.*\[\r\n\]+POSSIBILITY OF SUCH DAMAGES.*" "info warranty"
 #test info watchpoints
 gdb_test "info watchpoints" "No breakpoints or watchpoints." "info watchpoints"
@@ -354,7 +389,7 @@ gdb_test "overlay auto"   ""
 gdb_test "overlay off"    ""
 gdb_test "overlay list"   "No sections are mapped."
 gdb_test "overlay map"    "Overlay debugging not enabled.*" "overlay map #1"
-gdb_test "overlay unmap"  "Overlay debugging not enabled.*" "overlay unmap #2"
+gdb_test "overlay unmap"  "Overlay debugging not enabled.*" "overlay unmap #1"
 gdb_test "overlay manual" "" "overlay manual #2"
 gdb_test "overlay map"    "Argument required: name of an overlay section." "overlay map #2"
 gdb_test "overlay unmap"  "Argument required: name of an overlay section." "overlay unmap #2"
@@ -622,7 +657,7 @@ gdb_test "show values" "" "show values"
 #test show verbose
 gdb_test "show verbose" "Verbose printing of informational messages is o.*|Verbosity is off.*" "show verbose"
 #test show version
-
+setup_xfail "hppa*-hp-hpux*"
 gdb_test "show version" "GNU gdb \[0-9\.\]*.*\[\r\n\]+Copyright \[0-9\]* Free Software Foundation, Inc.*\[\r\n\]+GDB is free software, covered by the GNU General Public License, and you are.*\[\r\n\]+welcome to change it and/or distribute copies of it under certain conditions.*\[\r\n\]+Type \"show copying\" to see the conditions.*\[\r\n\]+There is absolutely no warranty for GDB.  Type \"show warranty\" for details.*\[\r\n\]+This GDB was configured as .*|GDB is free software and you are welcome to distribute copies of it.*\[\r\n\]+ under certain conditions; type \"show copying\" to see the conditions..*\[\r\n\]+There is absolutely no warranty for GDB; type \"show warranty\" for details..*\[\r\n\]+GDB.*Copyright \[0-9\]* Free Software Foundation, Inc.*" "show version"
 #test show width
 gdb_test "show width" "Number of characters gdb thinks are in a line is.*" "show width"
@@ -677,7 +712,7 @@ gdb_expect {
 #test target exec
 send_gdb "target exec\n"
 gdb_expect {
-       -re "No exec file now..*$gdb_prompt $"\
+       -re "No executable file now..*$gdb_prompt $"\
                        { pass "target exec" }
        -re ".*A program is being debugged already.  Kill it. .y or n.*$" {
            send_gdb "n\n"
@@ -695,8 +730,7 @@ gdb_expect {
 if ![istarget "*-*-udi*"] then {
     send_gdb "target remote\n"
     gdb_expect {
-       -re "To open a remote debug connection, you need to specify what serial.*
-device is attached to the remote system .e.g. /dev/ttya.*$gdb_prompt $"\
+       -re "To open a remote debug connection, you need to specify what.*serial.*device is attached to the remote system.*.e.g. .*$gdb_prompt $"\
                        { pass "target remote" }
        -re ".*A program is being debugged already.  Kill it. .y or n.*$" {
            send_gdb "n\n"
@@ -768,6 +802,16 @@ setup_xfail "a29k-*-udi"
 gdb_test "where" "No stack." "where"
 #test x
 #The case in which it prints a number is for vxgdb.
-gdb_test "x" "0x0:.*0x\[0-9\]*|0x0:.*Cannot access memory at address 0x0." "x"
+send_gdb "x\n"
+gdb_expect {
+    -re "0x0:.*Cannot access memory at address 0x0..*$gdb_prompt $" {
+        pass "x"
+    }
+    -re "0x0:.*Error accessing memory address 0x0:.*$gdb_prompt $" {
+        pass "x"
+    }
+    -re ".*$gdb_prompt $" { fail "x" }
+    timeout { fail "(timeout) x" }
+}
 
 gdb_exit
This page took 0.026287 seconds and 4 git commands to generate.