* gdb.base/corefile.exp: Always regenerate the core file, since
authorFred Fish <fnf@specifix.com>
Wed, 20 Mar 1996 07:52:01 +0000 (07:52 +0000)
committerFred Fish <fnf@specifix.com>
Wed, 20 Mar 1996 07:52:01 +0000 (07:52 +0000)
we always regenerate the coremaker program.  Detect special case
where registers cannot be read from core file.  Change setup_xfail
for "print func2:coremaker_local" and "backtrace in corefile.exp"
to fail for all i*86 targets.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/corefile.exp

index 86c6619d453b53485b0ab951c9e74972654a9355..7b54cb7cda76cb230fab851aa1af8d746848b043 100644 (file)
@@ -1,3 +1,11 @@
+Tue Mar 19 23:49:31 1996  Fred Fish  <fnf@cygnus.com>
+
+       * gdb.base/corefile.exp: Always regenerate the core file, since
+       we always regenerate the coremaker program.  Detect special case
+       where registers cannot be read from core file.  Change setup_xfail
+       for "print func2:coremaker_local" and "backtrace in corefile.exp"
+       to fail for all i*86 targets.
+       
 Tue Mar 19 16:52:49 1996  Fred Fish  <fnf@cygnus.com>
 
        From Peter Schauer <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE>
index 48993a9718a9487064ec5b0aeb09e32394ed0c83..c81537de37b81bca096c9669845ab623abf50490 100644 (file)
@@ -45,20 +45,33 @@ if  { [compile "-E ${srcdir}/${subdir}/compiler.c > ${binfile}.ci"] != "" } {
     return -1
 }
 
-if ![file exists ${objdir}/${subdir}/corefile] then {
-    # Create a core file named "corefile" rather than just "core", to
-    # avoid problems with sys admin types that like to regularly prune all
-    # files named "core" from the system.
-    #
-    # Arbitrarily try setting the core size limit to "unlimited" since
-    # this does not hurt on systems where the command does not work and
-    # allows us to generate a core on systems where it does.
-    #
-    # Some systems append "core" to the name of the program; others append
-    # the name of the program to "core".
-    set found 0
-    catch "system \"(cd ${objdir}/${subdir}; ulimit -c unlimited; ${binfile}; true) >/dev/null 2>&1\""
-    #    execute_anywhere "${binfile}"
+# Create a core file named "corefile" rather than just "core", to
+# avoid problems with sys admin types that like to regularly prune all
+# files named "core" from the system.
+#
+# Arbitrarily try setting the core size limit to "unlimited" since
+# this does not hurt on systems where the command does not work and
+# allows us to generate a core on systems where it does.
+#
+# Some systems append "core" to the name of the program; others append
+# the name of the program to "core".
+set found 0
+catch "system \"(cd ${objdir}/${subdir}; ulimit -c unlimited; ${binfile}; true) >/dev/null 2>&1\""
+#    execute_anywhere "${binfile}"
+foreach i "${objdir}/${subdir}/core ${objdir}/${subdir}/core.coremaker.c ${binfile}.core" {
+    set exec_output [execute_anywhere "ls $i"]
+    if [ regexp "No such file or directory|not found" ${exec_output} ] {
+       continue
+    } else {
+       execute_anywhere "mv $i ${objdir}/${subdir}/corefile"
+       set found 1
+    }
+}
+if { $found == 0 } {
+    # The braindamaged HPUX shell quits after the ulimit -c above
+    # without executing ${binfile}.  So we try again without the
+    # ulimit here if we didn't fine a core file above.
+    catch "system \"(cd ${objdir}/${subdir}; ${binfile}; true) >/dev/null 2>&1\""
     foreach i "${objdir}/${subdir}/core ${objdir}/${subdir}/core.coremaker.c ${binfile}.core" {
        set exec_output [execute_anywhere "ls $i"]
        if [ regexp "No such file or directory|not found" ${exec_output} ] {
@@ -68,25 +81,10 @@ if ![file exists ${objdir}/${subdir}/corefile] then {
            set found 1
        }
     }
-    if { $found == 0 } {
-       # The braindamaged HPUX shell quits after the ulimit -c above
-       # without executing ${binfile}.  So we try again without the
-       # ulimit here if we didn't fine a core file above.
-       catch "system \"(cd ${objdir}/${subdir}; ${binfile}; true) >/dev/null 2>&1\""
-       foreach i "${objdir}/${subdir}/core ${objdir}/${subdir}/core.coremaker.c ${binfile}.core" {
-           set exec_output [execute_anywhere "ls $i"]
-           if [ regexp "No such file or directory|not found" ${exec_output} ] {
-               continue
-           } else {
-               execute_anywhere "mv $i ${objdir}/${subdir}/corefile"
-               set found 1
-           }
-       }
-
-       if { $found == 0  } {
-           warning "can't generate a core file - core tests suppressed - check ulimit -c"
-           return 0
-       }
+    
+    if { $found == 0  } {
+       warning "can't generate a core file - core tests suppressed - check ulimit -c"
+       return 0
     }
 }
 
@@ -121,6 +119,9 @@ expect {
     -re "Core was generated by .*\r\n\#0  .*\(\).*\r\n$prompt $" {
        pass "args: -core=corefile (with bad program name)"
     }
+    -re ".*registers from core file: File in wrong format.* $" {
+       fail "args: -core=corefile (could not read registers from core file)"
+    }
     -re ".*$prompt $"  { fail "args: -core=corefile" }
     timeout            { fail "(timeout) starting with -core" }
 }
@@ -145,6 +146,9 @@ expect {
     -re "Core was generated by .*\r\n\#0  .*\(\).*\r\n$prompt $"        {
        pass "args: execfile -core=corefile (with bad program name)"
     }
+    -re ".*registers from core file: File in wrong format.* $" {
+       fail "args: execfile -core=corefile (could not read registers from core file)"
+    }
     -re ".*$prompt $"  { fail "args: execfile -core=corefile" }
     timeout            { fail "(timeout) starting with -core" }
 }
@@ -170,6 +174,9 @@ expect {
     -re "Core was generated by .*\r\n\#0  .*\(\).*\r\n$prompt $" {
        pass "core-file command (with bad program name)"
     }
+    -re ".*registers from core file: File in wrong format.* $" {
+       fail "core-file command (could not read registers from core file)"
+    }
     -re ".*$prompt $"  { fail "core-file command" }
     timeout            { fail "(timeout) core-file command" }
 }
@@ -180,14 +187,16 @@ gdb_test "print coremaker_data" "\\\$$decimal = 202"
 gdb_test "print coremaker_bss" "\\\$$decimal = 10"
 gdb_test "print coremaker_ro" "\\\$$decimal = 201"
 
-setup_xfail "i*86-*-sysv4*"
+# This fails under at least Unixware (i*86-*-sysv4*) and linux.
+setup_xfail "i*86-*-*"
 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.
 
 # Haven't investigated this xfail
-setup_xfail "m68k-*-hpux*" "i*86-*-sysv4*"
+# This fails under at least Unixware (i*86-*-sysv4*) and linux.
+setup_xfail "m68k-*-hpux*" "i*86-*-*"
 gdb_test "bt" "abort.*func2.*func1.*main.*" "backtrace in corefile.exp"
 
 # test reinit_frame_cache
This page took 0.045429 seconds and 4 git commands to generate.