aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1996-03-20 07:52:01 +0000
committerFred Fish <fnf@specifix.com>1996-03-20 07:52:01 +0000
commit8ce1c210f199360c4298889de19b4f28db6ba096 (patch)
tree134cfc2cb99457e244147e3233cb4a3d2d0e6ef4 /gdb
parenta9424716eaef1fc9e97439758a0812a83d5ea43f (diff)
downloadgdb-8ce1c210f199360c4298889de19b4f28db6ba096.zip
gdb-8ce1c210f199360c4298889de19b4f28db6ba096.tar.gz
gdb-8ce1c210f199360c4298889de19b4f28db6ba096.tar.bz2
* 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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog8
-rw-r--r--gdb/testsuite/gdb.base/corefile.exp79
2 files changed, 52 insertions, 35 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 86c6619..7b54cb7 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -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>
diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp
index 48993a9..c81537d 100644
--- a/gdb/testsuite/gdb.base/corefile.exp
+++ b/gdb/testsuite/gdb.base/corefile.exp
@@ -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