]> 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 b2677306dd5edbe13aa419621d5260466a19f902..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,13 +192,13 @@ 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.
 
 gdb_test "bt" "abort.*func2.*func1.*main.*" "backtrace in corefile.exp"
-gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(\\).*" "up in corefile.exp"
+gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp"
 
 # Test ability to read mmap'd data
 
@@ -217,8 +226,7 @@ gdb_expect {
 # test reinit_frame_cache
 
 gdb_load ${binfile}
-# HP defect CLLbs17002
-setup_xfail "*-*-*"
+setup_xfail "*-*-*" CLLbs17002
 gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(\\)" "up in corefile.exp (reinit)"
 
 gdb_test "core" "No core file now."