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} ] {
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
}
}
-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" }
}
-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" }
}
-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" }
}
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