]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.base/corefile.exp
This commit was manufactured by cvs2svn to create branch
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / corefile.exp
index f998f88665980a7f747fc5bff76a99320566d7bc..e25c03c2ea6220d50460c130cf0e091f2edb1f53 100644 (file)
@@ -1,4 +1,5 @@
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# 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
@@ -109,6 +110,9 @@ set timeout [expr "$timeout + 60"]
 verbose "Timeout is now $timeout seconds" 2
 eval "spawn $GDB -nw $GDBFLAGS -core=$objdir/$subdir/corefile"
 expect {
+    -re "Couldn't find .* registers in core file.*$gdb_prompt $" {
+        fail "args: -core=corefile (couldn't find regs)"
+    }
     -re "Core was generated by .*coremaker.*\r\n\#0  .*\(\).*\r\n$gdb_prompt $" {
        pass "args: -core=corefile"
     }
@@ -164,6 +168,11 @@ gdb_load ${binfile}
 
 send_gdb "core-file $objdir/$subdir/corefile\n"
 gdb_expect {
+    -re ".* program is being debugged already.*y or n. $" {
+       # gdb_load may connect us to a gdbserver.
+       send_gdb "y\n"
+       exp_continue;
+    }
     -re "Core was generated by .*coremaker.*\r\n\#0  .*\(\).*\r\n$gdb_prompt $" {
        pass "core-file command"
     }
@@ -183,7 +192,7 @@ gdb_test "print coremaker_data" "\\\$$decimal = 202"
 gdb_test "print coremaker_bss" "\\\$$decimal = 10"
 gdb_test "print coremaker_ro" "\\\$$decimal = 201"
 
-gdb_test "print func2::coremaker_local" "\\\$$decimal = {0, 1, 2, 3, 4}"
+gdb_test "print func2::coremaker_local" "\\\$$decimal = \\{0, 1, 2, 3, 4\\}"
 
 # Somehow we better test the ability to read the registers out of the core
 # file correctly.  I don't think the other tests do this.