1995-01-06 01:37:18 +00:00
|
|
|
# Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
1994-07-18 19:25:50 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
1995-08-07 07:20:02 +00:00
|
|
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
1994-07-18 19:25:50 +00:00
|
|
|
|
|
|
|
# Please email any bugs, comments, and/or additions to this file to:
|
|
|
|
# bug-gdb@prep.ai.mit.edu
|
|
|
|
|
|
|
|
# This file was written by Fred Fish. (fnf@cygnus.com)
|
|
|
|
|
|
|
|
if $tracelevel then {
|
|
|
|
strace $tracelevel
|
|
|
|
}
|
|
|
|
|
|
|
|
set prms_id 0
|
|
|
|
set bug_id 0
|
|
|
|
|
|
|
|
# are we on a target board
|
|
|
|
if ![isnative] then {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
From Rob Savoye (rob@poseidon.cygnus.com)
* Makefile.in, configure.in, gdb.base/{Makefile.in, configure.in},
gdb.c++/{Makefile.in, configure.in}, gdb.chill/{Makefile.in, configure.in},
gdb.disasm/{Makefile.in, configure.in}, gdb.stabs/{Makefile.in, configure.in},
gdb.threads/{Makefile.in, configure.in}: Major reworking for autoconfig.
* aclocal.m4, configure, gdb.base/configure, gdb.c++/configure,
gdb.disasm/configure, gdb.stabs/configure, gdb.stabs/default.mt : New files.
* config/unix-gdb.exp: Make GDB global.
* gdb.base/{a1-selftest.exp, a2-run.exp,bitfields.exp, break.exp, callfuncs.exp,
commands.exp, corefile.exp, crossload.exp, exprs.exp, funcargs.exp, interrupt.exp,
langs.exp, list.exp, mips_pro.exp, nodebug.exp, opaque.exp, printcmds.exp,
ptype.exp, recurse.exp, regs.exp, return.exp, scope.exp, setvar.exp, sigall.exp,
signals.exp, term.exp, twice.exp, watchpoint.exp, whatis.exp},
gdb.c++/{classes.exp, callfuncs.exp, inherit.exp, misc.exp, templates.exp,
virtfunc.exp}, gdb.chill/{callch.exp, chillvars.exp, misc.exp, pr-4975.exp,
pr-5016.exp, pr-5020.exp, pr-5022.exp, pr-5646.exp, pr-5984.exp, pr-6292.exp,
pr-6632.exp, pr-8134.exp, pr-8136.exp, result.exp, string.exp, tuples.exp},
gdb.disasm/{hppa.exp, sh3.exp}, gdb.stabs/weird.exp: Change continues
to returns as necessary, arrange for test to compile own testcase executable.
* lib/gdb.exp: Changes for testsuite to compile own test cases.
From Fred Fish (fnf@cygnus.com)
* gdb.c++/classes.exp (test_pointers_to_class_members): Add
clear_xfail at end of test which might not call either pass or fail.
* gdb.base/a1-selftest.exp: Add i*86-*-linuxaout xfail for
"backtrace through signal handler".
1995-11-25 19:55:29 +00:00
|
|
|
set testfile "coremaker"
|
1995-12-30 22:27:24 +00:00
|
|
|
set srcfile ${testfile}.c
|
From Rob Savoye (rob@poseidon.cygnus.com)
* Makefile.in, configure.in, gdb.base/{Makefile.in, configure.in},
gdb.c++/{Makefile.in, configure.in}, gdb.chill/{Makefile.in, configure.in},
gdb.disasm/{Makefile.in, configure.in}, gdb.stabs/{Makefile.in, configure.in},
gdb.threads/{Makefile.in, configure.in}: Major reworking for autoconfig.
* aclocal.m4, configure, gdb.base/configure, gdb.c++/configure,
gdb.disasm/configure, gdb.stabs/configure, gdb.stabs/default.mt : New files.
* config/unix-gdb.exp: Make GDB global.
* gdb.base/{a1-selftest.exp, a2-run.exp,bitfields.exp, break.exp, callfuncs.exp,
commands.exp, corefile.exp, crossload.exp, exprs.exp, funcargs.exp, interrupt.exp,
langs.exp, list.exp, mips_pro.exp, nodebug.exp, opaque.exp, printcmds.exp,
ptype.exp, recurse.exp, regs.exp, return.exp, scope.exp, setvar.exp, sigall.exp,
signals.exp, term.exp, twice.exp, watchpoint.exp, whatis.exp},
gdb.c++/{classes.exp, callfuncs.exp, inherit.exp, misc.exp, templates.exp,
virtfunc.exp}, gdb.chill/{callch.exp, chillvars.exp, misc.exp, pr-4975.exp,
pr-5016.exp, pr-5020.exp, pr-5022.exp, pr-5646.exp, pr-5984.exp, pr-6292.exp,
pr-6632.exp, pr-8134.exp, pr-8136.exp, result.exp, string.exp, tuples.exp},
gdb.disasm/{hppa.exp, sh3.exp}, gdb.stabs/weird.exp: Change continues
to returns as necessary, arrange for test to compile own testcase executable.
* lib/gdb.exp: Changes for testsuite to compile own test cases.
From Fred Fish (fnf@cygnus.com)
* gdb.c++/classes.exp (test_pointers_to_class_members): Add
clear_xfail at end of test which might not call either pass or fail.
* gdb.base/a1-selftest.exp: Add i*86-*-linuxaout xfail for
"backtrace through signal handler".
1995-11-25 19:55:29 +00:00
|
|
|
set binfile ${objdir}/${subdir}/${testfile}
|
1995-12-30 22:27:24 +00:00
|
|
|
if { [compile "${srcdir}/${subdir}/${srcfile} -g -o ${binfile}"] != "" } {
|
From Rob Savoye (rob@poseidon.cygnus.com)
* Makefile.in, configure.in, gdb.base/{Makefile.in, configure.in},
gdb.c++/{Makefile.in, configure.in}, gdb.chill/{Makefile.in, configure.in},
gdb.disasm/{Makefile.in, configure.in}, gdb.stabs/{Makefile.in, configure.in},
gdb.threads/{Makefile.in, configure.in}: Major reworking for autoconfig.
* aclocal.m4, configure, gdb.base/configure, gdb.c++/configure,
gdb.disasm/configure, gdb.stabs/configure, gdb.stabs/default.mt : New files.
* config/unix-gdb.exp: Make GDB global.
* gdb.base/{a1-selftest.exp, a2-run.exp,bitfields.exp, break.exp, callfuncs.exp,
commands.exp, corefile.exp, crossload.exp, exprs.exp, funcargs.exp, interrupt.exp,
langs.exp, list.exp, mips_pro.exp, nodebug.exp, opaque.exp, printcmds.exp,
ptype.exp, recurse.exp, regs.exp, return.exp, scope.exp, setvar.exp, sigall.exp,
signals.exp, term.exp, twice.exp, watchpoint.exp, whatis.exp},
gdb.c++/{classes.exp, callfuncs.exp, inherit.exp, misc.exp, templates.exp,
virtfunc.exp}, gdb.chill/{callch.exp, chillvars.exp, misc.exp, pr-4975.exp,
pr-5016.exp, pr-5020.exp, pr-5022.exp, pr-5646.exp, pr-5984.exp, pr-6292.exp,
pr-6632.exp, pr-8134.exp, pr-8136.exp, result.exp, string.exp, tuples.exp},
gdb.disasm/{hppa.exp, sh3.exp}, gdb.stabs/weird.exp: Change continues
to returns as necessary, arrange for test to compile own testcase executable.
* lib/gdb.exp: Changes for testsuite to compile own test cases.
From Fred Fish (fnf@cygnus.com)
* gdb.c++/classes.exp (test_pointers_to_class_members): Add
clear_xfail at end of test which might not call either pass or fail.
* gdb.base/a1-selftest.exp: Add i*86-*-linuxaout xfail for
"backtrace through signal handler".
1995-11-25 19:55:29 +00:00
|
|
|
perror "Couldn't compile ${srcfile}"
|
|
|
|
return -1
|
|
|
|
}
|
1994-07-18 19:25:50 +00:00
|
|
|
|
1996-11-01 20:00:26 +00:00
|
|
|
# Create and source the file that provides information about the compiler
|
|
|
|
# used to compile the test case.
|
From Rob Savoye (rob@poseidon.cygnus.com)
* Makefile.in, configure.in, gdb.base/{Makefile.in, configure.in},
gdb.c++/{Makefile.in, configure.in}, gdb.chill/{Makefile.in, configure.in},
gdb.disasm/{Makefile.in, configure.in}, gdb.stabs/{Makefile.in, configure.in},
gdb.threads/{Makefile.in, configure.in}: Major reworking for autoconfig.
* aclocal.m4, configure, gdb.base/configure, gdb.c++/configure,
gdb.disasm/configure, gdb.stabs/configure, gdb.stabs/default.mt : New files.
* config/unix-gdb.exp: Make GDB global.
* gdb.base/{a1-selftest.exp, a2-run.exp,bitfields.exp, break.exp, callfuncs.exp,
commands.exp, corefile.exp, crossload.exp, exprs.exp, funcargs.exp, interrupt.exp,
langs.exp, list.exp, mips_pro.exp, nodebug.exp, opaque.exp, printcmds.exp,
ptype.exp, recurse.exp, regs.exp, return.exp, scope.exp, setvar.exp, sigall.exp,
signals.exp, term.exp, twice.exp, watchpoint.exp, whatis.exp},
gdb.c++/{classes.exp, callfuncs.exp, inherit.exp, misc.exp, templates.exp,
virtfunc.exp}, gdb.chill/{callch.exp, chillvars.exp, misc.exp, pr-4975.exp,
pr-5016.exp, pr-5020.exp, pr-5022.exp, pr-5646.exp, pr-5984.exp, pr-6292.exp,
pr-6632.exp, pr-8134.exp, pr-8136.exp, result.exp, string.exp, tuples.exp},
gdb.disasm/{hppa.exp, sh3.exp}, gdb.stabs/weird.exp: Change continues
to returns as necessary, arrange for test to compile own testcase executable.
* lib/gdb.exp: Changes for testsuite to compile own test cases.
From Fred Fish (fnf@cygnus.com)
* gdb.c++/classes.exp (test_pointers_to_class_members): Add
clear_xfail at end of test which might not call either pass or fail.
* gdb.base/a1-selftest.exp: Add i*86-*-linuxaout xfail for
"backtrace through signal handler".
1995-11-25 19:55:29 +00:00
|
|
|
execute_anywhere "rm -f ${binfile}.ci"
|
|
|
|
if { [compile "-E ${srcdir}/${subdir}/compiler.c > ${binfile}.ci"] != "" } {
|
1996-11-01 20:00:26 +00:00
|
|
|
perror "Couldn't make ${binfile}.ci file"
|
From Rob Savoye (rob@poseidon.cygnus.com)
* Makefile.in, configure.in, gdb.base/{Makefile.in, configure.in},
gdb.c++/{Makefile.in, configure.in}, gdb.chill/{Makefile.in, configure.in},
gdb.disasm/{Makefile.in, configure.in}, gdb.stabs/{Makefile.in, configure.in},
gdb.threads/{Makefile.in, configure.in}: Major reworking for autoconfig.
* aclocal.m4, configure, gdb.base/configure, gdb.c++/configure,
gdb.disasm/configure, gdb.stabs/configure, gdb.stabs/default.mt : New files.
* config/unix-gdb.exp: Make GDB global.
* gdb.base/{a1-selftest.exp, a2-run.exp,bitfields.exp, break.exp, callfuncs.exp,
commands.exp, corefile.exp, crossload.exp, exprs.exp, funcargs.exp, interrupt.exp,
langs.exp, list.exp, mips_pro.exp, nodebug.exp, opaque.exp, printcmds.exp,
ptype.exp, recurse.exp, regs.exp, return.exp, scope.exp, setvar.exp, sigall.exp,
signals.exp, term.exp, twice.exp, watchpoint.exp, whatis.exp},
gdb.c++/{classes.exp, callfuncs.exp, inherit.exp, misc.exp, templates.exp,
virtfunc.exp}, gdb.chill/{callch.exp, chillvars.exp, misc.exp, pr-4975.exp,
pr-5016.exp, pr-5020.exp, pr-5022.exp, pr-5646.exp, pr-5984.exp, pr-6292.exp,
pr-6632.exp, pr-8134.exp, pr-8136.exp, result.exp, string.exp, tuples.exp},
gdb.disasm/{hppa.exp, sh3.exp}, gdb.stabs/weird.exp: Change continues
to returns as necessary, arrange for test to compile own testcase executable.
* lib/gdb.exp: Changes for testsuite to compile own test cases.
From Fred Fish (fnf@cygnus.com)
* gdb.c++/classes.exp (test_pointers_to_class_members): Add
clear_xfail at end of test which might not call either pass or fail.
* gdb.base/a1-selftest.exp: Add i*86-*-linuxaout xfail for
"backtrace through signal handler".
1995-11-25 19:55:29 +00:00
|
|
|
return -1
|
1994-07-18 19:25:50 +00:00
|
|
|
}
|
1996-11-01 20:00:26 +00:00
|
|
|
source ${binfile}.ci
|
1994-07-18 19:25:50 +00:00
|
|
|
|
1996-03-20 07:52:01 +00:00
|
|
|
# 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
|
1996-11-01 20:00:26 +00:00
|
|
|
# ulimit here if we didn't find a core file above.
|
1996-03-20 07:52:01 +00:00
|
|
|
catch "system \"(cd ${objdir}/${subdir}; ${binfile}; true) >/dev/null 2>&1\""
|
From Rob Savoye (rob@poseidon.cygnus.com)
* Makefile.in, configure.in, gdb.base/{Makefile.in, configure.in},
gdb.c++/{Makefile.in, configure.in}, gdb.chill/{Makefile.in, configure.in},
gdb.disasm/{Makefile.in, configure.in}, gdb.stabs/{Makefile.in, configure.in},
gdb.threads/{Makefile.in, configure.in}: Major reworking for autoconfig.
* aclocal.m4, configure, gdb.base/configure, gdb.c++/configure,
gdb.disasm/configure, gdb.stabs/configure, gdb.stabs/default.mt : New files.
* config/unix-gdb.exp: Make GDB global.
* gdb.base/{a1-selftest.exp, a2-run.exp,bitfields.exp, break.exp, callfuncs.exp,
commands.exp, corefile.exp, crossload.exp, exprs.exp, funcargs.exp, interrupt.exp,
langs.exp, list.exp, mips_pro.exp, nodebug.exp, opaque.exp, printcmds.exp,
ptype.exp, recurse.exp, regs.exp, return.exp, scope.exp, setvar.exp, sigall.exp,
signals.exp, term.exp, twice.exp, watchpoint.exp, whatis.exp},
gdb.c++/{classes.exp, callfuncs.exp, inherit.exp, misc.exp, templates.exp,
virtfunc.exp}, gdb.chill/{callch.exp, chillvars.exp, misc.exp, pr-4975.exp,
pr-5016.exp, pr-5020.exp, pr-5022.exp, pr-5646.exp, pr-5984.exp, pr-6292.exp,
pr-6632.exp, pr-8134.exp, pr-8136.exp, result.exp, string.exp, tuples.exp},
gdb.disasm/{hppa.exp, sh3.exp}, gdb.stabs/weird.exp: Change continues
to returns as necessary, arrange for test to compile own testcase executable.
* lib/gdb.exp: Changes for testsuite to compile own test cases.
From Fred Fish (fnf@cygnus.com)
* gdb.c++/classes.exp (test_pointers_to_class_members): Add
clear_xfail at end of test which might not call either pass or fail.
* gdb.base/a1-selftest.exp: Add i*86-*-linuxaout xfail for
"backtrace through signal handler".
1995-11-25 19:55:29 +00:00
|
|
|
foreach i "${objdir}/${subdir}/core ${objdir}/${subdir}/core.coremaker.c ${binfile}.core" {
|
|
|
|
set exec_output [execute_anywhere "ls $i"]
|
1996-03-16 00:47:44 +00:00
|
|
|
if [ regexp "No such file or directory|not found" ${exec_output} ] {
|
From Rob Savoye (rob@poseidon.cygnus.com)
* Makefile.in, configure.in, gdb.base/{Makefile.in, configure.in},
gdb.c++/{Makefile.in, configure.in}, gdb.chill/{Makefile.in, configure.in},
gdb.disasm/{Makefile.in, configure.in}, gdb.stabs/{Makefile.in, configure.in},
gdb.threads/{Makefile.in, configure.in}: Major reworking for autoconfig.
* aclocal.m4, configure, gdb.base/configure, gdb.c++/configure,
gdb.disasm/configure, gdb.stabs/configure, gdb.stabs/default.mt : New files.
* config/unix-gdb.exp: Make GDB global.
* gdb.base/{a1-selftest.exp, a2-run.exp,bitfields.exp, break.exp, callfuncs.exp,
commands.exp, corefile.exp, crossload.exp, exprs.exp, funcargs.exp, interrupt.exp,
langs.exp, list.exp, mips_pro.exp, nodebug.exp, opaque.exp, printcmds.exp,
ptype.exp, recurse.exp, regs.exp, return.exp, scope.exp, setvar.exp, sigall.exp,
signals.exp, term.exp, twice.exp, watchpoint.exp, whatis.exp},
gdb.c++/{classes.exp, callfuncs.exp, inherit.exp, misc.exp, templates.exp,
virtfunc.exp}, gdb.chill/{callch.exp, chillvars.exp, misc.exp, pr-4975.exp,
pr-5016.exp, pr-5020.exp, pr-5022.exp, pr-5646.exp, pr-5984.exp, pr-6292.exp,
pr-6632.exp, pr-8134.exp, pr-8136.exp, result.exp, string.exp, tuples.exp},
gdb.disasm/{hppa.exp, sh3.exp}, gdb.stabs/weird.exp: Change continues
to returns as necessary, arrange for test to compile own testcase executable.
* lib/gdb.exp: Changes for testsuite to compile own test cases.
From Fred Fish (fnf@cygnus.com)
* gdb.c++/classes.exp (test_pointers_to_class_members): Add
clear_xfail at end of test which might not call either pass or fail.
* gdb.base/a1-selftest.exp: Add i*86-*-linuxaout xfail for
"backtrace through signal handler".
1995-11-25 19:55:29 +00:00
|
|
|
continue
|
|
|
|
} else {
|
|
|
|
execute_anywhere "mv $i ${objdir}/${subdir}/corefile"
|
|
|
|
set found 1
|
|
|
|
}
|
1995-12-30 22:27:24 +00:00
|
|
|
}
|
1996-03-20 07:52:01 +00:00
|
|
|
|
|
|
|
if { $found == 0 } {
|
|
|
|
warning "can't generate a core file - core tests suppressed - check ulimit -c"
|
|
|
|
return 0
|
1994-07-18 19:25:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Test that we can simply startup with a "-core=corefile" command line arg
|
|
|
|
# and recognize that the core file is a valid, usable core file.
|
|
|
|
# To do this, we must shutdown the currently running gdb and restart
|
|
|
|
# with the -core args. We can't use gdb_start because it looks for
|
|
|
|
# the first gdb prompt, and the message we are looking for occurs
|
|
|
|
# before the first prompt. Also, we can't include GDBFLAGS because
|
|
|
|
# if it is empty, this confuses gdb with an empty argument that it
|
|
|
|
# grumbles about (said grumbling currently being ignored in gdb_start).
|
|
|
|
# **FIXME**
|
|
|
|
#
|
1995-12-30 22:27:24 +00:00
|
|
|
# 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.
|
1994-07-18 19:25:50 +00:00
|
|
|
|
|
|
|
gdb_exit
|
|
|
|
if $verbose>1 then {
|
1995-01-06 01:37:18 +00:00
|
|
|
send_user "Spawning $GDB -nw $GDBFLAGS -core=$objdir/$subdir/corefile\n"
|
1994-07-18 19:25:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
set oldtimeout $timeout
|
|
|
|
set timeout [expr "$timeout + 60"]
|
1996-11-01 20:00:26 +00:00
|
|
|
verbose "Timeout is now $timeout seconds" 2
|
1995-01-06 01:37:18 +00:00
|
|
|
eval "spawn $GDB -nw $GDBFLAGS -core=$objdir/$subdir/corefile"
|
1994-07-18 19:25:50 +00:00
|
|
|
expect {
|
1995-12-30 22:27:24 +00:00
|
|
|
-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)"
|
|
|
|
}
|
1996-03-20 07:52:01 +00:00
|
|
|
-re ".*registers from core file: File in wrong format.* $" {
|
|
|
|
fail "args: -core=corefile (could not read registers from core file)"
|
|
|
|
}
|
1995-12-30 22:27:24 +00:00
|
|
|
-re ".*$prompt $" { fail "args: -core=corefile" }
|
|
|
|
timeout { fail "(timeout) starting with -core" }
|
1994-07-18 19:25:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Test that startup with both an executable file and -core argument.
|
|
|
|
# See previous comments above, they are still applicable.
|
|
|
|
#
|
|
|
|
|
|
|
|
gdb_exit
|
|
|
|
if $verbose>1 then {
|
1995-12-30 22:27:24 +00:00
|
|
|
send_user "Spawning $GDB -nw $GDBFLAGS $binfile -core=$objdir/$subdir/corefile\n"
|
1994-07-18 19:25:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1995-12-30 22:27:24 +00:00
|
|
|
spawn $GDB -nw $GDBFLAGS $binfile -core=$objdir/$subdir/corefile
|
1994-07-18 19:25:50 +00:00
|
|
|
expect {
|
1995-12-30 22:27:24 +00:00
|
|
|
-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)"
|
|
|
|
}
|
1996-03-20 07:52:01 +00:00
|
|
|
-re ".*registers from core file: File in wrong format.* $" {
|
|
|
|
fail "args: execfile -core=corefile (could not read registers from core file)"
|
|
|
|
}
|
1995-12-30 22:27:24 +00:00
|
|
|
-re ".*$prompt $" { fail "args: execfile -core=corefile" }
|
|
|
|
timeout { fail "(timeout) starting with -core" }
|
1994-07-18 19:25:50 +00:00
|
|
|
}
|
|
|
|
set timeout $oldtimeout
|
1996-11-01 20:00:26 +00:00
|
|
|
verbose "Timeout is now $timeout seconds" 2
|
1994-07-18 19:25:50 +00:00
|
|
|
|
|
|
|
# Now restart normally.
|
|
|
|
|
|
|
|
gdb_exit
|
|
|
|
gdb_start
|
|
|
|
gdb_reinitialize_dir $srcdir/$subdir
|
From Rob Savoye (rob@poseidon.cygnus.com)
* Makefile.in, configure.in, gdb.base/{Makefile.in, configure.in},
gdb.c++/{Makefile.in, configure.in}, gdb.chill/{Makefile.in, configure.in},
gdb.disasm/{Makefile.in, configure.in}, gdb.stabs/{Makefile.in, configure.in},
gdb.threads/{Makefile.in, configure.in}: Major reworking for autoconfig.
* aclocal.m4, configure, gdb.base/configure, gdb.c++/configure,
gdb.disasm/configure, gdb.stabs/configure, gdb.stabs/default.mt : New files.
* config/unix-gdb.exp: Make GDB global.
* gdb.base/{a1-selftest.exp, a2-run.exp,bitfields.exp, break.exp, callfuncs.exp,
commands.exp, corefile.exp, crossload.exp, exprs.exp, funcargs.exp, interrupt.exp,
langs.exp, list.exp, mips_pro.exp, nodebug.exp, opaque.exp, printcmds.exp,
ptype.exp, recurse.exp, regs.exp, return.exp, scope.exp, setvar.exp, sigall.exp,
signals.exp, term.exp, twice.exp, watchpoint.exp, whatis.exp},
gdb.c++/{classes.exp, callfuncs.exp, inherit.exp, misc.exp, templates.exp,
virtfunc.exp}, gdb.chill/{callch.exp, chillvars.exp, misc.exp, pr-4975.exp,
pr-5016.exp, pr-5020.exp, pr-5022.exp, pr-5646.exp, pr-5984.exp, pr-6292.exp,
pr-6632.exp, pr-8134.exp, pr-8136.exp, result.exp, string.exp, tuples.exp},
gdb.disasm/{hppa.exp, sh3.exp}, gdb.stabs/weird.exp: Change continues
to returns as necessary, arrange for test to compile own testcase executable.
* lib/gdb.exp: Changes for testsuite to compile own test cases.
From Fred Fish (fnf@cygnus.com)
* gdb.c++/classes.exp (test_pointers_to_class_members): Add
clear_xfail at end of test which might not call either pass or fail.
* gdb.base/a1-selftest.exp: Add i*86-*-linuxaout xfail for
"backtrace through signal handler".
1995-11-25 19:55:29 +00:00
|
|
|
gdb_load ${binfile}
|
1994-07-18 19:25:50 +00:00
|
|
|
|
|
|
|
# Test basic corefile recognition via core-file command.
|
|
|
|
|
|
|
|
send "core-file $objdir/$subdir/corefile\n"
|
|
|
|
expect {
|
1995-12-30 22:27:24 +00:00
|
|
|
-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)"
|
|
|
|
}
|
1996-03-20 07:52:01 +00:00
|
|
|
-re ".*registers from core file: File in wrong format.* $" {
|
|
|
|
fail "core-file command (could not read registers from core file)"
|
|
|
|
}
|
1995-12-30 22:27:24 +00:00
|
|
|
-re ".*$prompt $" { fail "core-file command" }
|
|
|
|
timeout { fail "(timeout) core-file command" }
|
1994-07-18 19:25:50 +00:00
|
|
|
}
|
|
|
|
|
From Rob Savoye (rob@poseidon.cygnus.com)
* Makefile.in, configure.in, gdb.base/{Makefile.in, configure.in},
gdb.c++/{Makefile.in, configure.in}, gdb.chill/{Makefile.in, configure.in},
gdb.disasm/{Makefile.in, configure.in}, gdb.stabs/{Makefile.in, configure.in},
gdb.threads/{Makefile.in, configure.in}: Major reworking for autoconfig.
* aclocal.m4, configure, gdb.base/configure, gdb.c++/configure,
gdb.disasm/configure, gdb.stabs/configure, gdb.stabs/default.mt : New files.
* config/unix-gdb.exp: Make GDB global.
* gdb.base/{a1-selftest.exp, a2-run.exp,bitfields.exp, break.exp, callfuncs.exp,
commands.exp, corefile.exp, crossload.exp, exprs.exp, funcargs.exp, interrupt.exp,
langs.exp, list.exp, mips_pro.exp, nodebug.exp, opaque.exp, printcmds.exp,
ptype.exp, recurse.exp, regs.exp, return.exp, scope.exp, setvar.exp, sigall.exp,
signals.exp, term.exp, twice.exp, watchpoint.exp, whatis.exp},
gdb.c++/{classes.exp, callfuncs.exp, inherit.exp, misc.exp, templates.exp,
virtfunc.exp}, gdb.chill/{callch.exp, chillvars.exp, misc.exp, pr-4975.exp,
pr-5016.exp, pr-5020.exp, pr-5022.exp, pr-5646.exp, pr-5984.exp, pr-6292.exp,
pr-6632.exp, pr-8134.exp, pr-8136.exp, result.exp, string.exp, tuples.exp},
gdb.disasm/{hppa.exp, sh3.exp}, gdb.stabs/weird.exp: Change continues
to returns as necessary, arrange for test to compile own testcase executable.
* lib/gdb.exp: Changes for testsuite to compile own test cases.
From Fred Fish (fnf@cygnus.com)
* gdb.c++/classes.exp (test_pointers_to_class_members): Add
clear_xfail at end of test which might not call either pass or fail.
* gdb.base/a1-selftest.exp: Add i*86-*-linuxaout xfail for
"backtrace through signal handler".
1995-11-25 19:55:29 +00:00
|
|
|
# Test correct mapping of corefile sections by printing some variables.
|
|
|
|
|
|
|
|
gdb_test "print coremaker_data" "\\\$$decimal = 202"
|
|
|
|
gdb_test "print coremaker_bss" "\\\$$decimal = 10"
|
|
|
|
gdb_test "print coremaker_ro" "\\\$$decimal = 201"
|
|
|
|
|
1996-11-01 20:00:26 +00:00
|
|
|
setup_xfail "i*86-*-sysv4*" "i*86-*-linux*" "m68*-*-hpux*"
|
|
|
|
if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
|
From Rob Savoye (rob@poseidon.cygnus.com)
* Makefile.in, configure.in, gdb.base/{Makefile.in, configure.in},
gdb.c++/{Makefile.in, configure.in}, gdb.chill/{Makefile.in, configure.in},
gdb.disasm/{Makefile.in, configure.in}, gdb.stabs/{Makefile.in, configure.in},
gdb.threads/{Makefile.in, configure.in}: Major reworking for autoconfig.
* aclocal.m4, configure, gdb.base/configure, gdb.c++/configure,
gdb.disasm/configure, gdb.stabs/configure, gdb.stabs/default.mt : New files.
* config/unix-gdb.exp: Make GDB global.
* gdb.base/{a1-selftest.exp, a2-run.exp,bitfields.exp, break.exp, callfuncs.exp,
commands.exp, corefile.exp, crossload.exp, exprs.exp, funcargs.exp, interrupt.exp,
langs.exp, list.exp, mips_pro.exp, nodebug.exp, opaque.exp, printcmds.exp,
ptype.exp, recurse.exp, regs.exp, return.exp, scope.exp, setvar.exp, sigall.exp,
signals.exp, term.exp, twice.exp, watchpoint.exp, whatis.exp},
gdb.c++/{classes.exp, callfuncs.exp, inherit.exp, misc.exp, templates.exp,
virtfunc.exp}, gdb.chill/{callch.exp, chillvars.exp, misc.exp, pr-4975.exp,
pr-5016.exp, pr-5020.exp, pr-5022.exp, pr-5646.exp, pr-5984.exp, pr-6292.exp,
pr-6632.exp, pr-8134.exp, pr-8136.exp, result.exp, string.exp, tuples.exp},
gdb.disasm/{hppa.exp, sh3.exp}, gdb.stabs/weird.exp: Change continues
to returns as necessary, arrange for test to compile own testcase executable.
* lib/gdb.exp: Changes for testsuite to compile own test cases.
From Fred Fish (fnf@cygnus.com)
* gdb.c++/classes.exp (test_pointers_to_class_members): Add
clear_xfail at end of test which might not call either pass or fail.
* gdb.base/a1-selftest.exp: Add i*86-*-linuxaout xfail for
"backtrace through signal handler".
1995-11-25 19:55:29 +00:00
|
|
|
gdb_test "print func2::coremaker_local" "\\\$$decimal = {0, 1, 2, 3, 4}"
|
|
|
|
|
1995-08-07 07:20:02 +00:00
|
|
|
# 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
|
1996-11-01 20:00:26 +00:00
|
|
|
setup_xfail "m68k-*-hpux*" "i*86-*-sysv4*" "i*86-*-linux*"
|
1995-08-07 07:20:02 +00:00
|
|
|
gdb_test "bt" "abort.*func2.*func1.*main.*" "backtrace in corefile.exp"
|
|
|
|
|
1996-11-01 20:00:26 +00:00
|
|
|
# Test ability to read mmap'd data
|
|
|
|
|
|
|
|
gdb_test "x/8bd buf1" ".*:.*0.*1.*2.*3.*4.*5.*6.*7" "accessing original mmap data in core file"
|
|
|
|
setup_xfail "*-*-sunos*" "*-*-ultrix*" "*-*-aix*"
|
|
|
|
send "x/8bd buf2\n"
|
|
|
|
expect {
|
|
|
|
-re ".*:.*0.*1.*2.*3.*4.*5.*6.*7.*$prompt $" {
|
|
|
|
pass "accessing mmapped data in core file"
|
|
|
|
}
|
|
|
|
-re "0x\[f\]*:.*Cannot access memory at address 0x\[f\]*" {
|
|
|
|
fail "accessing mmapped data (mapping failed at runtime)"
|
|
|
|
}
|
|
|
|
-re "0x.*:.*Cannot access memory at address 0x.*" {
|
|
|
|
fail "accessing mmapped data (mapping address not found in core file)"
|
|
|
|
}
|
|
|
|
-re ".*$prompt $" {
|
|
|
|
fail "accessing mmapped data (incorrect data found in core file)"
|
|
|
|
}
|
|
|
|
timeout {
|
|
|
|
fail "accessing mmapped data (timeout)"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1994-10-09 14:52:02 +00:00
|
|
|
# test reinit_frame_cache
|
|
|
|
|
From Rob Savoye (rob@poseidon.cygnus.com)
* Makefile.in, configure.in, gdb.base/{Makefile.in, configure.in},
gdb.c++/{Makefile.in, configure.in}, gdb.chill/{Makefile.in, configure.in},
gdb.disasm/{Makefile.in, configure.in}, gdb.stabs/{Makefile.in, configure.in},
gdb.threads/{Makefile.in, configure.in}: Major reworking for autoconfig.
* aclocal.m4, configure, gdb.base/configure, gdb.c++/configure,
gdb.disasm/configure, gdb.stabs/configure, gdb.stabs/default.mt : New files.
* config/unix-gdb.exp: Make GDB global.
* gdb.base/{a1-selftest.exp, a2-run.exp,bitfields.exp, break.exp, callfuncs.exp,
commands.exp, corefile.exp, crossload.exp, exprs.exp, funcargs.exp, interrupt.exp,
langs.exp, list.exp, mips_pro.exp, nodebug.exp, opaque.exp, printcmds.exp,
ptype.exp, recurse.exp, regs.exp, return.exp, scope.exp, setvar.exp, sigall.exp,
signals.exp, term.exp, twice.exp, watchpoint.exp, whatis.exp},
gdb.c++/{classes.exp, callfuncs.exp, inherit.exp, misc.exp, templates.exp,
virtfunc.exp}, gdb.chill/{callch.exp, chillvars.exp, misc.exp, pr-4975.exp,
pr-5016.exp, pr-5020.exp, pr-5022.exp, pr-5646.exp, pr-5984.exp, pr-6292.exp,
pr-6632.exp, pr-8134.exp, pr-8136.exp, result.exp, string.exp, tuples.exp},
gdb.disasm/{hppa.exp, sh3.exp}, gdb.stabs/weird.exp: Change continues
to returns as necessary, arrange for test to compile own testcase executable.
* lib/gdb.exp: Changes for testsuite to compile own test cases.
From Fred Fish (fnf@cygnus.com)
* gdb.c++/classes.exp (test_pointers_to_class_members): Add
clear_xfail at end of test which might not call either pass or fail.
* gdb.base/a1-selftest.exp: Add i*86-*-linuxaout xfail for
"backtrace through signal handler".
1995-11-25 19:55:29 +00:00
|
|
|
gdb_load ${binfile}
|
1994-10-09 14:52:02 +00:00
|
|
|
setup_xfail "*-*-*"
|
1995-08-07 07:20:02 +00:00
|
|
|
gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(\\)" "up in corefile.exp"
|
1994-10-09 14:52:02 +00:00
|
|
|
|
1994-07-18 19:25:50 +00:00
|
|
|
gdb_test "core" "No core file now."
|