+Sat Dec 30 12:59:12 1995 Fred Fish <fnf@cygnus.com>
+
+ * lib/gdb.exp (default_gdb_start): Fix typo.
+ * gdb.base/corefile.exp: Allow "Core was generated by ..."
+ messages to not include the full program name that caused
+ the core dump since some systems (such as solaris) apparently
+ truncate this path to about 80 characters.
+ When generating a core file first try increasing the core file
+ size limit to unlimited since some systems may default it to
+ zero, and it is harmless to try it. Move the test for failing
+ to generate a core file to where it will actually get executed.
+ * gdb.c++/templates.exp (test_ptype_of_templates): Accept
+ new gdb result from g++ debug info improvements and make old
+ pattern obsolescent. Also account for size_t differences
+ (may be int or long).
+ * gdb.base/a1-selftest.exp (test_with_self): Check for case where
+ initialization before function call is placed in the delay slot
+ and thus appears to be skipped over by commands such as "next".
+
Fri Dec 29 16:09:20 1995 Stan Shebs <shebs@andros.cygnus.com>
* gdb.base/a1-selftest.exp (test_with_self): Run without windows.
}
}
+ set ttyarg_in_delay_slot 0
set description "step over cdarg initialization"
send "step\n"
expect {
-re "char \[*\]ttyarg = NULL;.*$prompt $" {
pass "$description"
}
+ -re ".*time_at_startup = get_run_time .*$prompt $" {
+ pass "$description"
+ set ttyarg_in_delay_slot 1
+ }
-re ".*No such file or directory.\r\n$prompt $" {
pass "$description (no source available)"
}
}
set description "step over ttyarg initialization"
- send "step\n"
- expect {
- -re ".*time_at_startup = get_run_time .*$prompt $" {
- pass "$description"
- }
- -re ".*No such file or directory.\r\n$prompt $" {
- pass "$description (no source available)"
- }
- -re ".*A file or directory .* does not exist..\r\n$prompt $" {
- pass "$description (no source available)"
- }
- -re ".*$prompt $" {
- fail "$description"
- }
- timeout {
- fail "$description (timeout)"
+ if $ttyarg_in_delay_slot==1 then {
+ pass "$description (in delay slot)"
+ } else {
+ send "step\n"
+ expect {
+ -re ".*time_at_startup = get_run_time .*$prompt $" {
+ pass "$description"
+ }
+ -re ".*No such file or directory.\r\n$prompt $" {
+ pass "$description (no source available)"
+ }
+ -re ".*A file or directory .* does not exist..\r\n$prompt $" {
+ pass "$description (no source available)"
+ }
+ -re ".*$prompt $" {
+ fail "$description"
+ }
+ timeout {
+ fail "$description (timeout)"
+ }
}
}
}
set testfile "coremaker"
-set srcfile ${srcdir}/${subdir}/${testfile}.c
+set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
-if { [compile "${srcfile} -g -o ${binfile}"] != "" } {
+if { [compile "${srcdir}/${subdir}/${srcfile} -g -o ${binfile}"] != "" } {
perror "Couldn't compile ${srcfile}"
return -1
}
# 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}; ${binfile}\""
- # execute_anywhere "./${binfile}"
+ catch "system \"cd ${objdir}/${subdir}; ulimit -c unlimited; ${binfile}\""
+ # 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" ${exec_output} ] {
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
}
}
# grumbles about (said grumbling currently being ignored in gdb_start).
# **FIXME**
#
+# Another problem is that on some systems (solaris for example), there
+# is apparently a limit on the length of a fully specified path to
+# the coremaker executable, at about 80 chars. For this case, consider
+# it a pass, but note that the program name is bad.
gdb_exit
if $verbose>1 then {
set timeout [expr "$timeout + 60"]
eval "spawn $GDB -nw $GDBFLAGS -core=$objdir/$subdir/corefile"
expect {
- -re "Core was generated by .*coremaker.*\r
-\#0 .*\(\).*\r
-$prompt $" { pass "args: -core=corefile" }
- -re ".*$prompt $" { fail "args: -core=corefile" }
- timeout { fail "(timeout) starting with -core" }
+ -re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$prompt $" {
+ pass "args: -core=corefile"
+ }
+ -re "Core was generated by .*\r\n\#0 .*\(\).*\r\n$prompt $" {
+ pass "args: -core=corefile (with bad program name)"
+ }
+ -re ".*$prompt $" { fail "args: -core=corefile" }
+ timeout { fail "(timeout) starting with -core" }
}
gdb_exit
if $verbose>1 then {
- send_user "Spawning $GDB -nw $GDBFLAGS $objdir/$subdir/$binfile -core=$objdir/$subdir/corefile\n"
+ send_user "Spawning $GDB -nw $GDBFLAGS $binfile -core=$objdir/$subdir/corefile\n"
}
-spawn $GDB -nw $GDBFLAGS $objdir/$subdir/$binfile -core=$objdir/$subdir/corefile
+spawn $GDB -nw $GDBFLAGS $binfile -core=$objdir/$subdir/corefile
expect {
- -re "Core was generated by .*coremaker.*\r
-\#0 .*\(\).*\r
-$prompt $" { pass "args: execfile -core=corefile" }
- -re ".*$prompt $" { fail "args: execfile -core=corefile" }
- timeout { fail "(timeout) starting with -core" }
+ -re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$prompt $" {
+ pass "args: execfile -core=corefile"
+ }
+ -re "Core was generated by .*\r\n\#0 .*\(\).*\r\n$prompt $" {
+ pass "args: execfile -core=corefile (with bad program name)"
+ }
+ -re ".*$prompt $" { fail "args: execfile -core=corefile" }
+ timeout { fail "(timeout) starting with -core" }
}
set timeout $oldtimeout
send "core-file $objdir/$subdir/corefile\n"
expect {
- -re "Core was generated by .*coremaker.*\r
-\#0 .*\(\).*\r
-$prompt $" { pass "core-file command" }
- -re ".*$prompt $" { fail "core-file command" }
- timeout { fail "(timeout) core-file command" }
+ -re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$prompt $" {
+ pass "core-file command"
+ }
+ -re "Core was generated by .*\r\n\#0 .*\(\).*\r\n$prompt $" {
+ pass "core-file command (with bad program name)"
+ }
+ -re ".*$prompt $" { fail "core-file command" }
+ timeout { fail "(timeout) core-file command" }
}
# Test correct mapping of corefile sections by printing some variables.