1997-03-06 22:32:25 +00:00
|
|
|
# Copyright (C) 1988, 1990, 1991, 1992, 1994, 1997 Free Software Foundation, Inc.
|
1994-06-07 01:57:15 +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
|
1997-03-06 22:32:25 +00:00
|
|
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1994-06-07 01:57:15 +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 Rob Savoye. (rob@cygnus.com)
|
|
|
|
|
|
|
|
if $tracelevel then {
|
1997-01-29 09:40:31 +00:00
|
|
|
strace $tracelevel
|
|
|
|
}
|
1994-06-07 01:57:15 +00:00
|
|
|
|
|
|
|
set prms_id 0
|
|
|
|
set bug_id 0
|
|
|
|
|
|
|
|
# are we on a target board
|
1997-01-29 09:40:31 +00:00
|
|
|
if [is_remote target] {
|
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
|
1994-06-07 01:57:15 +00:00
|
|
|
}
|
1997-01-29 09:40:31 +00:00
|
|
|
|
1995-02-09 20:46:53 +00:00
|
|
|
if [istarget "m68k*-*-hpux*"] then {
|
|
|
|
# The top-level makefile passes CFLAGS= (no -g) for hp300. This probably
|
|
|
|
# should be fixed (it is only needed for gcc bootstrapping, not gdb),
|
|
|
|
# but until then.....
|
|
|
|
setup_xfail "*-*-*"
|
|
|
|
fail "cannot test self if compiled without debug info"
|
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
|
1995-02-09 20:46:53 +00:00
|
|
|
}
|
1994-06-07 01:57:15 +00:00
|
|
|
|
1996-08-12 22:38:30 +00:00
|
|
|
# Not all of the lines of code near the start of main are executed for
|
|
|
|
# every machine. Also, optimization may reorder some of the lines.
|
|
|
|
# So all we do is try to step or next over everything until we get
|
|
|
|
# to a line that we know is always executed.
|
|
|
|
|
|
|
|
proc do_steps_and_nexts {} {
|
1997-02-02 07:59:25 +00:00
|
|
|
global gdb_prompt
|
1996-11-22 18:16:24 +00:00
|
|
|
global srcdir
|
|
|
|
|
|
|
|
gdb_reinitialize_dir $srcdir/..
|
1996-08-12 22:38:30 +00:00
|
|
|
|
|
|
|
for {set count 0} {$count < 20} {incr count} {
|
1997-03-04 00:49:59 +00:00
|
|
|
send_gdb "list\n"
|
1997-02-24 05:43:35 +00:00
|
|
|
gdb_expect {
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*symarg = NULL.*$gdb_prompt $" {
|
1996-08-12 22:38:30 +00:00
|
|
|
set description "step over symarg initialization"
|
|
|
|
set command "step"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*execarg = NULL.*$gdb_prompt $" {
|
1996-08-12 22:38:30 +00:00
|
|
|
set description "step over execarg initialization"
|
|
|
|
set command "step"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*corearg = NULL.*$gdb_prompt $" {
|
1996-08-12 22:38:30 +00:00
|
|
|
set description "step over corearg initialization"
|
|
|
|
set command "step"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*cdarg = NULL.*$gdb_prompt $" {
|
1996-08-12 22:38:30 +00:00
|
|
|
set description "step over cdarg initialization"
|
|
|
|
set command "step"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*ttyarg = NULL.*$gdb_prompt $" {
|
1996-08-12 22:38:30 +00:00
|
|
|
set description "step over ttyarg initialization"
|
|
|
|
set command "step"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*time_at_startup = get_run_time.*$gdb_prompt $" {
|
1996-08-12 22:38:30 +00:00
|
|
|
set description "next over get_run_time and everything it calls"
|
|
|
|
set command "next"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*START_PROGRESS.*$gdb_prompt $" {
|
1996-08-12 22:38:30 +00:00
|
|
|
set description "next over START_PROGRESS and everything it calls"
|
|
|
|
set command "next"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*mac_init.*$gdb_prompt $" {
|
1996-08-12 22:38:30 +00:00
|
|
|
set description "next over mac_init and everything it calls"
|
|
|
|
set command "next"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*init_malloc.*$gdb_prompt $" {
|
1996-08-12 22:38:30 +00:00
|
|
|
set description "next over init_malloc and everything it calls"
|
|
|
|
set command "next"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*count . 0x3.*$gdb_prompt $" {
|
1996-11-22 18:16:24 +00:00
|
|
|
set description "next over conditional stack alignment code 1"
|
|
|
|
set command "next"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*if .i != 0.*$gdb_prompt $" {
|
1996-11-22 18:16:24 +00:00
|
|
|
set description "next over conditional stack alignment code 2"
|
|
|
|
set command "next"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*alloca .i - 4.*$gdb_prompt $" {
|
1996-11-22 18:16:24 +00:00
|
|
|
set description "next over conditional stack alignment alloca"
|
|
|
|
set command "next"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*SET_TOP_LEVEL.*$gdb_prompt $" {
|
1996-08-12 22:38:30 +00:00
|
|
|
set description "next over SET_TOP_LEVEL call"
|
|
|
|
set command "next"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*cmdsize = 1.*$gdb_prompt $" {
|
1996-08-12 22:38:30 +00:00
|
|
|
set description "step over cmdsize initialization"
|
|
|
|
set command "next"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*cmdarg = .* xmalloc.*$gdb_prompt $" {
|
1996-08-12 22:38:30 +00:00
|
|
|
set description "next over cmdarg initialization via xmalloc"
|
|
|
|
set command "next"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*ncmd = 0.*$gdb_prompt $" {
|
1996-08-12 22:38:30 +00:00
|
|
|
set description "next over ncmd initialization"
|
|
|
|
set command "next"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*dirsize = 1.*$gdb_prompt $" {
|
1996-08-12 22:38:30 +00:00
|
|
|
set description "next over dirsize initialization"
|
|
|
|
set command "next"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*dirarg = .* xmalloc.*$gdb_prompt $" {
|
1996-08-12 22:38:30 +00:00
|
|
|
return
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re "\[ \t\]+\{\r\n$gdb_prompt $" {
|
1996-08-12 22:38:30 +00:00
|
|
|
setup_xfail "mips-*-irix5*"
|
|
|
|
fail "$description ended up at odd location"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*main.c.*No such file or directory.*$gdb_prompt $" {
|
1996-08-12 22:38:30 +00:00
|
|
|
setup_xfail "rs6000-*-aix3*"
|
|
|
|
fail "must be able to list source lines"
|
|
|
|
return
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*$gdb_prompt $" {
|
1996-11-22 18:16:24 +00:00
|
|
|
fail "unknown source line after $description"
|
|
|
|
return
|
|
|
|
}
|
1996-08-12 22:38:30 +00:00
|
|
|
default {
|
|
|
|
fail "unknown source line near main"
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
1997-03-04 00:49:59 +00:00
|
|
|
send_gdb "$command\n"
|
1997-02-24 05:43:35 +00:00
|
|
|
gdb_expect {
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*No such file or directory.\r\n$gdb_prompt $" {
|
1996-08-12 22:38:30 +00:00
|
|
|
fail "$description (no source available)"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*A file or directory .* does not exist..\r\n$gdb_prompt $" {
|
1996-08-12 22:38:30 +00:00
|
|
|
fail "$description (no source available)"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*$gdb_prompt $" {
|
1996-08-12 22:38:30 +00:00
|
|
|
pass "$description"
|
|
|
|
}
|
|
|
|
timeout {
|
|
|
|
fail "$description (timeout)"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1997-01-29 09:40:31 +00:00
|
|
|
proc test_with_self { executable } {
|
1997-02-02 07:59:25 +00:00
|
|
|
global gdb_prompt
|
1994-06-07 01:57:15 +00:00
|
|
|
global tool
|
|
|
|
global det_file
|
|
|
|
global decimal
|
1996-06-26 04:38:38 +00:00
|
|
|
global timeout
|
1994-06-07 01:57:15 +00:00
|
|
|
|
|
|
|
# load yourself into the debugger
|
|
|
|
# This can take a relatively long time, particularly for testing where
|
|
|
|
# the executable is being accessed over a network, or where gdb does not
|
|
|
|
# support partial symbols for a particular target and has to load the
|
|
|
|
# entire symbol table. Set the timeout to 10 minutes, which should be
|
|
|
|
# adequate for most environments (it *has* timed out with 5 min on a
|
|
|
|
# SPARCstation SLC under moderate load, so this isn't unreasonable).
|
1995-07-20 20:33:39 +00:00
|
|
|
# After gdb is started, set the timeout to 30 seconds for the duration
|
1994-06-07 01:57:15 +00:00
|
|
|
# of this test, and then back to the original value.
|
|
|
|
|
1996-08-06 01:18:18 +00:00
|
|
|
set oldtimeout $timeout
|
1994-06-07 01:57:15 +00:00
|
|
|
set timeout 600
|
1996-06-26 04:38:38 +00:00
|
|
|
verbose "Timeout is now $timeout seconds" 2
|
1997-01-29 09:40:31 +00:00
|
|
|
if {[gdb_load $executable] <0} then {
|
1996-08-06 01:18:18 +00:00
|
|
|
set timeout $oldtimeout
|
|
|
|
verbose "Timeout is now $timeout seconds" 2
|
1994-06-07 01:57:15 +00:00
|
|
|
return -1
|
|
|
|
}
|
1996-11-22 18:16:24 +00:00
|
|
|
set timeout $oldtimeout
|
1996-08-06 01:18:18 +00:00
|
|
|
verbose "Timeout is now $timeout seconds" 2
|
1994-06-07 01:57:15 +00:00
|
|
|
|
|
|
|
# disassemble yourself
|
1997-01-29 09:40:31 +00:00
|
|
|
gdb_test "x/10i main" \
|
|
|
|
"x/10i.*main.*main.$decimal.*main.$decimal.*" \
|
|
|
|
"Disassemble main"
|
1994-06-07 01:57:15 +00:00
|
|
|
|
1997-01-29 09:40:31 +00:00
|
|
|
# Set a breakpoint at main
|
|
|
|
gdb_test "break main" \
|
|
|
|
"Breakpoint.*at.* file.*, line.*" \
|
|
|
|
"breakpoint in main"
|
1994-06-07 01:57:15 +00:00
|
|
|
|
1995-02-01 18:21:30 +00:00
|
|
|
# We'll need this when we send a ^C to GDB. Need to do it before we
|
|
|
|
# run the program and gdb starts saving and restoring tty states.
|
|
|
|
# On Ultrix, we don't need it and it is really slow (because shell_escape
|
|
|
|
# doesn't use vfork).
|
|
|
|
if ![istarget "*-*-ultrix*"] then {
|
|
|
|
gdb_test "shell stty intr '^C'" "" \
|
|
|
|
"set interrupt character in test_with_self"
|
|
|
|
}
|
|
|
|
|
1996-08-12 22:38:30 +00:00
|
|
|
# FIXME: If we put this after the run to main, the first list
|
|
|
|
# command doesn't print the same line as the current line where
|
|
|
|
# gdb is stopped.
|
1997-01-29 09:40:31 +00:00
|
|
|
gdb_test "set listsize 1" "" "set listsize to 1"
|
1996-08-12 22:38:30 +00:00
|
|
|
|
1994-06-07 01:57:15 +00:00
|
|
|
# run yourself
|
1996-08-06 01:18:18 +00:00
|
|
|
# It may take a very long time for the inferior gdb to start (lynx),
|
|
|
|
# so we bump it back up for the duration of this command.
|
|
|
|
set timeout 600
|
|
|
|
|
1994-06-07 01:57:15 +00:00
|
|
|
set description "run until breakpoint at main"
|
1997-03-04 00:49:59 +00:00
|
|
|
send_gdb "run -nw\n"
|
1997-02-24 05:43:35 +00:00
|
|
|
gdb_expect {
|
1997-02-02 07:59:25 +00:00
|
|
|
-re "Starting program.*Breakpoint \[0-9\]+,.*main .argc.*argv.* at .*main.c:.*$gdb_prompt $" {
|
1994-06-07 01:57:15 +00:00
|
|
|
pass "$description"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re "Starting program.*Breakpoint \[0-9\]+,.*main .argc.*argv.*$gdb_prompt $" {
|
1994-06-07 01:57:15 +00:00
|
|
|
xfail "$description (line numbers scrambled?)"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re "vfork: No more processes.*$gdb_prompt $" {
|
1994-06-07 01:57:15 +00:00
|
|
|
fail "$description (out of virtual memory)"
|
1996-08-06 01:18:18 +00:00
|
|
|
set timeout $oldtimeout
|
|
|
|
verbose "Timeout is now $timeout seconds" 2
|
1994-06-07 01:57:15 +00:00
|
|
|
return -1
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*$gdb_prompt $" {
|
1994-06-07 01:57:15 +00:00
|
|
|
fail "$description"
|
1996-08-06 01:18:18 +00:00
|
|
|
set timeout $oldtimeout
|
|
|
|
verbose "Timeout is now $timeout seconds" 2
|
1994-06-07 01:57:15 +00:00
|
|
|
return -1
|
|
|
|
}
|
|
|
|
timeout {
|
|
|
|
fail "$description (timeout)"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1996-11-22 18:16:24 +00:00
|
|
|
set timeout $oldtimeout
|
1996-06-26 04:38:38 +00:00
|
|
|
verbose "Timeout is now $timeout seconds" 2
|
1995-07-20 20:33:39 +00:00
|
|
|
|
1994-06-07 01:57:15 +00:00
|
|
|
# do we have a version number ?
|
1997-03-04 00:49:59 +00:00
|
|
|
send_gdb "print version\n"
|
1997-02-24 05:43:35 +00:00
|
|
|
gdb_expect {
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".\[0-9\]+ = +0x.*\[0-9.\]+.*$gdb_prompt $" {
|
1994-06-07 01:57:15 +00:00
|
|
|
pass "printed version"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".\[0-9\]+ = +.+ +0x.*\[0-9.\]+.*$gdb_prompt $" {
|
1994-06-07 01:57:15 +00:00
|
|
|
pass "printed version with cast"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*$gdb_prompt $" { fail "printed version" }
|
1994-06-07 01:57:15 +00:00
|
|
|
timeout { fail "(timeout) printed version" }
|
|
|
|
}
|
|
|
|
|
1996-08-12 22:38:30 +00:00
|
|
|
do_steps_and_nexts
|
1994-06-07 01:57:15 +00:00
|
|
|
|
1997-01-29 09:40:31 +00:00
|
|
|
gdb_test "print \"foo\"" ".\[0-9\]+ = \"foo\"" "print a string"
|
1994-06-07 01:57:15 +00:00
|
|
|
|
1996-08-12 22:38:30 +00:00
|
|
|
# do_steps_and_nexts left us ready to execute an xmalloc call,
|
|
|
|
# so give that a try.
|
|
|
|
# If we don't actually enter the xmalloc call when we give a
|
|
|
|
# step command that seems like a genuine bug. It seems to happen
|
|
|
|
# on most RISC processors.
|
|
|
|
setup_xfail "alpha-*-*" "hppa*-*-*" "mips-*-*"
|
|
|
|
set description "step into xmalloc call"
|
1997-03-04 00:49:59 +00:00
|
|
|
send_gdb "step\n"
|
1997-02-24 05:43:35 +00:00
|
|
|
gdb_expect {
|
1997-02-02 07:59:25 +00:00
|
|
|
-re "xmalloc.*size=.*at.*utils.c.*$gdb_prompt $" {
|
1994-06-07 01:57:15 +00:00
|
|
|
pass "$description"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*No such file or directory.\r\n$gdb_prompt $" {
|
1994-06-07 01:57:15 +00:00
|
|
|
pass "$description (no source available)"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re "A file or directory .* does not exist..\r\n$gdb_prompt $" {
|
1994-06-07 01:57:15 +00:00
|
|
|
pass "$description (no source available)"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*$gdb_prompt $" {
|
1994-06-07 01:57:15 +00:00
|
|
|
fail "$description"
|
|
|
|
}
|
|
|
|
timeout {
|
|
|
|
fail "$description (timeout)"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# start the "xgdb" process
|
1997-03-04 00:49:59 +00:00
|
|
|
send_gdb "continue\n"
|
1997-02-24 05:43:35 +00:00
|
|
|
gdb_expect {
|
1996-09-27 17:50:47 +00:00
|
|
|
-re "GNU gdb \[0-9\.\]*.*
|
|
|
|
Copyright \[0-9\]* Free Software Foundation, Inc.*
|
|
|
|
GDB is free software, covered by the GNU General Public License, and you are.*
|
|
|
|
welcome to change it and/or distribute copies of it under certain conditions.*
|
|
|
|
Type \"show copying\" to see the conditions.*
|
|
|
|
There is absolutely no warranty for GDB. Type \"show warranty\" for details.*
|
1997-02-02 07:59:25 +00:00
|
|
|
This GDB was configured as .*$gdb_prompt $"\
|
1996-09-27 17:50:47 +00:00
|
|
|
{ pass "xgdb is at prompt" }
|
1994-06-07 01:57:15 +00:00
|
|
|
-re "GDB is free software and you are welcome to distribute copies of it.*
|
|
|
|
under certain conditions; type \"show copying\" to see the conditions..*
|
|
|
|
There is absolutely no warranty for GDB; type \"show warranty\" for details..*
|
1997-02-02 07:59:25 +00:00
|
|
|
GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$gdb_prompt $"\
|
1996-09-27 17:50:47 +00:00
|
|
|
{ pass "xgdb is at prompt (obsolescent gdb)" }
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*$gdb_prompt $" { fail "xgdb is at prompt" }
|
1994-06-07 01:57:15 +00:00
|
|
|
timeout { fail "(timeout) xgdb is at prompt" }
|
|
|
|
}
|
|
|
|
|
|
|
|
# set xgdb prompt so we can tell which is which
|
1997-03-04 00:49:59 +00:00
|
|
|
send_gdb "set prompt (xgdb) \n"
|
1997-02-24 05:43:35 +00:00
|
|
|
gdb_expect {
|
1994-06-07 01:57:15 +00:00
|
|
|
-re "\[(\]xgdb\[)\].*\[(\]xgdb\[)\] $" { pass "Set xgdb prompt" }
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*$gdb_prompt $" { fail "Set xgdb prompt" }
|
1994-06-07 01:57:15 +00:00
|
|
|
default { fail "(timeout) Set xgdb prompt" }
|
|
|
|
}
|
|
|
|
|
|
|
|
# kill the xgdb process
|
|
|
|
set description "send ^C to child process"
|
1997-03-04 00:49:59 +00:00
|
|
|
send_gdb "\003"
|
1997-02-24 05:43:35 +00:00
|
|
|
gdb_expect {
|
1997-02-02 07:59:25 +00:00
|
|
|
-re "Program received signal SIGINT.*$gdb_prompt $" {
|
1994-06-07 01:57:15 +00:00
|
|
|
pass "$description"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*$gdb_prompt $" {
|
1994-06-07 01:57:15 +00:00
|
|
|
fail "$description"
|
|
|
|
}
|
|
|
|
timeout {
|
|
|
|
fail "$description (timeout)"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
set description "send SIGINT signal to child process"
|
1997-03-04 00:49:59 +00:00
|
|
|
send_gdb "signal SIGINT\n"
|
1997-02-24 05:43:35 +00:00
|
|
|
gdb_expect {
|
1997-02-02 07:59:25 +00:00
|
|
|
-re "Continuing with signal SIGINT.*$gdb_prompt $" {
|
1994-06-07 01:57:15 +00:00
|
|
|
pass "$description"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*$gdb_prompt $" {
|
1994-06-07 01:57:15 +00:00
|
|
|
fail "$description"
|
|
|
|
}
|
|
|
|
timeout {
|
|
|
|
fail "$description (timeout)"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# get a stack trace
|
1996-03-28 00:27:33 +00:00
|
|
|
#
|
|
|
|
# This fails on some linux systems for unknown reasons. On the
|
|
|
|
# systems where it fails, sometimes it works fine when run manually.
|
|
|
|
# The testsuite failures may not be limited to just aout systems.
|
1996-11-23 21:33:08 +00:00
|
|
|
setup_xfail "i*86-pc-linuxaout-gnu" "hppa*-*-hpux*"
|
1994-06-07 01:57:15 +00:00
|
|
|
set description "backtrace through signal handler"
|
1997-03-04 00:49:59 +00:00
|
|
|
send_gdb "backtrace\n"
|
1997-02-24 05:43:35 +00:00
|
|
|
gdb_expect {
|
1997-02-02 07:59:25 +00:00
|
|
|
-re "#0.*read.*in main \\(.*\\) at .*main\\.c.*$gdb_prompt $" {
|
1994-06-07 01:57:15 +00:00
|
|
|
pass "$description"
|
|
|
|
}
|
1997-02-02 07:59:25 +00:00
|
|
|
-re ".*$gdb_prompt $" {
|
1995-04-15 21:29:14 +00:00
|
|
|
# On the alpha, we hit the infamous problem about gdb
|
|
|
|
# being unable to get the frame pointer (mentioned in
|
|
|
|
# gdb/README). As it is intermittent, there is no way to
|
|
|
|
# XFAIL it which will give us an XPASS if the problem goes
|
|
|
|
# away.
|
|
|
|
setup_xfail "alpha*-*-osf*"
|
1994-06-07 01:57:15 +00:00
|
|
|
fail "$description"
|
|
|
|
}
|
|
|
|
timeout {
|
|
|
|
fail "$description (timeout)"
|
|
|
|
}
|
|
|
|
}
|
1995-01-11 20:42:33 +00:00
|
|
|
|
1994-06-07 01:57:15 +00:00
|
|
|
|
|
|
|
# Set the timeout back to the value it had when we were called.
|
1996-08-06 01:18:18 +00:00
|
|
|
set timeout $oldtimeout
|
|
|
|
verbose "Timeout is now $timeout seconds" 2
|
1994-06-07 01:57:15 +00:00
|
|
|
|
|
|
|
# Restart gdb in case next test expects it to be started already.
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
# Find a pathname to a file that we would execute if the shell was asked
|
|
|
|
# to run $arg using the current PATH.
|
|
|
|
|
|
|
|
proc find_gdb { arg } {
|
|
|
|
|
|
|
|
# If the arg directly specifies an existing executable file, then
|
|
|
|
# simply use it.
|
|
|
|
|
|
|
|
if [file executable $arg] then {
|
|
|
|
return $arg
|
|
|
|
}
|
|
|
|
|
|
|
|
set result [which $arg]
|
|
|
|
if [string match "/" [ string range $result 0 0 ]] then {
|
|
|
|
return $result
|
|
|
|
}
|
|
|
|
|
|
|
|
# If everything fails, just return the unqualified pathname as default
|
|
|
|
# and hope for best.
|
|
|
|
|
|
|
|
return $arg
|
|
|
|
}
|
|
|
|
|
|
|
|
# Run the test with self.
|
1997-01-29 09:40:31 +00:00
|
|
|
# Copy the file executable file in case this OS doesn't like to edit its own
|
1994-06-07 01:57:15 +00:00
|
|
|
# text space.
|
|
|
|
|
|
|
|
set GDB_FULLPATH [find_gdb $GDB]
|
|
|
|
|
|
|
|
# Remove any old copy lying around.
|
1997-02-03 20:36:39 +00:00
|
|
|
remote_file host delete x$tool
|
1997-01-29 09:40:31 +00:00
|
|
|
|
|
|
|
gdb_start
|
1997-02-03 20:36:39 +00:00
|
|
|
set file [remote_download host $GDB_FULLPATH x$tool]
|
1997-01-29 09:40:31 +00:00
|
|
|
set result [test_with_self $file];
|
1997-02-03 20:36:39 +00:00
|
|
|
gdb_exit;
|
|
|
|
catch "remote_file host delete $file";
|
1997-01-29 09:40:31 +00:00
|
|
|
|
|
|
|
if {$result <0} then {
|
|
|
|
warning "Couldn't test self"
|
|
|
|
return -1
|
1994-06-07 01:57:15 +00:00
|
|
|
}
|