import gdb-1999-12-21 snapshot
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / default.exp
index 9f7384e58c4d2c7960331f8027f3497b8d551efb..9395ed983768d7de891a65ea0c64d3ad81af65b3 100644 (file)
@@ -1,9 +1,29 @@
+#   Copyright (C) 1988, 1990, 1991, 1992, 1994, 1997, 1998
+#   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
 gdb_start
 
-match_max 8000
+set timeout 60
 
 #
 # test default actions of gdb commands
@@ -15,11 +35,13 @@ gdb_test "add-symbol-file" "add-symbol-file takes a file name and an address" "a
 
 setup_xfail "mips-idt-*"
 send_gdb "attach\n"
-expect {
+gdb_expect {
     -re "Argument required .(process-id|program) to attach.*$gdb_prompt $"\
                        { 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 +67,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 +99,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"
@@ -99,10 +126,10 @@ gdb_test "delete breakpoints" "" "delete breakpoints"
 #test delete display
 # FIXME -- need to dump full output to detailed log
 send_gdb "delete display\n"
-expect {
+gdb_expect {
     -re "Delete all auto-display expressions.*y or n. $" {
        send_gdb "y\n"
-       expect {
+       gdb_expect {
            -re "$gdb_prompt $"     { pass "delete display prompt" }
            timeout             { fail "(timeout) delete display prompt" }
        }
@@ -128,10 +155,10 @@ if [istarget "h8300-*-hms"] then {
 # FIXME -- need to dump full output to detailed log
 
 send_gdb "directory\n"
-expect {
+gdb_expect {
     -re "Reinitialize source path to empty.*y or n. $"  {
        send_gdb "y\n"
-       expect {
+       gdb_expect {
            -re "Source directories searched: .cdir:.cwd.*$gdb_prompt $"\
                    { pass "directory prompt" }
            timeout             { fail "(timeout) directory prompt" }
@@ -179,8 +206,8 @@ gdb_test "enable once" "Argument required .one or more breakpoint numbers.*" "en
 gdb_test "enable" "" "enable"
 #test exec-file
 send_gdb "exec-file\n"
-expect {
-    -re "No exec file now..*$gdb_prompt $" {
+gdb_expect {
+    -re "No executable file now..*$gdb_prompt $" {
        pass "exec-file"
     }
     -re "exec-file.*A program is being debugged already.  Kill it. .y or n.*$" {
@@ -188,7 +215,7 @@ expect {
        if $verbose>1 then {
            send_user "\tDidn't kill program being debugged\n"
        }
-       expect -re "$gdb_prompt $" { }
+       gdb_expect -re "$gdb_prompt $" { }
        pass "exec-file"
     }
     -re "$gdb_prompt $"        { fail "exec-file" }
@@ -207,15 +234,15 @@ gdb_test "fg" "The program is not being run." "fg"
 # FIXME: fg kills the udi connection
 #test file
 send_gdb "file\n"
-expect {
-    -re "No exec file now..*$gdb_prompt $"\
+gdb_expect {
+    -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"
        if $verbose>1 then {
            send_user "\t\tDidn't kill program being debugged\n"
        }
-       expect -re "$gdb_prompt $" { }
+       gdb_expect -re "$gdb_prompt $" { }
        pass "file"
     }
     -re ".*$gdb_prompt $"      { fail "file" }
@@ -230,9 +257,9 @@ gdb_test "finish" "The program is not running." "finish"
 # vary on different systems.
 gdb_test "forward-search" "No previous regular expression.*|There is no previous regular expression.*" "forward-search"
 #test help "h" abbreviation
-gdb_test "h" "List of classes of commands:.*\[\r\n\]+running -- Running the program.*\[\r\n\]+stack -- Examining the stack.*\[\r\n\]+data -- Examining data.*\[\r\n\]+breakpoints -- Making program stop at certain points.*\[\r\n\]+files -- Specifying and examining files.*\[\r\n\]+status -- Status inquiries.*\[\r\n\]+support -- Support facilities.*\[\r\n\]+user-defined -- User-defined commands.*\[\r\n\]+aliases -- Aliases of other commands.*\[\r\n\]+obscure -- Obscure features.*\[\r\n\]+Type \"help\" followed by a class name for a list of commands in that class..*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help \"h\" abbreviation"
+gdb_test "h" "List of classes of commands:.*\[\r\n\]+aliases -- Aliases of other commands.*\[\r\n\]+breakpoints -- Making program stop at certain points.*\[\r\n\]+data -- Examining data.*\[\r\n\]+files -- Specifying and examining files.*\[\r\n\]+obscure -- Obscure features.*\[\r\n\]+running -- Running the program.*\[\r\n\]+stack -- Examining the stack.*\[\r\n\]+status -- Status inquiries.*\[\r\n\]+support -- Support facilities.*\[\r\n\]+user-defined -- User-defined commands.*\[\r\n\]+Type \"help\" followed by a class name for a list of commands in that class..*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help \"h\" abbreviation"
 #test help
-gdb_test "help" "List of classes of commands:.*\[\r\n\]+running -- Running the program.*\[\r\n\]+stack -- Examining the stack.*\[\r\n\]+data -- Examining data.*\[\r\n\]+breakpoints -- Making program stop at certain points.*\[\r\n\]+files -- Specifying and examining files.*\[\r\n\]+status -- Status inquiries.*\[\r\n\]+support -- Support facilities.*\[\r\n\]+user-defined -- User-defined commands.*\[\r\n\]+aliases -- Aliases of other commands.*\[\r\n\]+obscure -- Obscure features.*\[\r\n\]+Type \"help\" followed by a class name for a list of commands in that class..*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help"
+gdb_test "help" "List of classes of commands:.*\[\r\n\]+aliases -- Aliases of other commands.*\[\r\n\]+breakpoints -- Making program stop at certain points.*\[\r\n\]+data -- Examining data.*\[\r\n\]+files -- Specifying and examining files.*\[\r\n\]+obscure -- Obscure features.*\[\r\n\]+running -- Running the program.*\[\r\n\]+stack -- Examining the stack.*\[\r\n\]+status -- Status inquiries.*\[\r\n\]+support -- Support facilities.*\[\r\n\]+user-defined -- User-defined commands.*\[\r\n\]+Type \"help\" followed by a class name for a list of commands in that class..*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help"
 #test handle
 gdb_test "handle" "Argument required .signal to handle.*" "handle"
 #test info "i" abbreviation 
@@ -253,7 +280,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,7 +298,17 @@ gdb_test "info frame" "No stack.|No selected frame." "info frame"
 #test info files
 gdb_test "info files" "" "info files"
 #test info float
-gdb_test "info float" "No floating point info available for this processor." "info float"
+if [istarget "arm*-*-*"] then {
+    gdb_test "info float" "Software FPU type.*mask:.*flags:.*" "info float"
+} 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"
+}
 #test info functions
 gdb_test "info functions" "All defined functions:" "info functions"
 #test info locals
@@ -291,6 +328,7 @@ gdb_test "info stack" "No stack." "info stack"
 #test info set
 # FIXME -- needs to match the entire output
 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
 gdb_test  "info source" "No current source file..*" "info source"
 #test info sources
@@ -304,6 +342,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"
@@ -337,6 +376,21 @@ setup_xfail "a29k-*-udi"
 gdb_test "nexti" "The program is not being run." "nexti"
 #test output
 gdb_test "output" "Argument required .expression to compute.*" "output"
+
+#test overlay
+gdb_test "overlay" "\"overlay\" must be followed by the name of .*"
+#test a non-existant overlay subcommand
+gdb_test "overlay on"     "Undefined overlay command.* Try \"help overlay\"."
+gdb_test "overlay manual" "" "overlay manual #1"
+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 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"
+
 #test print "p" abbreviation
 gdb_test "p" "The history is empty." "print \"p\" abbreviation"
 #test print
@@ -359,7 +413,7 @@ You must specify a function name to run, and arguments if any"\
 
 } else {
     send_gdb "r\n"
-    expect {
+    gdb_expect {
            -re "Starting program:  .*
 You can't do that when your target is `None'.*$gdb_prompt $"\
                        { pass "run \"r\" abbreviation" }
@@ -390,7 +444,7 @@ You must specify a function name to run, and arguments if any"
 
 } else {
     send_gdb "run\n"
-    expect {
+    gdb_expect {
            -re "Starting program:.*You can't do that when your target is `None'.*$gdb_prompt $" { pass "run" }
            -re "Starting program:  .*
 No executable file specified.*
@@ -422,10 +476,10 @@ gdb_test "return" "No selected frame..*" "return"  "Make .* return now.*y or n.
 gdb_test "reverse-search" "No previous regular expression.*|There is no previous regular expression.*" "reverse-search"
 #test step "s" abbreviation
 setup_xfail "a29k-*-udi"
-gdb_test "s" "The program is not being run." "step \"s\" abbreviation"
+gdb_test "s" "The program is not being run." "step \"s\" abbreviation #1"
 #test step
 setup_xfail "a29k-*-udi"
-gdb_test "step" "The program is not being run." "step"
+gdb_test "step" "The program is not being run." "step #1"
 #test search
 gdb_test "search" "No previous regular expression.*|There is no previous regular expression.*" "search"
 #test section
@@ -465,7 +519,7 @@ gdb_test "set history save" "" "set history save"
 #test set history size
 gdb_test "set history size" "Argument required .integer to set it to.*" "set history size"
 #test set history
-gdb_test "set history" "\"set history\" must be followed by the name of a history subcommand..*\[\r\n\]+List of set history subcommands:.*\[\r\n\]+set history filename -- Set the filename in which to record the command history.*\[\r\n\]+set history size -- Set the size of the command history.*\[\r\n\]+set history save -- Set saving of the history record on exit.*\[\r\n\]+set history expansion -- Set history expansion on command input.*\[\r\n\]+Type \"help set history\" followed by set history subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "set history"
+gdb_test "set history" "\"set history\" must be followed by the name of a history subcommand..*\[\r\n\]+List of set history subcommands:.*\[\r\n\]+set history expansion -- Set history expansion on command input.*\[\r\n\]+set history filename -- Set the filename in which to record the command history.*\[\r\n\]+set history save -- Set saving of the history record on exit.*\[\r\n\]+set history size -- Set the size of the command history.*\[\r\n\]+Type \"help set history\" followed by set history subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "set history"
 #test set language
 gdb_test "set language" "The currently understood settings are:.*\[\r\n\]+local or auto  *Automatic setting based on source file.*\[\r\n\]+c  *Use the C language.*\[\r\n\]+c\[+\]+  *Use the C\[+\]+ language.*\[\r\n\]+modula-2  *Use the Modula-2 language.*" "set language"
 #test set listsize
@@ -517,7 +571,7 @@ gdb_test "shell echo Hi dad!" "Hi dad!" "shell echo Hi dad!"
 #test show annotate
 gdb_test "show annotate" "Annotation_level is 0."       "show annotate"
 #test show args
-gdb_test "show args" "Arguments to give program being debugged when it is started is \"\"." "show args"
+gdb_test "show args" "Argument list to give program being debugged when it is started is \"\"." "show args"
 #test show check "c" abbreviation
 gdb_test "show c" "range:  *Range checking is \"auto; currently off\"..*\[\r\n\]+type:  *Type checking is \"auto; currently off\".*" "show check \"c\" abbreviation"
 #test show check "ch" abbreviation
@@ -551,7 +605,7 @@ gdb_test "show history save" "Saving of the history record on exit is on." "show
 #test show history size
 gdb_test "show history size" "The size of the command history is.*" "show history size"
 #test show history
-gdb_test "show history" "filename:  *The filename in which to record the command history is.*.gdb_history.*\[\r\n\]+size: * The size of the command history is.*\[\r\n\]+save: *Saving of the history record on exit is o.*\[\r\n\]+expansion:  *History expansion on command input is o.*" "show history"
+gdb_test "show history" "expansion:  *History expansion on command input is o.*\[\r\n\]+filename:  *The filename in which to record the command history is.*.gdb_history.*\[\r\n\]+save: *Saving of the history record on exit is o.*\[\r\n\]+size: * The size of the command history is.*" "show history"
 #test show language
 gdb_test "show language" "The current source language is \"auto; currently c\"." "show language"
 #test show listsize
@@ -600,7 +654,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"
@@ -608,7 +662,7 @@ gdb_test "show width" "Number of characters gdb thinks are in a line is.*" "show
 # This is only supported on targets which use exec.o.
 gdb_test "show write" "Writing into executable and core files is o.*" "show write"
 #test show
-gdb_test "show" "confirm:  *Whether to confirm potentially dangerous operations is on..*\[\r\n\]+history filename:  *The filename in which to record the command history is .*\[\r\n\]+history size:  *The size of the command history is.*\[\r\n\]+history save:  *Saving of the history record on exit is on..*\[\r\n\]+print elements:  *Limit on string chars or array elements to print is 200..*\[\r\n\]+listsize:  *Number of source lines gdb will list by default is 10.*" "show"
+gdb_test "show" "confirm:  *Whether to confirm potentially dangerous operations is on..*\[\r\n\]+history filename:  *The filename in which to record the command history is .*\[\r\n\]+history save:  *Saving of the history record on exit is on..*\[\r\n\]+history size:  *The size of the command history is.*\[\r\n\]+listsize:  *Number of source lines gdb will list by default is 10.*\[\r\n\]+print elements:  *Limit on string chars or array elements to print is 200..*" "show"
 #test stepi "si" abbreviation
 setup_xfail "a29k-*-udi"
 gdb_test  "si" "The program is not being run." "stepi \"si\" abbreviation"
@@ -622,10 +676,10 @@ gdb_test "signal" "The program is not being run." "signal"
 gdb_test "source" "source command requires pathname of file to source..*|No such file or directory.*" "source"
 #test step "s" abbreviation
 setup_xfail "a29k-*-udi"
-gdb_test "s" "The program is not being run." "step \"s\" abbreviation"
+gdb_test "s" "The program is not being run." "step \"s\" abbreviation #2"
 #test step
 setup_xfail "a29k-*-udi"
-gdb_test "step" "The program is not being run." "step"
+gdb_test "step" "The program is not being run." "step #2"
 #test symbol-file
 gdb_test "symbol-file" "" "symbol-file"
 
@@ -637,14 +691,14 @@ gdb_test "target procfs" "Use the \"run\" command to start a Unix child process.
 
 #test target core
 send_gdb "target core\n"
-expect {
+gdb_expect {
     -re "No core file specified..*$gdb_prompt $" { pass "target core" }
     -re ".*A program is being debugged already.  Kill it. .y or n.*$" {
        send_gdb "n\n"
        if $verbose>1 then {
            send_user "\t\tDidn't kill program being debugged\n"
        }
-       expect -re "$gdb_prompt $" { }
+       gdb_expect -re "$gdb_prompt $" { }
        pass "target core"
     }
     -re "Undefined target command: \"core\".  Try \"help target\"..*$gdb_prompt $" { pass "target core" }
@@ -654,15 +708,15 @@ expect {
 
 #test target exec
 send_gdb "target exec\n"
-expect {
-       -re "No exec file now..*$gdb_prompt $"\
+gdb_expect {
+       -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"
            if $verbose>1 then {
                send_user "\t\tDidn't kill program being debugged\n"
            }
-           expect -re "$gdb_prompt $" { }
+           gdb_expect -re "$gdb_prompt $" { }
            pass "target exec"
        }
        -re ".*$gdb_prompt $"   { fail "target exec" }
@@ -672,16 +726,15 @@ expect {
 #test target remote
 if ![istarget "*-*-udi*"] then {
     send_gdb "target remote\n"
-    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 $"\
+    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 $"\
                        { pass "target remote" }
        -re ".*A program is being debugged already.  Kill it. .y or n.*$" {
            send_gdb "n\n"
            if $verbose>1 then {
                send_user "\t\tDidn't kill program being debugged\n"
            }
-           expect -re "$gdb_prompt $" { }
+           gdb_expect -re "$gdb_prompt $" { }
            pass "target remote"
        }
        -re ".*$gdb_prompt $"   { fail "target remote" }
@@ -704,10 +757,10 @@ gdb_test "until" "The program is not running." "until"
 #test undisplay
 # FIXME -- need to dump full output to detailed log
 send_gdb "undisplay\n"
-expect {
+gdb_expect {
     -re "Delete all auto-display expressions.*y or n. $" {
        send_gdb "y\n"
-       expect {
+       gdb_expect {
            -re "$gdb_prompt $" { pass "undisplay prompt" }
            timeout { fail "(timeout) (timeout) undisplay prompt"    }
        }
@@ -717,10 +770,10 @@ expect {
 
 #test unset environment
 send_gdb "unset environment\n"
-expect {
+gdb_expect {
     -re "Delete all environment variables?.*y or n. $" { 
        send_gdb "y\n"
-       expect {
+       gdb_expect {
            -re "$gdb_prompt $" { pass "unset environmentprompt" }
            timeout {
                fail "(timeout) (timeout) unset environment prompt"
@@ -746,6 +799,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.030965 seconds and 4 git commands to generate.