forked from Imagelibrary/binutils-gdb
Initial creation of sourceware repository
This commit is contained in:
46
gdb/testsuite/gdb.base/Makefile.in
Normal file
46
gdb/testsuite/gdb.base/Makefile.in
Normal file
@@ -0,0 +1,46 @@
|
||||
VPATH = @srcdir@
|
||||
srcdir = @srcdir@
|
||||
|
||||
EXECUTABLES = all-types bitfields break \
|
||||
call-ar-st call-rt-st call-strs callfuncs callfuncs2 commands \
|
||||
compiler condbreak constvars coremaker display \
|
||||
ending-run exprs funcargs int-type interrupt \
|
||||
jump langs \
|
||||
list long_long \
|
||||
mips_pro miscexprs nodebug opaque pointers pointers2 printcmds ptype \
|
||||
recurse reread reread1 restore return run \
|
||||
scope section_command setshow setvar \
|
||||
shmain sigall signals smoke \
|
||||
solib so-impl-ld so-indr-cl \
|
||||
step-test structs structs2 twice-tmp varargs watchpoint whatis
|
||||
|
||||
# uuencoded format to avoid SCCS/RCS problems with binary files.
|
||||
CROSS_EXECUTABLES = i486-elf i860-elf m68k-elf m68k-aout m68k-aout2 \
|
||||
mips-ecoff sparc-aout sparc-elf
|
||||
|
||||
MISCELLANEOUS = coremmap.data shr1.sl shr2.sl solib1.sl solib2.sl
|
||||
|
||||
all:
|
||||
@echo "Nothing to be done for all..."
|
||||
|
||||
info:
|
||||
install-info:
|
||||
dvi:
|
||||
install:
|
||||
uninstall: force
|
||||
installcheck:
|
||||
check:
|
||||
|
||||
clean mostlyclean:
|
||||
-rm -f *~ *.o a.out xgdb *.x $(CROSS_EXECUTABLES) *.ci *.tmp
|
||||
-rm -f core core.coremaker coremaker.core corefile $(EXECUTABLES)
|
||||
-rm -f $(MISCELLANEOUS) twice-tmp.c
|
||||
|
||||
distclean maintainer-clean realclean: clean
|
||||
-rm -f *~ core
|
||||
-rm -f Makefile config.status config.log
|
||||
-rm -f *-init.exp
|
||||
-rm -fr *.log summary detail *.plog *.sum *.psum site.*
|
||||
|
||||
Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in
|
||||
$(SHELL) ./config.status --recheck
|
||||
13
gdb/testsuite/gdb.base/README
Normal file
13
gdb/testsuite/gdb.base/README
Normal file
@@ -0,0 +1,13 @@
|
||||
Information about the various executables found in this test:
|
||||
|
||||
BFD CPU Objfile
|
||||
Executable Target Type Type Info about compilation machine
|
||||
---------- ------ ---- ------- -------------------------------
|
||||
i486-elf elf-little i486 ELF NCR 3000, /usr/ccs/ATT/cc
|
||||
i860-elf elf-big i860 ELF Stratus
|
||||
m68k-elf elf-big m68k ELF Amiga 3000 UX, /usr/ccs/bin/cc
|
||||
m68k-aout a.out-newsos3 m68k a.out Sony NEWS
|
||||
m68k-aout2 a.out-sunos-big m68k a.out SunOS 4.1, gcc cygnus-2.0.1
|
||||
sparc-aout a.out-sunos-big sparc a.out Sun 4, SunOS 4.1.1, gcc 2.1
|
||||
sparc-elf elf-big sparc ELF Sun 4, Solaris 1.0, gcc 2.0.2
|
||||
mips-ecoff ecoff-bigmips mips ecoff IRIX 4.0.1
|
||||
426
gdb/testsuite/gdb.base/a1-selftest.exp
Normal file
426
gdb/testsuite/gdb.base/a1-selftest.exp
Normal file
@@ -0,0 +1,426 @@
|
||||
# Copyright (C) 1988, 1990, 1991, 1992, 1994, 1997 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# 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 {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
# are we on a target board
|
||||
if [is_remote target] {
|
||||
return
|
||||
}
|
||||
|
||||
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"
|
||||
return -1
|
||||
}
|
||||
|
||||
# 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 {} {
|
||||
global gdb_prompt
|
||||
global srcdir
|
||||
|
||||
gdb_reinitialize_dir $srcdir/..
|
||||
|
||||
for {set count 0} {$count < 20} {incr count} {
|
||||
send_gdb "list\n"
|
||||
gdb_expect {
|
||||
-re ".*symarg = NULL.*$gdb_prompt $" {
|
||||
set description "step over symarg initialization"
|
||||
set command "step"
|
||||
}
|
||||
-re ".*execarg = NULL.*$gdb_prompt $" {
|
||||
set description "step over execarg initialization"
|
||||
set command "step"
|
||||
}
|
||||
-re ".*corearg = NULL.*$gdb_prompt $" {
|
||||
set description "step over corearg initialization"
|
||||
set command "step"
|
||||
}
|
||||
-re ".*cdarg = NULL.*$gdb_prompt $" {
|
||||
set description "step over cdarg initialization"
|
||||
set command "step"
|
||||
}
|
||||
-re ".*ttyarg = NULL.*$gdb_prompt $" {
|
||||
set description "step over ttyarg initialization"
|
||||
set command "step"
|
||||
}
|
||||
-re ".*time_at_startup = get_run_time.*$gdb_prompt $" {
|
||||
set description "next over get_run_time and everything it calls"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*START_PROGRESS.*$gdb_prompt $" {
|
||||
set description "next over START_PROGRESS and everything it calls"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*mac_init.*$gdb_prompt $" {
|
||||
set description "next over mac_init and everything it calls"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*init_malloc.*$gdb_prompt $" {
|
||||
set description "next over init_malloc and everything it calls"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*count . 0x3.*$gdb_prompt $" {
|
||||
set description "next over conditional stack alignment code 1"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*if .i != 0.*$gdb_prompt $" {
|
||||
set description "next over conditional stack alignment code 2"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*alloca .i - 4.*$gdb_prompt $" {
|
||||
set description "next over conditional stack alignment alloca"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*SET_TOP_LEVEL.*$gdb_prompt $" {
|
||||
set description "next over SET_TOP_LEVEL call"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*cmdsize = 1.*$gdb_prompt $" {
|
||||
set description "step over cmdsize initialization"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*cmdarg = .* xmalloc.*$gdb_prompt $" {
|
||||
set description "next over cmdarg initialization via xmalloc"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*ncmd = 0.*$gdb_prompt $" {
|
||||
set description "next over ncmd initialization"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*dirsize = 1.*$gdb_prompt $" {
|
||||
set description "next over dirsize initialization"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*dirarg = .* xmalloc.*$gdb_prompt $" {
|
||||
return
|
||||
}
|
||||
-re "\[ \t\]+\{\r\n$gdb_prompt $" {
|
||||
setup_xfail "mips-*-irix5*"
|
||||
fail "$description ended up at odd location"
|
||||
}
|
||||
-re ".*main.c.*No such file or directory.*$gdb_prompt $" {
|
||||
setup_xfail "rs6000-*-aix3*"
|
||||
fail "must be able to list source lines"
|
||||
return
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "unknown source line after $description"
|
||||
return
|
||||
}
|
||||
default {
|
||||
fail "unknown source line near main"
|
||||
return
|
||||
}
|
||||
}
|
||||
send_gdb "$command\n"
|
||||
gdb_expect {
|
||||
-re ".*No such file or directory.\r\n$gdb_prompt $" {
|
||||
fail "$description (no source available)"
|
||||
}
|
||||
-re ".*A file or directory .* does not exist..\r\n$gdb_prompt $" {
|
||||
fail "$description (no source available)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
pass "$description"
|
||||
}
|
||||
timeout {
|
||||
fail "$description (timeout)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
proc test_with_self { executable } {
|
||||
global gdb_prompt
|
||||
global tool
|
||||
global det_file
|
||||
global decimal
|
||||
global timeout
|
||||
|
||||
# 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).
|
||||
# After gdb is started, set the timeout to 30 seconds for the duration
|
||||
# of this test, and then back to the original value.
|
||||
|
||||
set oldtimeout $timeout
|
||||
set timeout 600
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
if {[gdb_load $executable] <0} then {
|
||||
set timeout $oldtimeout
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
return -1
|
||||
}
|
||||
set timeout $oldtimeout
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
|
||||
# disassemble yourself
|
||||
gdb_test "x/10i main" \
|
||||
"x/10i.*main.*main.$decimal.*main.$decimal.*" \
|
||||
"Disassemble main"
|
||||
|
||||
# Set a breakpoint at main
|
||||
gdb_test "break main" \
|
||||
"Breakpoint.*at.* file.*, line.*" \
|
||||
"breakpoint in main"
|
||||
|
||||
# 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"
|
||||
}
|
||||
|
||||
# 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.
|
||||
gdb_test "set listsize 1" "" "set listsize to 1"
|
||||
|
||||
# run yourself
|
||||
# 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
|
||||
|
||||
set description "run until breakpoint at main"
|
||||
send_gdb "run -nw\n"
|
||||
gdb_expect {
|
||||
-re "Starting program.*Breakpoint \[0-9\]+,.*main .argc.*argv.* at .*main.c:.*$gdb_prompt $" {
|
||||
pass "$description"
|
||||
}
|
||||
-re "Starting program.*Breakpoint \[0-9\]+,.*main .argc.*argv.*$gdb_prompt $" {
|
||||
xfail "$description (line numbers scrambled?)"
|
||||
}
|
||||
-re "vfork: No more processes.*$gdb_prompt $" {
|
||||
fail "$description (out of virtual memory)"
|
||||
set timeout $oldtimeout
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
return -1
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "$description"
|
||||
set timeout $oldtimeout
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
return -1
|
||||
}
|
||||
timeout {
|
||||
fail "$description (timeout)"
|
||||
}
|
||||
}
|
||||
|
||||
set timeout $oldtimeout
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
|
||||
# do we have a version number ?
|
||||
send_gdb "print version\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]+ = +0x.*\[0-9.\]+.*$gdb_prompt $" {
|
||||
pass "printed version"
|
||||
}
|
||||
-re ".\[0-9\]+ = +.+ +0x.*\[0-9.\]+.*$gdb_prompt $" {
|
||||
pass "printed version with cast"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "printed version" }
|
||||
timeout { fail "(timeout) printed version" }
|
||||
}
|
||||
|
||||
do_steps_and_nexts
|
||||
|
||||
gdb_test "print \"foo\"" ".\[0-9\]+ = \"foo\"" "print a string"
|
||||
|
||||
# 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"
|
||||
send_gdb "step\n"
|
||||
gdb_expect {
|
||||
-re "xmalloc.*size=.*at.*utils.c.*$gdb_prompt $" {
|
||||
pass "$description"
|
||||
}
|
||||
-re ".*No such file or directory.\r\n$gdb_prompt $" {
|
||||
pass "$description (no source available)"
|
||||
}
|
||||
-re "A file or directory .* does not exist..\r\n$gdb_prompt $" {
|
||||
pass "$description (no source available)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "$description"
|
||||
}
|
||||
timeout {
|
||||
fail "$description (timeout)"
|
||||
}
|
||||
}
|
||||
|
||||
# start the "xgdb" process
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-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.*
|
||||
This GDB was configured as .*$gdb_prompt $"\
|
||||
{ pass "xgdb is at prompt" }
|
||||
-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..*
|
||||
GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$gdb_prompt $"\
|
||||
{ pass "xgdb is at prompt (obsolescent gdb)" }
|
||||
-re ".*$gdb_prompt $" { fail "xgdb is at prompt" }
|
||||
timeout { fail "(timeout) xgdb is at prompt" }
|
||||
}
|
||||
|
||||
# set xgdb prompt so we can tell which is which
|
||||
send_gdb "set prompt (xgdb) \n"
|
||||
gdb_expect {
|
||||
-re "\[(\]xgdb\[)\].*\[(\]xgdb\[)\] $" { pass "Set xgdb prompt" }
|
||||
-re ".*$gdb_prompt $" { fail "Set xgdb prompt" }
|
||||
default { fail "(timeout) Set xgdb prompt" }
|
||||
}
|
||||
|
||||
# kill the xgdb process
|
||||
set description "send ^C to child process"
|
||||
send_gdb "\003"
|
||||
gdb_expect {
|
||||
-re "Program received signal SIGINT.*$gdb_prompt $" {
|
||||
pass "$description"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "$description"
|
||||
}
|
||||
timeout {
|
||||
fail "$description (timeout)"
|
||||
}
|
||||
}
|
||||
|
||||
set description "send SIGINT signal to child process"
|
||||
send_gdb "signal SIGINT\n"
|
||||
gdb_expect {
|
||||
-re "Continuing with signal SIGINT.*$gdb_prompt $" {
|
||||
pass "$description"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "$description"
|
||||
}
|
||||
timeout {
|
||||
fail "$description (timeout)"
|
||||
}
|
||||
}
|
||||
|
||||
# get a stack trace
|
||||
#
|
||||
# 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.
|
||||
setup_xfail "i*86-pc-linuxaout-gnu" "hppa*-*-hpux*"
|
||||
set description "backtrace through signal handler"
|
||||
send_gdb "backtrace\n"
|
||||
gdb_expect {
|
||||
-re "#0.*read.*in main \\(.*\\) at .*main\\.c.*$gdb_prompt $" {
|
||||
pass "$description"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
# 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*"
|
||||
fail "$description"
|
||||
}
|
||||
timeout {
|
||||
fail "$description (timeout)"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Set the timeout back to the value it had when we were called.
|
||||
set timeout $oldtimeout
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
|
||||
# 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.
|
||||
# Copy the file executable file in case this OS doesn't like to edit its own
|
||||
# text space.
|
||||
|
||||
set GDB_FULLPATH [find_gdb $GDB]
|
||||
|
||||
# Remove any old copy lying around.
|
||||
remote_file host delete x$tool
|
||||
|
||||
gdb_start
|
||||
set file [remote_download host $GDB_FULLPATH x$tool]
|
||||
set result [test_with_self $file];
|
||||
gdb_exit;
|
||||
catch "remote_file host delete $file";
|
||||
|
||||
if {$result <0} then {
|
||||
warning "Couldn't test self"
|
||||
return -1
|
||||
}
|
||||
253
gdb/testsuite/gdb.base/a2-run.exp
Normal file
253
gdb/testsuite/gdb.base/a2-run.exp
Normal file
@@ -0,0 +1,253 @@
|
||||
# Copyright (C) 1988, 1990, 1991, 1992, 1994, 1997 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# 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)
|
||||
|
||||
# These tests don't work for targets can't take arguments...
|
||||
|
||||
if [target_info exists noargs] then {
|
||||
verbose "Skipping a2-run.exp because of noargs."
|
||||
return
|
||||
}
|
||||
|
||||
if [target_info exists gdb,noinferiorio] {
|
||||
verbose "Skipping a2-run.exp because of noinferiorio."
|
||||
return
|
||||
}
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
#
|
||||
# test running programs
|
||||
#
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile "run"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
# Run with no arguments.
|
||||
# On VxWorks this justs make sure the program was run.
|
||||
gdb_run_cmd
|
||||
|
||||
if [istarget "*-*-vxworks*"] then {
|
||||
set timeout 120
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
gdb_expect {
|
||||
"Program exited normally" {
|
||||
unresolved "run \"$testfile\" with no args"
|
||||
}
|
||||
-re "usage: factorial <number>" {
|
||||
pass "run \"$testfile\" with no args"
|
||||
}
|
||||
timeout {
|
||||
fail "(timeout) run \"$testfile\" with no args"
|
||||
}
|
||||
}
|
||||
set timeout 10
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
gdb_expect -re "$gdb_prompt $" {}
|
||||
} else {
|
||||
gdb_expect {
|
||||
-re ".*usage: factorial <number>.*Program exited with code 01.*$gdb_prompt $" {
|
||||
pass "run \"$testfile\" with no args"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "run \"$testfile\" with no args"
|
||||
verbose "expect_out is $expect_out(buffer)" 2
|
||||
}
|
||||
timeout {
|
||||
fail "(timeout) run \"$testfile\" no args"
|
||||
}
|
||||
}
|
||||
}
|
||||
# Now run with some arguments
|
||||
if [istarget "*-*-vxworks*"] then {
|
||||
send_gdb "run vxmain \"5\"\n"
|
||||
gdb_expect -re "run vxmain \"5\"\r\n" {}
|
||||
set timeout 120
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
gdb_expect {
|
||||
"Program exited normally" {
|
||||
unresolved "run \"$testfile\" with arg"
|
||||
}
|
||||
"120" {
|
||||
pass "run \"$testfile\" with arg"
|
||||
}
|
||||
timeout {
|
||||
fail "(timeout) run \"$testfile\" with arg"
|
||||
}
|
||||
}
|
||||
set timeout 10
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
gdb_expect -re "$gdb_prompt $" {}
|
||||
} else {
|
||||
setup_xfail "mips-idt-*" "arm-*-coff"
|
||||
gdb_run_cmd 5
|
||||
gdb_expect {
|
||||
-re ".*120.*$gdb_prompt $"\
|
||||
{ pass "run \"$testfile\" with arg" }
|
||||
-re ".*$gdb_prompt $" { fail "run \"$testfile\" with arg" }
|
||||
timeout { fail "(timeout) run \"$testfile\" with arg" }
|
||||
}
|
||||
}
|
||||
|
||||
# Run again with same arguments.
|
||||
setup_xfail "mips-idt-*"
|
||||
gdb_run_cmd
|
||||
|
||||
if [istarget "*-*-vxworks*"] then {
|
||||
set timeout 120
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
gdb_expect {
|
||||
"Program exited normally" {
|
||||
unresolved "run \"$testfile\" again with same args"
|
||||
}
|
||||
"120" { pass "run \"$testfile\" again with same args" }
|
||||
timeout { fail "(timeout) run \"$testfile\" again with same args" }
|
||||
}
|
||||
set timeout 10
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
gdb_expect -re "$gdb_prompt $" {}
|
||||
} else {
|
||||
setup_xfail "arm-*-coff"
|
||||
gdb_expect {
|
||||
-re ".*120.*$gdb_prompt $"\
|
||||
{ pass "run \"$testfile\" again with same args" }
|
||||
-re ".*$gdb_prompt $" { fail "run \"$testfile\" again with same args" }
|
||||
timeout { fail "(timeout) run \"$testfile\" again with same args" }
|
||||
}
|
||||
}
|
||||
|
||||
# Use "set args" command to specify no arguments as default and run again.
|
||||
if [istarget "*-*-vxworks*"] then {
|
||||
send_gdb "set args main\n"
|
||||
} else {
|
||||
send_gdb "set args\n"
|
||||
}
|
||||
gdb_expect -re "$gdb_prompt $"
|
||||
|
||||
gdb_run_cmd
|
||||
|
||||
if [istarget "*-*-vxworks*"] then {
|
||||
set timeout 120
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
gdb_expect {
|
||||
"Program exited normally" {
|
||||
unresolved "run after setting args to nil"
|
||||
}
|
||||
"usage: factorial <number>" {
|
||||
pass "run after setting args to nil"
|
||||
}
|
||||
timeout {
|
||||
fail "(timeout) run after setting args to nil"
|
||||
}
|
||||
}
|
||||
set timeout 10
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
gdb_expect -re "$gdb_prompt $" {}
|
||||
} else {
|
||||
gdb_expect {
|
||||
-re ".*usage: factorial <number>.*$gdb_prompt $" {
|
||||
pass "run after setting args to nil"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "run after setting args to nil"
|
||||
}
|
||||
timeout {
|
||||
fail "(timeout) run after setting args to nil"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Use "set args" command to specify an argument and run again.
|
||||
setup_xfail "mips-idt-*"
|
||||
if [istarget "*-*-vxworks*"] then {
|
||||
send_gdb "set args vxmain \"6\"\n"
|
||||
} else {
|
||||
send_gdb "set args 6\n"
|
||||
}
|
||||
gdb_expect -re "$gdb_prompt $"
|
||||
gdb_run_cmd
|
||||
|
||||
if [istarget "*-*-vxworks*"] then {
|
||||
set timeout 120
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
gdb_expect {
|
||||
"Program exited normally" {
|
||||
unresolved "run \"$testfile\" again after setting args"
|
||||
}
|
||||
"720" {
|
||||
pass "run \"$testfile\" again after setting args"
|
||||
}
|
||||
timeout {
|
||||
fail "(timeout) run \"$testfile\" again after setting args"
|
||||
}
|
||||
}
|
||||
set timeout 10
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
gdb_expect -re "$gdb_prompt $" {}
|
||||
} else {
|
||||
setup_xfail "arm-*-coff"
|
||||
gdb_expect {
|
||||
-re ".*720.*$gdb_prompt $" {
|
||||
pass "run \"$testfile\" again after setting args"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "run \"$testfile\" again after setting args"
|
||||
}
|
||||
timeout {
|
||||
fail "(timeout) run \"$testfile\" again after setting args"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# GOAL: Test that shell is being used with "run". For remote debugging
|
||||
# targets, there is no guarantee that a "shell" (whatever that is) is used.
|
||||
if [isnative] then {
|
||||
send_gdb "run `echo 8`\n"
|
||||
gdb_expect {
|
||||
-re "Starting program.*40320.*$gdb_prompt $" {
|
||||
pass "run \"$testfile\" with shell"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "run \"$testfile\" with shell"
|
||||
}
|
||||
timeout {
|
||||
fail "(timeout) run \"$testfile\" with shell"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Reset the default arguments for VxWorks
|
||||
if [istarget "*-*-vxworks*"] then {
|
||||
send_gdb "set args main\n"
|
||||
gdb_expect -re ".*$gdb_prompt $" {}
|
||||
}
|
||||
467
gdb/testsuite/gdb.base/all-bin.exp
Normal file
467
gdb/testsuite/gdb.base/all-bin.exp
Normal file
@@ -0,0 +1,467 @@
|
||||
# Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# This file was written by Elena Zannoni (ezannoni@cygnus.com)
|
||||
|
||||
# This file is part of the gdb testsuite
|
||||
#
|
||||
# tests for arithmetic, logical and relational operators
|
||||
# with mixed types
|
||||
#
|
||||
|
||||
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
#
|
||||
# test running programs
|
||||
#
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile "all-types"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
|
||||
#
|
||||
# set it up at a breakpoint so we can play with the variable values
|
||||
#
|
||||
|
||||
if ![runto_main] then {
|
||||
perror "couldn't run to breakpoint"
|
||||
continue
|
||||
}
|
||||
|
||||
gdb_test "next" "return 0;" "continuing after dummy()"
|
||||
|
||||
send_gdb "print v_int+v_char\n"
|
||||
gdb_expect {
|
||||
-re ".*71.*$gdb_prompt $" {
|
||||
pass "print value of v_int+v_char"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int+v_char" }
|
||||
timeout { fail "(timeout) print value of v_int+v_char" }
|
||||
}
|
||||
|
||||
send_gdb "print v_int+v_short\n"
|
||||
gdb_expect {
|
||||
-re ".*9.*$gdb_prompt $" {
|
||||
pass "print value of v_int+v_short"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int+v_short" }
|
||||
timeout { fail "(timeout) print value of v_int+v_short" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int+v_signed_char\n"
|
||||
gdb_expect {
|
||||
-re ".*72.*$gdb_prompt $" {
|
||||
pass "print value of v_int+v_signed_char"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int+v_signed_char" }
|
||||
timeout { fail "(timeout) print value of v_int+v_signed_char" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int+v_unsigned_char\n"
|
||||
gdb_expect {
|
||||
-re ".*73.*$gdb_prompt $" {
|
||||
pass "print value of v_int+v_unsigned_char"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int+v_unsigned_char" }
|
||||
timeout { fail "(timeout) print value of v_int+v_unsigned_char" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int+v_signed_short\n"
|
||||
gdb_expect {
|
||||
-re ".*10.*$gdb_prompt $" {
|
||||
pass "print value of v_int+v_signed_short"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int+v_signed_short" }
|
||||
timeout { fail "(timeout) print value of v_int+v_signed_short" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int+v_unsigned_short\n"
|
||||
gdb_expect {
|
||||
-re ".*11.*$gdb_prompt $" {
|
||||
pass "print value of v_int+v_unsigned_short"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int+v_unsigned_short" }
|
||||
timeout { fail "(timeout) print value of v_int+v_unsigned_short" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int+v_signed_int\n"
|
||||
gdb_expect {
|
||||
-re ".*13.*$gdb_prompt $" {
|
||||
pass "print value of v_int+v_signed_int"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int+v_signed_int" }
|
||||
timeout { fail "(timeout) print value of v_int+v_signed_int" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int+v_unsigned_int\n"
|
||||
gdb_expect {
|
||||
-re ".*14.*$gdb_prompt $" {
|
||||
pass "print value of v_int+v_unsigned_int"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int+v_unsigned_int" }
|
||||
timeout { fail "(timeout) print value of v_int+v_unsigned_int" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int+v_long\n"
|
||||
gdb_expect {
|
||||
-re ".*15.*$gdb_prompt $" {
|
||||
pass "print value of v_int+v_long"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int+v_long" }
|
||||
timeout { fail "(timeout) print value of v_int+v_long" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int+v_signed_long\n"
|
||||
gdb_expect {
|
||||
-re ".*16.*$gdb_prompt $" {
|
||||
pass "print value of v_int+v_signed_long"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int+v_signed_long" }
|
||||
timeout { fail "(timeout) print value of v_int+v_signed_long" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int+v_unsigned_long\n"
|
||||
gdb_expect {
|
||||
-re ".*17.*$gdb_prompt $" {
|
||||
pass "print value of v_int+v_unsigned_long"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int+v_unsigned_long" }
|
||||
timeout { fail "(timeout) print value of v_int+v_unsigned_long" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int+v_float\n"
|
||||
gdb_expect {
|
||||
-re ".*106.34343.*$gdb_prompt $" {
|
||||
pass "print value of v_int+v_float"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int+v_float" }
|
||||
timeout { fail "(timeout) print value of v_int+v_float" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int+v_double\n"
|
||||
gdb_expect {
|
||||
-re ".*206.56565.*$gdb_prompt $" {
|
||||
pass "print value of v_int+v_double"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int+v_double" }
|
||||
timeout { fail "(timeout) print value of v_int+" }
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# test the relational operators with mixed types
|
||||
#
|
||||
|
||||
send_gdb "print v_int <= v_char\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_char"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_char" }
|
||||
timeout { fail "(timeout) print value of v_int<=v_char" }
|
||||
}
|
||||
|
||||
send_gdb "print v_int <= v_short\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_short"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_short" }
|
||||
timeout { fail "(timeout) print value of v_int<=v_short" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int <= v_signed_char\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_signed_char"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_signed_char" }
|
||||
timeout { fail "(timeout) print value of v_int<=v_signed_char" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int <= v_unsigned_char\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_unsigned_char"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_unsigned_char" }
|
||||
timeout { fail "(timeout) print value of v_int<=v_unsigned_char" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int <= v_signed_short\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_signed_short"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_signed_short" }
|
||||
timeout { fail "(timeout) print value of v_int<=v_signed_short" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int <= v_unsigned_short\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_unsigned_short"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_unsigned_short" }
|
||||
timeout { fail "(timeout) print value of v_int<=v_unsigned_short" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int <= v_signed_int\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_signed_int"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_signed_int" }
|
||||
timeout { fail "(timeout) print value of v_int<=v_signed_int" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int <= v_unsigned_int\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_unsigned_int"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_unsigned_int" }
|
||||
timeout { fail "(timeout) print value of v_int<=v_unsigned_int" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int <= v_long\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_long"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_long" }
|
||||
timeout { fail "(timeout) print value of v_int<=v_long" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int <= v_signed_long\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_signed_long"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_signed_long" }
|
||||
timeout { fail "(timeout) print value of v_int<=v_signed_long" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int <= v_unsigned_long\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_unsigned_long"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_unsigned_long" }
|
||||
timeout { fail "(timeout) print value of v_int<=v_unsigned_long" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int <= v_float\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_float"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_float" }
|
||||
timeout { fail "(timeout) print value of v_int<=v_float" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int <= v_double\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of v_int<=v_double"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int<=v_double" }
|
||||
timeout { fail "(timeout) print value of v_int<=v_double" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# test the logical operators with mixed types
|
||||
#
|
||||
|
||||
gdb_test "set variable v_char=0" "" "set v_char=0"
|
||||
gdb_test "set variable v_double=0.0" "" "set v_double=0"
|
||||
gdb_test "set variable v_unsigned_long=0" "" "set v_unsigned_long=0"
|
||||
|
||||
send_gdb "print v_int && v_char\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_char"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_char" }
|
||||
timeout { fail "(timeout) print value of v_int&&v_char" }
|
||||
}
|
||||
|
||||
send_gdb "print v_int && v_short\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_short"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_short" }
|
||||
timeout { fail "(timeout) print value of v_int&&v_short" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int && v_signed_char\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_signed_char"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_signed_char" }
|
||||
timeout { fail "(timeout) print value of v_int&&v_signed_char" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int && v_unsigned_char\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_unsigned_char"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_unsigned_char" }
|
||||
timeout { fail "(timeout) print value of v_int&&v_unsigned_char" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int && v_signed_short\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_signed_short"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_signed_short" }
|
||||
timeout { fail "(timeout) print value of v_int&&v_signed_short" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int && v_unsigned_short\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_unsigned_short"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_unsigned_short" }
|
||||
timeout { fail "(timeout) print value of v_int&&v_unsigned_short" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int && v_signed_int\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_signed_int"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_signed_int" }
|
||||
timeout { fail "(timeout) print value of v_int&&v_signed_int" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int && v_unsigned_int\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_unsigned_int"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_unsigned_int" }
|
||||
timeout { fail "(timeout) print value of v_int&&v_unsigned_int" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int && v_long\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_long"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_long" }
|
||||
timeout { fail "(timeout) print value of v_int&&v_long" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int && v_signed_long\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_signed_long"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_signed_long" }
|
||||
timeout { fail "(timeout) print value of v_int&&v_signed_long" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int && v_unsigned_long\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_unsigned_long"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_unsigned_long" }
|
||||
timeout { fail "(timeout) print value of v_int&&v_unsigned_long" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int && v_float\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_float"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_float" }
|
||||
timeout { fail "(timeout) print value of v_int&&v_float" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print v_int && v_double\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of v_int&&v_double"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of v_int&&v_double" }
|
||||
timeout { fail "(timeout) print value of v_int&&v_double" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
62
gdb/testsuite/gdb.base/all-types.c
Normal file
62
gdb/testsuite/gdb.base/all-types.c
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* the basic C types.
|
||||
*/
|
||||
|
||||
#if !defined (__STDC__) && !defined (_AIX)
|
||||
#define signed /**/
|
||||
#endif
|
||||
|
||||
char v_char;
|
||||
signed char v_signed_char;
|
||||
unsigned char v_unsigned_char;
|
||||
|
||||
short v_short;
|
||||
signed short v_signed_short;
|
||||
unsigned short v_unsigned_short;
|
||||
|
||||
int v_int;
|
||||
signed int v_signed_int;
|
||||
unsigned int v_unsigned_int;
|
||||
|
||||
long v_long;
|
||||
signed long v_signed_long;
|
||||
unsigned long v_unsigned_long;
|
||||
|
||||
float v_float;
|
||||
double v_double;
|
||||
|
||||
int main ()
|
||||
{
|
||||
extern void dummy();
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
breakpoint();
|
||||
#endif
|
||||
dummy();
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
void dummy()
|
||||
{
|
||||
/* Some linkers (e.g. on AIX) remove unreferenced variables,
|
||||
so make sure to reference them. */
|
||||
v_char = 'A';
|
||||
v_signed_char = 'B';
|
||||
v_unsigned_char = 'C';
|
||||
|
||||
v_short = 3;
|
||||
v_signed_short = 4;
|
||||
v_unsigned_short = 5;
|
||||
|
||||
v_int = 6;
|
||||
v_signed_int = 7;
|
||||
v_unsigned_int = 8;
|
||||
|
||||
v_long = 9;
|
||||
v_signed_long = 10;
|
||||
v_unsigned_long = 11;
|
||||
|
||||
v_float = 100.343434;
|
||||
v_double = 200.565656;
|
||||
}
|
||||
375
gdb/testsuite/gdb.base/arithmet.exp
Normal file
375
gdb/testsuite/gdb.base/arithmet.exp
Normal file
@@ -0,0 +1,375 @@
|
||||
# Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# This file was written by Elena Zannoni (ezannoni@cygnus.com)
|
||||
|
||||
# This file is part of the gdb testsuite
|
||||
#
|
||||
# tests for correctness of arithmetic operators, associativity and precedence
|
||||
# with integer type variables
|
||||
#
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
#
|
||||
# test running programs
|
||||
#
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile "int-type"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
|
||||
#
|
||||
# set it up at a breakpoint so we can play with the variable values
|
||||
#
|
||||
|
||||
if ![runto_main] then {
|
||||
perror "couldn't run to breakpoint"
|
||||
continue
|
||||
}
|
||||
|
||||
#
|
||||
# test expressions with "int" types
|
||||
#
|
||||
|
||||
gdb_test "set variable x=14" "" "set variable x=14"
|
||||
gdb_test "set variable y=2" "" "set variable y=2"
|
||||
gdb_test "set variable z=2" "" "set variable z=2"
|
||||
gdb_test "set variable w=3" "" "set variable w=3"
|
||||
|
||||
send_gdb "print x\n"
|
||||
gdb_expect {
|
||||
-re ".*14.*$gdb_prompt $" {
|
||||
pass "print value of x"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x" }
|
||||
timeout { fail "(timeout) print value of x" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print y\n"
|
||||
gdb_expect {
|
||||
-re ".*2.*$gdb_prompt $" {
|
||||
pass "print value of y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of y" }
|
||||
timeout { fail "(timeout) print value of y" }
|
||||
}
|
||||
|
||||
send_gdb "print z\n"
|
||||
gdb_expect {
|
||||
-re ".*2.*$gdb_prompt $" {
|
||||
pass "print value of z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of z" }
|
||||
timeout { fail "(timeout) print value of z" }
|
||||
}
|
||||
|
||||
send_gdb "print w\n"
|
||||
gdb_expect {
|
||||
-re ".*3.*$gdb_prompt $" {
|
||||
pass "print value of w"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of w" }
|
||||
timeout { fail "(timeout) print value of w" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
send_gdb "print x+y\n"
|
||||
gdb_expect {
|
||||
-re ".*16.*$gdb_prompt $" {
|
||||
pass "print value of x+y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x+y" }
|
||||
timeout { fail "(timeout) print value of x+y" }
|
||||
}
|
||||
|
||||
send_gdb "print x-y\n"
|
||||
gdb_expect {
|
||||
-re ".*12.*$gdb_prompt $" {
|
||||
pass "print value of x-y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x-y" }
|
||||
timeout { fail "(timeout) print value of x-y" }
|
||||
}
|
||||
|
||||
send_gdb "print x*y\n"
|
||||
gdb_expect {
|
||||
-re ".*28.*$gdb_prompt $" {
|
||||
pass "print value of x*y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x*y" }
|
||||
timeout { fail "(timeout) print value of x*y" }
|
||||
}
|
||||
|
||||
send_gdb "print x/y\n"
|
||||
gdb_expect {
|
||||
-re ".*7.*$gdb_prompt $" {
|
||||
pass "print value of x/y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x/y" }
|
||||
timeout { fail "(timeout) print value of x/y" }
|
||||
}
|
||||
|
||||
send_gdb "print x%y\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of x%y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x%y" }
|
||||
timeout { fail "(timeout) print value of x%y" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Test associativity of +, -, *, % ,/
|
||||
|
||||
|
||||
send_gdb "print x+y+z\n"
|
||||
gdb_expect {
|
||||
-re ".*18.*$gdb_prompt $" {
|
||||
pass "print value of x+y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x+y" }
|
||||
timeout { fail "(timeout) print value of x+y" }
|
||||
}
|
||||
|
||||
send_gdb "print x-y-z\n"
|
||||
gdb_expect {
|
||||
-re ".*10.*$gdb_prompt $" {
|
||||
pass "print value of x-y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x-y" }
|
||||
timeout { fail "(timeout) print value of x-y" }
|
||||
}
|
||||
|
||||
send_gdb "print x*y*z\n"
|
||||
gdb_expect {
|
||||
-re ".*56.*$gdb_prompt $" {
|
||||
pass "print value of x*y"
|
||||
}
|
||||
-re 8".*$gdb_prompt $" { fail "print value of x*y" }
|
||||
timeout { fail "(timeout) print value of x*y" }
|
||||
}
|
||||
|
||||
send_gdb "print x/y/z\n"
|
||||
gdb_expect {
|
||||
-re ".*3.*$gdb_prompt $" {
|
||||
pass "print value of x/y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x/y" }
|
||||
timeout { fail "(timeout) print value of x/y" }
|
||||
}
|
||||
|
||||
send_gdb "print x%y%z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of x%y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x%y" }
|
||||
timeout { fail "(timeout) print value of x%y" }
|
||||
}
|
||||
|
||||
|
||||
# test precedence rules on pairs of arithmetic operators
|
||||
|
||||
gdb_test "set variable x=10" "" "set variable x"
|
||||
gdb_test "set variable y=4" "" "set variable y"
|
||||
gdb_test "set variable z=2" "" "set variable z"
|
||||
|
||||
|
||||
|
||||
# x y z
|
||||
# 10 4 2
|
||||
send_gdb "print x+y-z\n"
|
||||
gdb_expect {
|
||||
-re ".*12.*$gdb_prompt $" {
|
||||
pass "print value of x+y-z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x+y-z" }
|
||||
timeout { fail "(timeout) print value of x+y-z" }
|
||||
}
|
||||
|
||||
# 10 4 2
|
||||
send_gdb "print x+y*z\n"
|
||||
gdb_expect {
|
||||
-re ".*18.*$gdb_prompt $" {
|
||||
pass "print value of x+y*z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x+y*z" }
|
||||
timeout { fail "(timeout) print value of x+y*z" }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable z=3" "" "set variable z"
|
||||
|
||||
|
||||
# 10 4 3
|
||||
send_gdb "print x+y%z\n"
|
||||
gdb_expect {
|
||||
-re ".*11.*$gdb_prompt $" {
|
||||
pass "print value of x+y%z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x+y%z" }
|
||||
timeout { fail "(timeout) print value of x+y%z" }
|
||||
}
|
||||
|
||||
|
||||
# 10 4 3
|
||||
send_gdb "print x+y/z\n"
|
||||
gdb_expect {
|
||||
-re ".*11.*$gdb_prompt $" {
|
||||
pass "print value of x+y/z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x+y/z" }
|
||||
timeout { fail "(timeout) print value of x+y/z" }
|
||||
}
|
||||
|
||||
gdb_test "set variable z=2" "" " set variable z"
|
||||
|
||||
|
||||
# 10 4 2
|
||||
send_gdb "print x-y*z\n"
|
||||
gdb_expect {
|
||||
-re ".*2.*$gdb_prompt $" {
|
||||
pass "print value of x-y*z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x-y*z" }
|
||||
timeout { fail "(timeout) print value of x-y*z" }
|
||||
}
|
||||
|
||||
# 10 4 2
|
||||
send_gdb "print x-y%z\n"
|
||||
gdb_expect {
|
||||
-re ".*10.*$gdb_prompt $" {
|
||||
pass "print value of x-y%z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x-y%z" }
|
||||
timeout { fail "(timeout) print value of x-y%z" }
|
||||
}
|
||||
|
||||
|
||||
# 10 4 2
|
||||
send_gdb "print x-y/z\n"
|
||||
gdb_expect {
|
||||
-re ".*8.*$gdb_prompt $" {
|
||||
pass "print value of x-y/z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x-y/z" }
|
||||
timeout { fail "(timeout) print value of x-y/z" }
|
||||
}
|
||||
|
||||
# 10 4 2
|
||||
send_gdb "print x*y/z\n"
|
||||
gdb_expect {
|
||||
-re ".*20.*$gdb_prompt $" {
|
||||
pass "print value of x*y/z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x*y/z" }
|
||||
timeout { fail "(timeout) print value of x*y/z" }
|
||||
}
|
||||
|
||||
gdb_test "set variable z=3" "" "set z to 3"
|
||||
|
||||
# 10 4 3
|
||||
send_gdb "print x*y%z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of x*y%z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x*y%z" }
|
||||
timeout { fail "(timeout) print value of x*y%z" }
|
||||
}
|
||||
|
||||
# 10 4 3
|
||||
send_gdb "print x/y%z\n"
|
||||
gdb_expect {
|
||||
-re ".*2\r\n$gdb_prompt $" {
|
||||
pass "print value of x/y%z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x/y%z" }
|
||||
timeout { fail "(timeout) print value of x/y%z" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
# test use of parenthesis to enforce different order of evaluation
|
||||
|
||||
# 10 4 3
|
||||
send_gdb "print x-(y+z)\n"
|
||||
gdb_expect {
|
||||
-re ".*3\r\n$gdb_prompt $" {
|
||||
pass "print value of x-(y+z)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x-(y+z)" }
|
||||
timeout { fail "(timeout) print value of x-(y+z)" }
|
||||
}
|
||||
|
||||
|
||||
# 10 4 3
|
||||
send_gdb "print x/(y*z)\n"
|
||||
gdb_expect {
|
||||
-re ".*0\r\n$gdb_prompt $" {
|
||||
pass "print value of x/(y*z)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x/(y*z)" }
|
||||
timeout { fail "(timeout) print value of x/(y*z)" }
|
||||
}
|
||||
|
||||
# 10 4 3
|
||||
send_gdb "print x-(y/z)\n"
|
||||
gdb_expect {
|
||||
-re ".*9\r\n$gdb_prompt $" {
|
||||
pass "print value of x-(y/z)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x-(y/z)" }
|
||||
timeout { fail "(timeout) print value of x-(y/z)" }
|
||||
}
|
||||
|
||||
|
||||
# 10 4 3
|
||||
send_gdb "print (x+y)*z\n"
|
||||
gdb_expect {
|
||||
-re ".*42\r\n$gdb_prompt $" {
|
||||
pass "print value of (x+y)*z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (x+y)*z" }
|
||||
timeout { fail "(timeout) print value of (x+y)*z" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
446
gdb/testsuite/gdb.base/assign.exp
Normal file
446
gdb/testsuite/gdb.base/assign.exp
Normal file
@@ -0,0 +1,446 @@
|
||||
# Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# This file was written by Elena Zannoni (ezannoni@cygnus.com)
|
||||
|
||||
# This file is part of the gdb testsuite
|
||||
#
|
||||
# tests for all the assignemnt operators
|
||||
# with mixed types and with int type variables
|
||||
#
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
#
|
||||
# test running programs
|
||||
#
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile "all-types"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
|
||||
#
|
||||
# set it up at a breakpoint so we can play with the variable values
|
||||
#
|
||||
|
||||
if ![runto_main] then {
|
||||
perror "couldn't run to breakpoint"
|
||||
continue
|
||||
}
|
||||
|
||||
gdb_test "next" "return 0;" "continuing after dummy()"
|
||||
|
||||
send_gdb "print v_int=57\n"
|
||||
gdb_expect {
|
||||
-re ".*57.*$gdb_prompt $" {
|
||||
send_gdb "print v_int\n"
|
||||
gdb_expect {
|
||||
-re ".*57.*$gdb_prompt $" {
|
||||
pass "v_int=57"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int=57" }
|
||||
timeout { fail "(timeout) v_int=57" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int=57" }
|
||||
timeout { fail "(timeout) v_int=57" }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable v_int = 6" "" "set v_int to 6"
|
||||
|
||||
|
||||
send_gdb "print v_int+=57\n"
|
||||
gdb_expect {
|
||||
-re ".*63.*$gdb_prompt $" {
|
||||
send_gdb "print v_int\n"
|
||||
gdb_expect {
|
||||
-re ".*63.*$gdb_prompt $" {
|
||||
pass "v_int+=57"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=57" }
|
||||
timeout { fail "(timeout) v_int+=57" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=57" }
|
||||
timeout { fail "(timeout) v_int+=57" }
|
||||
}
|
||||
|
||||
gdb_test "set variable v_int = 6" "" "set v_int to 6"
|
||||
|
||||
send_gdb "print v_int-=57\n"
|
||||
gdb_expect {
|
||||
-re ".*-51.*$gdb_prompt $" {
|
||||
send_gdb "print v_int\n"
|
||||
gdb_expect {
|
||||
-re ".*-51.*$gdb_prompt $" {
|
||||
pass "v_int-=57"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int-=57" }
|
||||
timeout { fail "(timeout) v_int-=57" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int-=57" }
|
||||
timeout { fail "(timeout) v_int-=57" }
|
||||
}
|
||||
|
||||
gdb_test "set variable v_int = 6" "" "set v_int to 6"
|
||||
|
||||
send_gdb "print v_int*=5\n"
|
||||
gdb_expect {
|
||||
-re ".*30.*$gdb_prompt $" {
|
||||
send_gdb "print v_int\n"
|
||||
gdb_expect {
|
||||
-re ".*30.*$gdb_prompt $" {
|
||||
pass "v_int*=5"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int*=5" }
|
||||
timeout { fail "(timeout) v_int*=5" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int*=5" }
|
||||
timeout { fail "(timeout) v_int*=5" }
|
||||
}
|
||||
|
||||
gdb_test "set variable v_int = 6" "" "set v_int to 6"
|
||||
|
||||
send_gdb "print v_int/=4\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
send_gdb "print v_int\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "v_int/=4"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int/=4" }
|
||||
timeout { fail "(timeout) v_int/=4" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int/=4" }
|
||||
timeout { fail "(timeout) v_int/=4" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
gdb_test "set variable v_int = 6" "" "set v_int to 6"
|
||||
|
||||
send_gdb "print v_int%=4\n"
|
||||
gdb_expect {
|
||||
-re ".*2.*$gdb_prompt $" {
|
||||
send_gdb "print v_int\n"
|
||||
gdb_expect {
|
||||
-re ".*2.*$gdb_prompt $" {
|
||||
pass "v_int%=4"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int%=4" }
|
||||
timeout { fail "(timeout) v_int%=4" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int%=4" }
|
||||
timeout { fail "(timeout) v_int%=4" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
gdb_test "set variable v_int = 6" "" "set v_int to 6"
|
||||
|
||||
|
||||
|
||||
send_gdb "print v_int+=v_char\n"
|
||||
gdb_expect {
|
||||
-re ".*71.*$gdb_prompt $" {
|
||||
send_gdb "print v_int\n"
|
||||
gdb_expect {
|
||||
-re ".*71.*$gdb_prompt $" {
|
||||
pass "v_int+=char"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_char" }
|
||||
timeout { fail "(timeout) v_int+=v_char" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_char" }
|
||||
timeout { fail "(timeout) v_int+=v_char" }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable v_int = 6" "" "set v_int to 6"
|
||||
|
||||
|
||||
|
||||
send_gdb "print v_int+=v_signed_char\n"
|
||||
gdb_expect {
|
||||
-re ".*72.*$gdb_prompt $" {
|
||||
send_gdb "print v_int\n"
|
||||
gdb_expect {
|
||||
-re ".*72.*$gdb_prompt $" {
|
||||
pass "v_int+=signed_char"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_signed_char" }
|
||||
timeout { fail "(timeout) v_int+=v_signed_char" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_signed_char" }
|
||||
timeout { fail "(timeout) v_int+=v_signed_char" }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable v_int = 6" "" "set v_int to 6"
|
||||
|
||||
|
||||
|
||||
send_gdb "print v_int+=v_unsigned_char\n"
|
||||
gdb_expect {
|
||||
-re ".*73.*$gdb_prompt $" {
|
||||
send_gdb "print v_int\n"
|
||||
gdb_expect {
|
||||
-re ".*73.*$gdb_prompt $" {
|
||||
pass "v_int+=unsigned_char"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_unsigned_char" }
|
||||
timeout { fail "(timeout) v_int+=v_unsigned_char" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_unsigned_char" }
|
||||
timeout { fail "(timeout) v_int+=v_unsigned_char" }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable v_int = 6" "" "set v_int to 6"
|
||||
|
||||
|
||||
|
||||
send_gdb "print v_int+=v_short\n"
|
||||
gdb_expect {
|
||||
-re ".*9.*$gdb_prompt $" {
|
||||
send_gdb "print v_int\n"
|
||||
gdb_expect {
|
||||
-re ".*9.*$gdb_prompt $" {
|
||||
pass "v_int+=short"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_short" }
|
||||
timeout { fail "(timeout) v_int+=v_short" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_short" }
|
||||
timeout { fail "(timeout) v_int+=v_short" }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable v_int = 6" "" "set v_int to 6"
|
||||
|
||||
|
||||
|
||||
send_gdb "print v_int+=v_signed_short\n"
|
||||
gdb_expect {
|
||||
-re ".*10.*$gdb_prompt $" {
|
||||
send_gdb "print v_int\n"
|
||||
gdb_expect {
|
||||
-re ".*10.*$gdb_prompt $" {
|
||||
pass "v_int+=signed_short"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_signed_short" }
|
||||
timeout { fail "(timeout) v_int+=v_signed_short" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_signed_short" }
|
||||
timeout { fail "(timeout) v_int+=v_signed_short" }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable v_int = 6" "" "set v_int to 6"
|
||||
|
||||
|
||||
|
||||
send_gdb "print v_int+=v_unsigned_short\n"
|
||||
gdb_expect {
|
||||
-re ".*11.*$gdb_prompt $" {
|
||||
send_gdb "print v_int\n"
|
||||
gdb_expect {
|
||||
-re ".*11.*$gdb_prompt $" {
|
||||
pass "v_int=+unsigned_short"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_unsigned_short" }
|
||||
timeout { fail "(timeout) v_int+=v_unsigned_short" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_unsigned_short" }
|
||||
timeout { fail "(timeout) v_int+=v_unsigned_short" }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable v_int = 6" "" "set v_int to 6"
|
||||
|
||||
|
||||
|
||||
send_gdb "print v_int+=v_signed_int\n"
|
||||
gdb_expect {
|
||||
-re ".*13.*$gdb_prompt $" {
|
||||
send_gdb "print v_int\n"
|
||||
gdb_expect {
|
||||
-re ".*13.*$gdb_prompt $" {
|
||||
pass "v_int+=signed_int"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_signed_int" }
|
||||
timeout { fail "(timeout) v_int+=v_signed_int" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_signed_int" }
|
||||
timeout { fail "(timeout) v_int+=v_signed_int" }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable v_int = 6" "" "set v_int to 6"
|
||||
|
||||
|
||||
|
||||
send_gdb "print v_int+=v_unsigned_int\n"
|
||||
gdb_expect {
|
||||
-re ".*14.*$gdb_prompt $" {
|
||||
send_gdb "print v_int\n"
|
||||
gdb_expect {
|
||||
-re ".*14.*$gdb_prompt $" {
|
||||
pass "v_int+=unsigned_int"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_unsigned_int" }
|
||||
timeout { fail "(timeout) v_int+=v_unsigned_int" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_unsigned_int" }
|
||||
timeout { fail "(timeout) v_int+=v_unsigned_int" }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable v_int = 6" "" "set v_int to 6"
|
||||
|
||||
|
||||
|
||||
send_gdb "print v_int+=v_long\n"
|
||||
gdb_expect {
|
||||
-re ".*15.*$gdb_prompt $" {
|
||||
send_gdb "print v_int\n"
|
||||
gdb_expect {
|
||||
-re ".*15.*$gdb_prompt $" {
|
||||
pass "v_int+=long"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_long" }
|
||||
timeout { fail "(timeout) v_int+=v_long" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_long" }
|
||||
timeout { fail "(timeout) v_int+=v_long" }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable v_int = 6" "" "set v_int to 6"
|
||||
|
||||
|
||||
|
||||
send_gdb "print v_int+=v_signed_long\n"
|
||||
gdb_expect {
|
||||
-re ".*16.*$gdb_prompt $" {
|
||||
send_gdb "print v_int\n"
|
||||
gdb_expect {
|
||||
-re ".*16.*$gdb_prompt $" {
|
||||
pass "v_int+=signed_long"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_signed_long" }
|
||||
timeout { fail "(timeout) v_int+=v_signed_long" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_signed_long" }
|
||||
timeout { fail "(timeout) v_int+=v_signed_long" }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable v_int = 6" "" "set v_int to 6"
|
||||
|
||||
|
||||
send_gdb "print v_int+=v_unsigned_long\n"
|
||||
gdb_expect {
|
||||
-re ".*17.*$gdb_prompt $" {
|
||||
send_gdb "print v_int\n"
|
||||
gdb_expect {
|
||||
-re ".*17.*$gdb_prompt $" {
|
||||
pass "v_int+=unsigned_long"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_unsigned_long" }
|
||||
timeout { fail "(timeout) v_int+=v_unsigned_long" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_unsigned_long" }
|
||||
timeout { fail "(timeout) v_int+=v_unsigned_long" }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable v_int = 6" "" "set v_int to 6"
|
||||
|
||||
|
||||
send_gdb "print v_int+=v_float\n"
|
||||
gdb_expect {
|
||||
-re ".*106\r\n$gdb_prompt $" {
|
||||
send_gdb "print v_int\n"
|
||||
gdb_expect {
|
||||
-re ".*106\r\n$gdb_prompt $" {
|
||||
pass "v_int+=v_float"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_float" }
|
||||
timeout { fail "(timeout) v_int+=v_float" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_float" }
|
||||
timeout { fail "(timeout) v_int+=v_float" }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable v_int = 6" "" "set v_int to 6"
|
||||
|
||||
|
||||
send_gdb "print v_int+=v_double\n"
|
||||
gdb_expect {
|
||||
-re ".*206\r\n$gdb_prompt $" {
|
||||
send_gdb "print v_int\n"
|
||||
gdb_expect {
|
||||
-re ".*206\r\n$gdb_prompt $" {
|
||||
pass "v_int+=double"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_double" }
|
||||
timeout { fail "(timeout) v_int+=v_double" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "v_int+=v_signed_long" }
|
||||
timeout { fail "(timeout) v_int+=v_double" }
|
||||
}
|
||||
|
||||
|
||||
9
gdb/testsuite/gdb.base/bar.c
Normal file
9
gdb/testsuite/gdb.base/bar.c
Normal file
@@ -0,0 +1,9 @@
|
||||
static int barx __attribute__ ((section (".data01"))) = 'b' + 'a' + 'r';
|
||||
|
||||
int bar (int x)
|
||||
{
|
||||
if (x)
|
||||
return barx;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
9
gdb/testsuite/gdb.base/baz.c
Normal file
9
gdb/testsuite/gdb.base/baz.c
Normal file
@@ -0,0 +1,9 @@
|
||||
static int bazx __attribute__ ((section (".data02"))) = 'b' + 'a' + 'z';
|
||||
|
||||
int baz (int x)
|
||||
{
|
||||
if (x)
|
||||
return bazx;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
194
gdb/testsuite/gdb.base/bitfields.c
Normal file
194
gdb/testsuite/gdb.base/bitfields.c
Normal file
@@ -0,0 +1,194 @@
|
||||
/* Test program to test bit field operations */
|
||||
|
||||
/* For non-ANSI compilers, use plain ints for the signed bit fields. However,
|
||||
whether they actually end up signed or not is implementation defined, so
|
||||
this may cause some tests to fail. But at least we can still compile
|
||||
the test program and run the tests... */
|
||||
|
||||
#ifndef __STDC__
|
||||
#define signed /**/
|
||||
#endif
|
||||
|
||||
struct fields
|
||||
{
|
||||
unsigned char uc ;
|
||||
signed int s1 : 1;
|
||||
unsigned int u1 : 1;
|
||||
signed int s2 : 2;
|
||||
unsigned int u2 : 2;
|
||||
signed int s3 : 3;
|
||||
unsigned int u3 : 3;
|
||||
signed int s9 : 9;
|
||||
unsigned int u9 : 9;
|
||||
signed char sc ;
|
||||
} flags;
|
||||
|
||||
void break1 ()
|
||||
{
|
||||
}
|
||||
|
||||
void break2 ()
|
||||
{
|
||||
}
|
||||
|
||||
void break3 ()
|
||||
{
|
||||
}
|
||||
|
||||
void break4 ()
|
||||
{
|
||||
}
|
||||
|
||||
void break5 ()
|
||||
{
|
||||
}
|
||||
|
||||
void break6 ()
|
||||
{
|
||||
}
|
||||
|
||||
void break7 ()
|
||||
{
|
||||
}
|
||||
|
||||
void break8 ()
|
||||
{
|
||||
}
|
||||
|
||||
void break9 ()
|
||||
{
|
||||
}
|
||||
|
||||
void break10 ()
|
||||
{
|
||||
}
|
||||
|
||||
/* This is used by bitfields.exp to determine if the target understands
|
||||
signed bitfields. */
|
||||
int i;
|
||||
|
||||
int main ()
|
||||
{
|
||||
/* For each member, set that member to 1, allow gdb to verify that the
|
||||
member (and only that member) is 1, and then reset it back to 0. */
|
||||
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
breakpoint();
|
||||
#endif
|
||||
flags.uc = 1;
|
||||
break1 ();
|
||||
flags.uc = 0;
|
||||
|
||||
flags.s1 = 1;
|
||||
break1 ();
|
||||
flags.s1 = 0;
|
||||
|
||||
flags.u1 = 1;
|
||||
break1 ();
|
||||
flags.u1 = 0;
|
||||
|
||||
flags.s2 = 1;
|
||||
break1 ();
|
||||
flags.s2 = 0;
|
||||
|
||||
flags.u2 = 1;
|
||||
break1 ();
|
||||
flags.u2 = 0;
|
||||
|
||||
flags.s3 = 1;
|
||||
break1 ();
|
||||
flags.s3 = 0;
|
||||
|
||||
flags.u3 = 1;
|
||||
break1 ();
|
||||
flags.u3 = 0;
|
||||
|
||||
flags.s9 = 1;
|
||||
break1 ();
|
||||
flags.s9 = 0;
|
||||
|
||||
flags.u9 = 1;
|
||||
break1 ();
|
||||
flags.u9 = 0;
|
||||
|
||||
flags.sc = 1;
|
||||
break1 ();
|
||||
flags.sc = 0;
|
||||
|
||||
/* Fill alternating fields with all 1's and verify that none of the bits
|
||||
"bleed over" to the other fields. */
|
||||
|
||||
flags.uc = 0xFF;
|
||||
flags.u1 = 0x1;
|
||||
flags.u2 = 0x3;
|
||||
flags.u3 = 0x7;
|
||||
flags.u9 = 0x1FF;
|
||||
break2 ();
|
||||
flags.uc = 0;
|
||||
flags.u1 = 0;
|
||||
flags.u2 = 0;
|
||||
flags.u3 = 0;
|
||||
flags.u9 = 0;
|
||||
|
||||
flags.s1 = 0x1;
|
||||
flags.s2 = 0x3;
|
||||
flags.s3 = 0x7;
|
||||
flags.s9 = 0x1FF;
|
||||
flags.sc = 0xFF;
|
||||
break2 ();
|
||||
flags.s1 = 0;
|
||||
flags.s2 = 0;
|
||||
flags.s3 = 0;
|
||||
flags.s9 = 0;
|
||||
flags.sc = 0;
|
||||
|
||||
/* Fill the unsigned fields with the maximum positive value and verify
|
||||
that the values are printed correctly. */
|
||||
|
||||
/* Maximum positive values */
|
||||
flags.u1 = 0x1;
|
||||
flags.u2 = 0x3;
|
||||
flags.u3 = 0x7;
|
||||
flags.u9 = 0x1FF;
|
||||
break3 ();
|
||||
flags.u1 = 0;
|
||||
flags.u2 = 0;
|
||||
flags.u3 = 0;
|
||||
flags.u9 = 0;
|
||||
|
||||
/* Fill the signed fields with the maximum positive value, then the maximally
|
||||
negative value, then -1, and verify in each case that the values are
|
||||
printed correctly. */
|
||||
|
||||
/* Maximum positive values */
|
||||
flags.s1 = 0x0;
|
||||
flags.s2 = 0x1;
|
||||
flags.s3 = 0x3;
|
||||
flags.s9 = 0xFF;
|
||||
break4 ();
|
||||
|
||||
/* Maximally negative values */
|
||||
flags.s1 = 0x1;
|
||||
flags.s2 = 0x2;
|
||||
flags.s3 = 0x4;
|
||||
flags.s9 = 0x100;
|
||||
/* Extract bitfield value so that bitfield.exp can check if the target
|
||||
understands signed bitfields. */
|
||||
i = flags.s9;
|
||||
break4 ();
|
||||
|
||||
/* -1 */
|
||||
flags.s1 = 0x1;
|
||||
flags.s2 = 0x3;
|
||||
flags.s3 = 0x7;
|
||||
flags.s9 = 0x1FF;
|
||||
break4 ();
|
||||
|
||||
flags.s1 = 0;
|
||||
flags.s2 = 0;
|
||||
flags.s3 = 0;
|
||||
flags.s9 = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
268
gdb/testsuite/gdb.base/bitfields.exp
Normal file
268
gdb/testsuite/gdb.base/bitfields.exp
Normal file
@@ -0,0 +1,268 @@
|
||||
# Copyright (C) 1992, 1994, 1997 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# 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
|
||||
|
||||
set testfile "bitfields"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
#
|
||||
# Test bitfield locating and uniqueness.
|
||||
# For each member, set that member to 1 and verify that the member (and only
|
||||
# that member) is 1, then reset it back to 0.
|
||||
#
|
||||
|
||||
proc bitfield_uniqueness {} {
|
||||
global decimal
|
||||
global hex
|
||||
global gdb_prompt
|
||||
global srcfile
|
||||
|
||||
if { ! [runto break1] } {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
|
||||
if [gdb_test "print flags" ".*uc = 1 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #1"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
# Note that we check for s1 as either 1 or -1, so that failure to
|
||||
# treat it correctly as a signed 1bit field (values 0 or -1) while
|
||||
# printing its value does not cause a spurious failure. We do the
|
||||
# signedness preservation test later.
|
||||
if [gdb_test "print flags" ".*uc = 0 .*, s1 = (1|-1), u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (s1)"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #2"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 1, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (u1)"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #3"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 1, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (s2)"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #4"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 1, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (u2)"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #5"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 1, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (s3)"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #6"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 1, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (u3)"] {
|
||||
gdb_suppress_tests
|
||||
}
|
||||
if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #7"] {
|
||||
gdb_suppress_tests
|
||||
}
|
||||
if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 1, u9 = 0, sc = 0.*" "bitfield uniqueness (s9)"] {
|
||||
gdb_suppress_tests
|
||||
}
|
||||
if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #8"] {
|
||||
gdb_suppress_tests
|
||||
}
|
||||
if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 1, sc = 0.*" "bitfield uniqueness (u9)"] {
|
||||
gdb_suppress_tests
|
||||
}
|
||||
if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #9"] {
|
||||
gdb_suppress_tests
|
||||
}
|
||||
if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 1.*" "bitfield uniqueness (sc)"] {
|
||||
gdb_suppress_tests
|
||||
}
|
||||
# Hmmmm?
|
||||
gdb_stop_suppressing_tests;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Test bitfield containment.
|
||||
# Fill alternating fields with all 1's and verify that none of the bits
|
||||
# "bleed over" to the other fields.
|
||||
#
|
||||
|
||||
proc bitfield_containment {} {
|
||||
global decimal
|
||||
global hex
|
||||
global gdb_prompt
|
||||
global srcfile
|
||||
|
||||
delete_breakpoints
|
||||
|
||||
if { ![runto break2] } {
|
||||
gdb_suppress_tests
|
||||
}
|
||||
|
||||
if [gdb_test "print/x flags" "= {uc = 0xff, s1 = 0x0, u1 = 0x1, s2 = 0x0, u2 = 0x3, s3 = 0x0, u3 = 0x7, s9 = 0x0, u9 = 0x1ff, sc = 0x0}" "bitfield containment #1"] {
|
||||
gdb_suppress_tests
|
||||
}
|
||||
|
||||
if [gdb_test "cont" "Break.*break2 \\(\\) at .*$srcfile:$decimal.*" "continuing to break2"] {
|
||||
gdb_suppress_tests
|
||||
}
|
||||
|
||||
# If program is compiled with Sun CC, then these print out as their
|
||||
# actual sizes; if compiled with gcc, they print out as 0xffffffff
|
||||
# (which strikes me as bogus, but accept it at least for now).
|
||||
if [gdb_test "print/x flags" "= {uc = 0x0, s1 = 0x(1|f*), u1 = 0x0, s2 = 0x(3|f*), u2 = 0x0, s3 = 0x(7|f*), u3 = 0x0, s9 = 0x(1ff|f*), u9 = 0x0, sc = 0xff}" "bitfield containment #2"] {
|
||||
gdb_suppress_tests
|
||||
}
|
||||
gdb_stop_suppressing_tests;
|
||||
}
|
||||
|
||||
# Test unsigned bitfields for unsignedness and range.
|
||||
# Fill the unsigned fields with the maximum positive value and verify that
|
||||
# the values are printed correctly.
|
||||
|
||||
proc bitfield_unsignedness {} {
|
||||
global decimal
|
||||
global hex
|
||||
global gdb_prompt
|
||||
global srcfile
|
||||
|
||||
delete_breakpoints
|
||||
|
||||
if { ![runto break3] } {
|
||||
gdb_suppress_tests
|
||||
}
|
||||
|
||||
if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 1, s2 = 0, u2 = 3, s3 = 0, u3 = 7, s9 = 0, u9 = 511, sc = 0.*" "unsigned bitfield ranges"] {
|
||||
gdb_suppress_tests
|
||||
}
|
||||
gdb_stop_suppressing_tests;
|
||||
}
|
||||
|
||||
#
|
||||
# Test signed bitfields for signedness and range.
|
||||
# Fill the signed fields with the maximum positive value, then the maximally
|
||||
# negative value, then -1, and verify in each case that the values are
|
||||
# printed correctly.
|
||||
#
|
||||
|
||||
proc bitfield_signedness {} {
|
||||
global decimal
|
||||
global hex
|
||||
global gdb_prompt
|
||||
global srcfile
|
||||
|
||||
delete_breakpoints
|
||||
|
||||
if { ! [runto break4] } {
|
||||
gdb_suppress_tests
|
||||
}
|
||||
|
||||
if [gdb_test "print flags" "= {uc = 0 .*, s1 = 0, u1 = 0, s2 = 1, u2 = 0, s3 = 3, u3 = 0, s9 = 255, u9 = 0, sc = 0 .*}" "signed bitfields, max positive values"] {
|
||||
gdb_suppress_tests
|
||||
}
|
||||
|
||||
if [gdb_test "cont" "Break.*break4 \\(\\) at .*$srcfile:$decimal.*" "continuing to break4 #1"] {
|
||||
gdb_suppress_tests
|
||||
}
|
||||
|
||||
# Determine if the target has signed bitfields so we can xfail the
|
||||
# the signed bitfield tests if it doesn't.
|
||||
send_gdb "print i\n"
|
||||
gdb_expect {
|
||||
-re ".* = -256.*$gdb_prompt $" {
|
||||
pass "determining signed-ness of bitfields"
|
||||
}
|
||||
-re ".* = 256.*$gdb_prompt $" {
|
||||
pass "determining signed-ness of bitfields"
|
||||
setup_xfail "*-*-*"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "determining signed-ness of bitfields"
|
||||
gdb_suppress_tests
|
||||
}
|
||||
default {
|
||||
fail "determining signed-ness of bitfields" ;
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
}
|
||||
|
||||
if [gdb_test "print flags" ".*uc = 0 .*, s1 = -1, u1 = 0, s2 = -2, u2 = 0, s3 = -4, u3 = 0, s9 = -256, u9 = 0, sc = 0.*" "signed bitfields, max negative values"] {
|
||||
gdb_suppress_tests
|
||||
}
|
||||
|
||||
if [gdb_test "cont" "Break.*break4 \\(\\) at .*$srcfile:$decimal.*" "continuing to break4 #2"] {
|
||||
gdb_suppress_tests
|
||||
}
|
||||
|
||||
if [gdb_test "print flags" ".*uc = 0 .*, s1 = -1, u1 = 0, s2 = -1, u2 = 0, s3 = -1, u3 = 0, s9 = -1, u9 = 0, sc = 0.*" "signed bitfields with -1"] {
|
||||
gdb_suppress_tests
|
||||
}
|
||||
# Hmmmm???
|
||||
gdb_stop_suppressing_tests;
|
||||
}
|
||||
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
send_gdb "set print sevenbit-strings\n" ; gdb_expect -re "$gdb_prompt $"
|
||||
|
||||
bitfield_uniqueness
|
||||
if [istarget "mips-idt-*"] then {
|
||||
# Restart because IDT/SIM runs out of file descriptors.
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
}
|
||||
bitfield_containment
|
||||
if [istarget "mips-idt-*"] then {
|
||||
# Restart because IDT/SIM runs out of file descriptors.
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
}
|
||||
bitfield_unsignedness
|
||||
if [istarget "mips-idt-*"] then {
|
||||
# Restart because IDT/SIM runs out of file descriptors.
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
}
|
||||
bitfield_signedness
|
||||
365
gdb/testsuite/gdb.base/bitops.exp
Normal file
365
gdb/testsuite/gdb.base/bitops.exp
Normal file
@@ -0,0 +1,365 @@
|
||||
# Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# This file was written by Elena Zannoni (ezannoni@cygnus.com)
|
||||
|
||||
# This file is part of the gdb testsuite
|
||||
#
|
||||
# tests expressions with bitwise operators, and some
|
||||
# logical operators
|
||||
# Does not use a target program
|
||||
#
|
||||
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
#
|
||||
# test running programs
|
||||
#
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
|
||||
|
||||
send_gdb "print !1\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of !1"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !1" }
|
||||
timeout { fail "(timeout) print value of !1" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print !0\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 1.*$gdb_prompt $" {
|
||||
pass "print value of !0"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !0" }
|
||||
timeout { fail "(timeout) print value of !0" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print !100\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of !100"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !100" }
|
||||
timeout { fail "(timeout) print value of !100" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print !1000\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of !1000"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !1000" }
|
||||
timeout { fail "(timeout) print value of !1000" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print !10\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of !10"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !10" }
|
||||
timeout { fail "(timeout) print value of !10" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print !2\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of !2 "
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !2" }
|
||||
timeout { fail "(timeout) print value of !2" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print 10 | 5\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 15.*$gdb_prompt $" {
|
||||
pass "print value of 10 | 5"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of 10 | 5" }
|
||||
timeout { fail "(timeout) print value of 10 | 5" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print 10 & 5\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of 10 & 5"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of 10 & 5" }
|
||||
timeout { fail "(timeout) print value of 10 & 5" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print 10 ^ 5\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 15.*$gdb_prompt $" {
|
||||
pass "print value of 10 ^ 5"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of 10 ^ 5" }
|
||||
timeout { fail "(timeout) print value of 10 ^ 5" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print -!0\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = -1.*$gdb_prompt $" {
|
||||
pass "print value of -!0"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of -!0" }
|
||||
timeout { fail "(timeout) print value of -!0" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print ~-!0\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of ~-!0"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of ~-!0" }
|
||||
timeout { fail "(timeout) print value of ~-!0" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
send_gdb "print 3 * 2 / 4.0 * 2.0\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 3.*$gdb_prompt $" {
|
||||
pass "print value of 3 * 2 / 4.0 * 2.0"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of 3 * 2 / 4.0 * 2.0" }
|
||||
timeout { fail "(timeout) print value of 3 * 2 / 4.0 * 2.0" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print 8 << 2 >> 4\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 2.*$gdb_prompt $" {
|
||||
pass "print value of 8 << 2 >> 4"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of 8 << 2 >> 4" }
|
||||
timeout { fail "(timeout) print value of 8 << 2 >> 4" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print -1 < 0 > 1\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of -1 < 0 > 1"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of -1 < 0 > 1" }
|
||||
timeout { fail "(timeout) print value of -1 < 0 > 1" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print 15 ^ 10 ^ 5 ^ 7\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 7.*$gdb_prompt $" {
|
||||
pass "print value of 15 ^ 10 ^ 5 ^ 7"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of 15 ^ 10 ^ 5 ^ 7" }
|
||||
timeout { fail "(timeout) print value of 15 ^ 10 ^ 5 ^ 7" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print 3.5 < 4.0\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 1.*$gdb_prompt $" {
|
||||
pass "print value of 3.5 < 4.0"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of 3.5 < 4.0" }
|
||||
timeout { fail "(timeout) print value of 3.5 < 4.0" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print 3.5 < -4.0\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of 3.5 < -4.0"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of 3.5 < -4.0" }
|
||||
timeout { fail "(timeout) print value of 3.5 < -4.0" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print 2 > -3\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 1.*$gdb_prompt $" {
|
||||
pass "print value of 2 > -3"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of 2 > -3" }
|
||||
timeout { fail "(timeout) print value of 2 > -3" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print -3>4\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of -3>4"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of -3>4" }
|
||||
timeout { fail "(timeout) print value of -3>4" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print (-3 > 4)\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of (-3 > 4)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (-3 > 4)" }
|
||||
timeout { fail "(timeout) print value of (-3 > 4)" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print 3>=2.5\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 1.*$gdb_prompt $" {
|
||||
pass "print value of 3>=2.5"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of 3>=2.5" }
|
||||
timeout { fail "(timeout) print value of 3>=2.5" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print 3>=4.5\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of 3>=4.5"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of 3>=4.5" }
|
||||
timeout { fail "(timeout) print value of 3>=4.5" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print 3==3.0\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 1.*$gdb_prompt $" {
|
||||
pass "print value of 3==3.0"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of 3==3.0" }
|
||||
timeout { fail "(timeout) print value of 3==3.0" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print 3==4.0\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of 3==4.0"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of 3==4.0" }
|
||||
timeout { fail "(timeout) print value of 3==4.0" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print 3!=3.0\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of 3!=3.0"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of 3!=3.0" }
|
||||
timeout { fail "(timeout) print value of 3!=3.0" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print 3!=5.0\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 1.*$gdb_prompt $" {
|
||||
pass "print value of 3!=5.0"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of 3!=5.0" }
|
||||
timeout { fail "(timeout) print value of 3!=5.0" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print 0 || 1 && 0 | 0 ^ 0 == 8 > 128 >>1 +2 *2\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of 0 || 1 && 0 | 0 ^ 0 == 8 > 128 >>1 +2 *2"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of 0 || 1 && 0 | 0 ^ 0 == 8 > 128 >>1 +2 *2" }
|
||||
timeout { fail "(timeout) print value of 0 || 1 && 0 | 0 ^ 0 == 8 > 128 >>1 +2 *2" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print 1.0 || 0\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 1.*$gdb_prompt $" {
|
||||
pass "print value of 1.0 || 0"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of 1.0 || 0" }
|
||||
timeout { fail "(timeout) print value of 1.0 || 0" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print 0.0 || 1.0\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 1.*$gdb_prompt $" {
|
||||
pass "print value of 0.0 || 1.0"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of 0.0 || 1.0" }
|
||||
timeout { fail "(timeout) print value of 0.0 || 1.0" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print 0.0 || 0\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of 0.0 || 0"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of 0.0 || 0" }
|
||||
timeout { fail "(timeout) print value of 0.0 || 0" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print 0 || 1 && 0 | 0 ^ 0 == 8\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of 0 || 1 && 0 | 0 ^ 0 == 8"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of 0 || 1 && 0 | 0 ^ 0 == 8" }
|
||||
timeout { fail "(timeout) print value of 0 || 1 && 0 | 0 ^ 0 == 8" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print 0 == 8 > 128 >> 1 + 2 * 2\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of 0 == 8 > 128 >> 1 + 2 * 2"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of 0 == 8 > 128 >> 1 + 2 * 2" }
|
||||
timeout { fail "(timeout) print value of 0 == 8 > 128 >> 1 + 2 * 2" }
|
||||
}
|
||||
|
||||
113
gdb/testsuite/gdb.base/branches.c
Normal file
113
gdb/testsuite/gdb.base/branches.c
Normal file
@@ -0,0 +1,113 @@
|
||||
/* Tests for single stepping through various branch conditions */
|
||||
|
||||
int noscramble(int a)
|
||||
{
|
||||
return a ;
|
||||
}
|
||||
|
||||
int echo(int a)
|
||||
{ return noscramble(a) ; }
|
||||
|
||||
int equaltest(int a,int b)
|
||||
{ int retval ;
|
||||
if (a == b)
|
||||
retval = noscramble(1) ;
|
||||
else retval = noscramble(0) ;
|
||||
return retval ;
|
||||
}
|
||||
|
||||
int neqtest(int a , int b)
|
||||
{ int retval ;
|
||||
if (a != b)
|
||||
retval = echo(1) ;
|
||||
else retval = echo(2) ;
|
||||
return retval ;
|
||||
}
|
||||
int zerotest(int a )
|
||||
{ int retval ;
|
||||
a = echo(a) ;
|
||||
if (a ==0)
|
||||
retval = echo(1) ;
|
||||
else
|
||||
retval = echo(0) ;
|
||||
retval = echo(retval) ;
|
||||
return retval ;
|
||||
}
|
||||
|
||||
int zerotest2(int a)
|
||||
{
|
||||
return (a==0) ;
|
||||
}
|
||||
|
||||
int nonzerotest(int a)
|
||||
{
|
||||
int retval ;
|
||||
if (a != 0)
|
||||
retval = echo(0) ;
|
||||
else retval = echo(1) ;
|
||||
return retval ;
|
||||
}
|
||||
|
||||
int whiletest(int a)
|
||||
{
|
||||
while (a > 0)
|
||||
{
|
||||
a-- ;
|
||||
}
|
||||
return 0 ;
|
||||
}
|
||||
int whiletest2(int a)
|
||||
{
|
||||
while (a > 0)
|
||||
{
|
||||
a = noscramble(a) ;
|
||||
a-- ;
|
||||
}
|
||||
return a ;
|
||||
}
|
||||
|
||||
int decr(int x) { return x - 1 ; }
|
||||
|
||||
int while3(int a)
|
||||
{
|
||||
int b = a ;
|
||||
while (a == b)
|
||||
{
|
||||
a = echo(a) ;
|
||||
b = decr(b) ;
|
||||
}
|
||||
return a ;
|
||||
}
|
||||
|
||||
void done (int x) { }
|
||||
|
||||
int main()
|
||||
{
|
||||
int a,b,c,d ;
|
||||
done(1) ;
|
||||
a = echo(123456) ;
|
||||
b = echo(123456) ;
|
||||
c = echo(56789) ;
|
||||
d = echo(0) ;
|
||||
#if 1
|
||||
equaltest(a,b) ;
|
||||
done(7) ;
|
||||
equaltest(a,c) ;
|
||||
done(8) ;
|
||||
whiletest(3) ; /* worked */
|
||||
done(3) ;
|
||||
while3(3) ;
|
||||
done(6) ;
|
||||
#endif
|
||||
neqtest(a,b) ;
|
||||
neqtest(a,b) ;
|
||||
neqtest(a,c) ;
|
||||
zerotest(d) ;
|
||||
zerotest(a) ;
|
||||
done(5) ;
|
||||
nonzerotest(d) ;
|
||||
done(4) ;
|
||||
nonzerotest(a) ;
|
||||
done(111) ;
|
||||
return 1 ;
|
||||
}
|
||||
81
gdb/testsuite/gdb.base/break.c
Normal file
81
gdb/testsuite/gdb.base/break.c
Normal file
@@ -0,0 +1,81 @@
|
||||
#ifdef vxworks
|
||||
|
||||
# include <stdio.h>
|
||||
|
||||
/* VxWorks does not supply atoi. */
|
||||
static int
|
||||
atoi (z)
|
||||
char *z;
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
while (*z >= '0' && *z <= '9')
|
||||
i = i * 10 + (*z++ - '0');
|
||||
return i;
|
||||
}
|
||||
|
||||
/* I don't know of any way to pass an array to VxWorks. This function
|
||||
can be called directly from gdb. */
|
||||
|
||||
vxmain (arg)
|
||||
char *arg;
|
||||
{
|
||||
char *argv[2];
|
||||
|
||||
argv[0] = "";
|
||||
argv[1] = arg;
|
||||
main (2, argv, (char **) 0);
|
||||
}
|
||||
|
||||
#else /* ! vxworks */
|
||||
# include <stdio.h>
|
||||
#endif /* ! vxworks */
|
||||
|
||||
/*
|
||||
* The following functions do nothing useful. They are included simply
|
||||
* as places to try setting breakpoints at. They are explicitly
|
||||
* "one-line functions" to verify that this case works (some versions
|
||||
* of gcc have or have had problems with this).
|
||||
*/
|
||||
|
||||
int marker1 () { return (0); }
|
||||
int marker2 (a) int a; { return (1); }
|
||||
void marker3 (a, b) char *a, *b; {}
|
||||
void marker4 (d) long d; {}
|
||||
|
||||
/*
|
||||
* This simple classical example of recursion is useful for
|
||||
* testing stack backtraces and such.
|
||||
*/
|
||||
|
||||
int
|
||||
main (argc, argv, envp)
|
||||
int argc;
|
||||
char *argv[], **envp;
|
||||
{
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
breakpoint();
|
||||
#endif
|
||||
if (argc == 123456) {
|
||||
fprintf (stderr, "usage: factorial <number>\n");
|
||||
return 1;
|
||||
}
|
||||
printf ("%d\n", factorial (atoi ("6")));
|
||||
|
||||
marker1 ();
|
||||
marker2 (43);
|
||||
marker3 ("stack", "trace");
|
||||
marker4 (177601976L);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int factorial (value)
|
||||
int value;
|
||||
{
|
||||
if (value > 1) {
|
||||
value *= factorial (value - 1);
|
||||
}
|
||||
return (value);
|
||||
}
|
||||
|
||||
769
gdb/testsuite/gdb.base/break.exp
Normal file
769
gdb/testsuite/gdb.base/break.exp
Normal file
@@ -0,0 +1,769 @@
|
||||
# Copyright (C) 1988, 1990, 1991, 1992, 1994, 1997, 1998
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# 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 {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# test running programs
|
||||
#
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile "break"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
if [target_info exists gdb_stub] {
|
||||
gdb_step_for_stub;
|
||||
}
|
||||
#
|
||||
# test simple breakpoint setting commands
|
||||
#
|
||||
|
||||
# Test deleting all breakpoints when there are none installed,
|
||||
# GDB should not prompt for confirmation.
|
||||
# Note that gdb-init.exp provides a "delete_breakpoints" proc
|
||||
# for general use elsewhere.
|
||||
|
||||
send_gdb "delete breakpoints\n"
|
||||
gdb_expect {
|
||||
-re "Delete all breakpoints.*$" {
|
||||
send_gdb "y\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $" {
|
||||
fail "Delete all breakpoints when none (unexpected prompt)"
|
||||
}
|
||||
timeout { fail "Delete all breakpoints when none (timeout after unexpected prompt)" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { pass "Delete all breakpoints when none" }
|
||||
timeout { fail "Delete all breakpoints when none (timeout)" }
|
||||
}
|
||||
|
||||
#
|
||||
# test break at function
|
||||
#
|
||||
gdb_test "break main" \
|
||||
"Breakpoint.*at.* file .*$srcfile, line.*" \
|
||||
"breakpoint function"
|
||||
|
||||
#
|
||||
# test break at function in file
|
||||
#
|
||||
gdb_test "break $srcfile:factorial" \
|
||||
"Breakpoint.*at.* file .*$srcfile, line.*" \
|
||||
"breakpoint function in file"
|
||||
|
||||
#
|
||||
# test break at line number
|
||||
#
|
||||
gdb_test "break 64" \
|
||||
"Breakpoint.*at.* file .*$srcfile, line 64\\." \
|
||||
"breakpoint line number"
|
||||
|
||||
#
|
||||
# test duplicate breakpoint
|
||||
#
|
||||
gdb_test "break 64" \
|
||||
"Note: breakpoint \[0-9\]+ also set at pc.*Breakpoint \[0-9\]+ at.* file .*$srcfile, line 64\\." \
|
||||
"breakpoint duplicate"
|
||||
|
||||
#
|
||||
# test break at line number in file
|
||||
#
|
||||
gdb_test "break $srcfile:70" \
|
||||
"Breakpoint.*at.* file .*$srcfile, line 70\\." \
|
||||
"breakpoint line number in file"
|
||||
|
||||
|
||||
#
|
||||
# check to see what breakpoints are set
|
||||
#
|
||||
if [target_info exists gdb_stub] {
|
||||
set main_line 57
|
||||
} else {
|
||||
set main_line 60
|
||||
}
|
||||
|
||||
gdb_test "info break" \
|
||||
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$main_line.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in factorial at .*$srcfile:76.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:64.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:64.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:70" \
|
||||
"breakpoint info"
|
||||
|
||||
|
||||
# FIXME: The rest of this test doesn't work with anything that can't
|
||||
# handle arguments.
|
||||
# Huh? There doesn't *appear* to be anything that passes arguments
|
||||
# below.
|
||||
if [istarget "mips-idt-*"] then {
|
||||
return
|
||||
}
|
||||
|
||||
#
|
||||
# run until the breakpoint at main is hit. For non-stubs-using targets.
|
||||
#
|
||||
if ![target_info exists use_gdb_stub] {
|
||||
if [istarget "*-*-vxworks*"] then {
|
||||
send_gdb "run vxmain \"2\"\n"
|
||||
set timeout 120
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
} else {
|
||||
send_gdb "run\n"
|
||||
}
|
||||
gdb_expect {
|
||||
-re "The program .* has been started already.*y or n. $" {
|
||||
send_gdb "y\n"
|
||||
exp_continue
|
||||
}
|
||||
-re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:60.*60\[\t \]+if .argc.* \{.*$gdb_prompt $"\
|
||||
{ pass "run until function breakpoint" }
|
||||
-re ".*$gdb_prompt $" { fail "run until function breakpoint" }
|
||||
timeout { fail "run until function breakpoint (timeout)" }
|
||||
}
|
||||
} else {
|
||||
if ![target_info exists gdb_stub] {
|
||||
gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:60.*60\[\t \]+if .argc.*\{" "stub continue"
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# run until the breakpoint at a line number
|
||||
#
|
||||
gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:64.*64\[\t \]+printf.*factorial.*" \
|
||||
"run until breakpoint set at a line number"
|
||||
|
||||
#
|
||||
# Run until the breakpoint set in a function in a file
|
||||
#
|
||||
for {set i 6} {$i >= 1} {incr i -1} {
|
||||
gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, factorial \\(value=$i\\) at .*$srcfile:76.*76\[\t \]+if .value > 1. \{" \
|
||||
"run until file:function($i) breakpoint"
|
||||
}
|
||||
|
||||
#
|
||||
# run until the file:function breakpoint at a line number in a file
|
||||
#
|
||||
gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:70.*70\[\t \]+return 0;" \
|
||||
"run until file:linenum breakpoint"
|
||||
|
||||
#
|
||||
# delete all breakpoints so we can start over, course this can be a test too
|
||||
#
|
||||
delete_breakpoints
|
||||
|
||||
#
|
||||
# test temporary breakpoint at function
|
||||
#
|
||||
|
||||
gdb_test "tbreak main" "Breakpoint.*at.* file .*$srcfile, line.*" "Temporary breakpoint function"
|
||||
|
||||
#
|
||||
# test break at function in file
|
||||
#
|
||||
|
||||
gdb_test "tbreak $srcfile:factorial" "Breakpoint.*at.* file .*$srcfile, line.*" \
|
||||
"Temporary breakpoint function in file"
|
||||
|
||||
#
|
||||
# test break at line number
|
||||
#
|
||||
send_gdb "tbreak 64\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint.*at.* file .*$srcfile, line 64.*$gdb_prompt $" { pass "Temporary breakpoint line number #1" }
|
||||
-re ".*$gdb_prompt $" { pass "Temporary breakpoint line number #1" }
|
||||
timeout { fail "breakpoint line number #1 (timeout)" }
|
||||
}
|
||||
|
||||
gdb_test "tbreak 60" "Breakpoint.*at.* file .*$srcfile, line 60.*" "Temporary breakpoint line number #2"
|
||||
|
||||
#
|
||||
# test break at line number in file
|
||||
#
|
||||
send_gdb "tbreak $srcfile:70\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint.*at.* file .*$srcfile, line 70.*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" }
|
||||
-re ".*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" }
|
||||
timeout { fail "Temporary breakpoint line number in file #1 (timeout)" }
|
||||
}
|
||||
|
||||
gdb_test "tbreak $srcfile:66" "Breakpoint.*at.* file .*$srcfile, line 66.*" "Temporary breakpoint line number in file #2"
|
||||
|
||||
#
|
||||
# check to see what breakpoints are set (temporary this time)
|
||||
#
|
||||
gdb_test "info break" "Num Type.*Disp Enb Address.*What.*\[\r\n\]\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:$main_line.*\[\r\n\]\[0-9\]+\[\t \]+breakpoint del.*y.*in factorial at .*$srcfile:76.*\[\r\n\]\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:64.*\[\r\n\]\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:70.*" "Temporary breakpoint info"
|
||||
|
||||
|
||||
#***********
|
||||
|
||||
# Verify that catchpoints for fork, vfork and exec don't trigger
|
||||
# inappropriately. (There are no calls to those system functions
|
||||
# in this test program.)
|
||||
#
|
||||
if ![runto_main] then { fail "break tests suppressed" }
|
||||
|
||||
send_gdb "catch\n"
|
||||
gdb_expect {
|
||||
-re "Catch requires an event name.*$gdb_prompt $"\
|
||||
{pass "catch requires an event name"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "catch requires an event name"}
|
||||
timeout {fail "(timeout) catch requires an event name"}
|
||||
}
|
||||
|
||||
|
||||
set name "set catch fork, never expected to trigger"
|
||||
send_gdb "catch fork\n"
|
||||
gdb_expect {
|
||||
-re "Catchpoint \[0-9\]* .fork..*$gdb_prompt $"
|
||||
{pass $name}
|
||||
-re "Catch of fork not yet implemented.*$gdb_prompt $"
|
||||
{pass $name}
|
||||
-re "$gdb_prompt $"
|
||||
{fail $name}
|
||||
timeout {fail "(timeout) $name"}
|
||||
}
|
||||
|
||||
|
||||
set name "set catch vfork, never expected to trigger"
|
||||
send_gdb "catch vfork\n"
|
||||
|
||||
# If we are on HP-UX 10.20, we expect an error message to be
|
||||
# printed if we type "catch vfork" at the gdb gdb_prompt. This is
|
||||
# because on HP-UX 10.20, we cannot catch vfork events.
|
||||
|
||||
if [istarget "hppa*-hp-hpux10.20"] then {
|
||||
gdb_expect {
|
||||
-re "Catch of vfork events not supported on HP-UX 10.20..*$gdb_prompt $"
|
||||
{pass $name}
|
||||
-re "$gdb_prompt $"
|
||||
{fail $name}
|
||||
timeout {fail "(timeout) $name"}
|
||||
}
|
||||
} else {
|
||||
gdb_expect {
|
||||
-re "Catchpoint \[0-9\]* .vfork..*$gdb_prompt $"
|
||||
{pass $name}
|
||||
-re "Catch of vfork not yet implemented.*$gdb_prompt $"
|
||||
{pass $name}
|
||||
-re "$gdb_prompt $"
|
||||
{fail $name}
|
||||
timeout {fail "(timeout) $name"}
|
||||
}
|
||||
}
|
||||
|
||||
set name "set catch exec, never expected to trigger"
|
||||
send_gdb "catch exec\n"
|
||||
gdb_expect {
|
||||
-re "Catchpoint \[0-9\]* .exec..*$gdb_prompt $"
|
||||
{pass $name}
|
||||
-re "Catch of exec not yet implemented.*$gdb_prompt $"
|
||||
{pass $name}
|
||||
-re "$gdb_prompt $" {fail $name}
|
||||
timeout {fail "(timeout) $name"}
|
||||
}
|
||||
|
||||
# Verify that "until <location>" works. (This is really just syntactic
|
||||
# sugar for "tbreak <location>; continue".)
|
||||
#
|
||||
send_gdb "until 64\n"
|
||||
gdb_expect {
|
||||
-re "main .* at .*:64.*$gdb_prompt $"\
|
||||
{pass "until 64"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "until 64"}
|
||||
timeout {fail "(timeout) until 64"}
|
||||
}
|
||||
|
||||
# Verify that a malformed "until" is gracefully caught.
|
||||
#
|
||||
send_gdb "until 65 then stop\n"
|
||||
gdb_expect {
|
||||
-re "Junk at end of arguments..*$gdb_prompt $"\
|
||||
{pass "malformed until"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "malformed until"}
|
||||
timeout {fail "(timeout) malformed until"}
|
||||
}
|
||||
|
||||
# Verify that GDB responds gracefully when asked to set a breakpoint
|
||||
# on a nonexistent source line.
|
||||
#
|
||||
send_gdb "break 999\n"
|
||||
gdb_expect {
|
||||
-re "No line 999 in file .*$gdb_prompt $"\
|
||||
{pass "break on non-existent source line"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "break on non-existent source line"}
|
||||
timeout {fail "(timeout) break on non-existent source line"}
|
||||
}
|
||||
|
||||
# Verify that GDB allows one to just say "break", which is treated
|
||||
# as the "default" breakpoint. Note that GDB gets cute when printing
|
||||
# the informational message about other breakpoints at the same
|
||||
# location. We'll hit that bird with this stone too.
|
||||
#
|
||||
send_gdb "break\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint \[0-9\]*.*$gdb_prompt $"\
|
||||
{pass "break on default location, 1st time"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "break on default location, 1st time"}
|
||||
timeout {fail "(timeout) break on default location, 1st time"}
|
||||
}
|
||||
|
||||
send_gdb "break\n"
|
||||
gdb_expect {
|
||||
-re "Note: breakpoint \[0-9\]* also set at .*Breakpoint \[0-9\]*.*$gdb_prompt $"\
|
||||
{pass "break on default location, 2nd time"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "break on default location, 2nd time"}
|
||||
timeout {fail "(timeout) break on default location, 2nd time"}
|
||||
}
|
||||
|
||||
send_gdb "break\n"
|
||||
gdb_expect {
|
||||
-re "Note: breakpoints \[0-9\]* and \[0-9\]* also set at .*Breakpoint \[0-9\]*.*$gdb_prompt $"\
|
||||
{pass "break on default location, 3rd time"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "break on default location, 3rd time"}
|
||||
timeout {fail "(timeout) break on default location, 3rd time"}
|
||||
}
|
||||
|
||||
send_gdb "break\n"
|
||||
gdb_expect {
|
||||
-re "Note: breakpoints \[0-9\]*, \[0-9\]* and \[0-9\]* also set at .*Breakpoint \[0-9\]*.*$gdb_prompt $"\
|
||||
{pass "break on default location, 4th time"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "break on default location, 4th time"}
|
||||
timeout {fail "(timeout) break on default location, 4th time"}
|
||||
}
|
||||
|
||||
# Verify that a "silent" breakpoint can be set, and that GDB is indeed
|
||||
# "silent" about its triggering.
|
||||
#
|
||||
if ![runto_main] then { fail "break tests suppressed" }
|
||||
|
||||
send_gdb "break 64\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 64.*$gdb_prompt $"\
|
||||
{pass "set to-be-silent break 64"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "set to-be-silent break 64"}
|
||||
timeout {fail "(timeout) set to-be-silent break 64"}
|
||||
}
|
||||
|
||||
send_gdb "commands $expect_out(1,string)\n"
|
||||
send_gdb "silent\n"
|
||||
send_gdb "end\n"
|
||||
gdb_expect {
|
||||
-re ".*$gdb_prompt $"\
|
||||
{pass "set silent break 64"}
|
||||
timeout {fail "(timeout) set silent break 64"}
|
||||
}
|
||||
|
||||
send_gdb "info break $expect_out(1,string)\n"
|
||||
gdb_expect {
|
||||
-re "\[0-9\]*\[ \t\]*breakpoint.*:64\r\n\[ \t\]*silent.*$gdb_prompt $"\
|
||||
{pass "info silent break 64"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "info silent break 64"}
|
||||
timeout {fail "(timeout) info silent break 64"}
|
||||
}
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re "Continuing.\r\n$gdb_prompt $"\
|
||||
{pass "hit silent break 64"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "hit silent break 64"}
|
||||
timeout {fail "(timeout) hit silent break 64"}
|
||||
}
|
||||
send_gdb "bt\n"
|
||||
gdb_expect {
|
||||
-re "#0 main .* at .*:64.*$gdb_prompt $"\
|
||||
{pass "stopped for silent break 64"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "stopped for silent break 64"}
|
||||
timeout {fail "(timeout) stopped for silent break 64"}
|
||||
}
|
||||
|
||||
# Verify that GDB can at least parse a breakpoint with the
|
||||
# "thread" keyword. (We won't attempt to test here that a
|
||||
# thread-specific breakpoint really triggers appropriately.
|
||||
# The gdb.threads subdirectory contains tests for that.)
|
||||
#
|
||||
send_gdb "break 65 thread 999\n"
|
||||
gdb_expect {
|
||||
-re "Unknown thread 999.*$gdb_prompt $"\
|
||||
{pass "thread-specific breakpoint on non-existent thread disallowed"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "thread-specific breakpoint on non-existent thread disallowed"}
|
||||
timeout {fail "(timeout) thread-specific breakpoint on non-existent thread disallowed"}
|
||||
}
|
||||
send_gdb "break 65 thread foo\n"
|
||||
gdb_expect {
|
||||
-re "Junk after thread keyword..*$gdb_prompt $"\
|
||||
{pass "thread-specific breakpoint on bogus thread ID disallowed"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "thread-specific breakpoint on bogus thread ID disallowed"}
|
||||
timeout {fail "(timeout) thread-specific breakpoint on bogus thread ID disallowed"}
|
||||
}
|
||||
|
||||
# Verify that GDB responds gracefully to a breakpoint command with
|
||||
# trailing garbage.
|
||||
#
|
||||
send_gdb "break 65 foo\n"
|
||||
gdb_expect {
|
||||
-re "Junk at end of arguments..*$gdb_prompt $"\
|
||||
{pass "breakpoint with trailing garbage disallowed"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "breakpoint with trailing garbage disallowed"}
|
||||
timeout {fail "(timeout) breakpoint with trailing garbage disallowed"}
|
||||
}
|
||||
|
||||
# Verify that GDB responds gracefully to a "clear" command that has
|
||||
# no matching breakpoint. (First, get us off the current source line,
|
||||
# which we know has a breakpoint.)
|
||||
#
|
||||
send_gdb "next\n"
|
||||
gdb_expect {
|
||||
-re ".*$gdb_prompt $"\
|
||||
{pass "step over breakpoint"}
|
||||
timeout {fail "(timeout) step over breakpoint"}
|
||||
}
|
||||
send_gdb "clear 66\n"
|
||||
gdb_expect {
|
||||
-re "No breakpoint at 66..*$gdb_prompt $"\
|
||||
{pass "clear line has no breakpoint disallowed"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "clear line has no breakpoint disallowed"}
|
||||
timeout {fail "(timeout) clear line has no breakpoint disallowed"}
|
||||
}
|
||||
send_gdb "clear\n"
|
||||
gdb_expect {
|
||||
-re "No breakpoint at this line..*$gdb_prompt $"\
|
||||
{pass "clear current line has no breakpoint disallowed"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "clear current line has no breakpoint disallowed"}
|
||||
timeout {fail "(timeout) clear current line has no breakpoint disallowed"}
|
||||
}
|
||||
|
||||
# Verify that a breakpoint can be set via a convenience variable.
|
||||
#
|
||||
send_gdb "set \$foo=66\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "set convenience variable \$foo to 66"}
|
||||
timeout {fail "(timeout) set convenience variable \$foo to 66"}
|
||||
}
|
||||
send_gdb "break \$foo\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 66.*$gdb_prompt $"\
|
||||
{pass "set breakpoint via convenience variable"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "set breakpoint via convenience variable"}
|
||||
timeout {fail "(timeout) set breakpoint via convenience variable"}
|
||||
}
|
||||
|
||||
# Verify that GDB responds gracefully to an attempt to set a
|
||||
# breakpoint via a convenience variable whose type is not integer.
|
||||
#
|
||||
send_gdb "set \$foo=66.5\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "set convenience variable \$foo to 66.5"}
|
||||
timeout {fail "(timeout) set convenience variable \$foo to 66.5"}
|
||||
}
|
||||
send_gdb "break \$foo\n"
|
||||
gdb_expect {
|
||||
-re "Convenience variables used in line specs must have integer values..*$gdb_prompt $"\
|
||||
{pass "set breakpoint via non-integer convenience variable disallowed"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "set breakpoint via non-integer convenience variable disallowed"}
|
||||
timeout {fail "(timeout) set breakpoint via non-integer convenience variable disallowed"}
|
||||
}
|
||||
|
||||
# Verify that we can set and trigger a breakpoint in a user-called function.
|
||||
#
|
||||
send_gdb "break marker2\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 42.*$gdb_prompt $"\
|
||||
{pass "set breakpoint on to-be-called function"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "set breakpoint on to-be-called function"}
|
||||
timeout {fail "(timeout) set breakpoint on to-be-called function"}
|
||||
}
|
||||
send_gdb "print marker2(99)\n"
|
||||
gdb_expect {
|
||||
-re "The program being debugged stopped while in a function called from GDB.\r\nWhen the function .marker2. is done executing, GDB will silently\r\nstop .instead of continuing to evaluate the expression containing\r\nthe function call...*$gdb_prompt $"\
|
||||
{pass "hit breakpoint on called function"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "hit breakpoint on called function"}
|
||||
timeout {fail "(timeout) hit breakpoint on called function"}
|
||||
}
|
||||
|
||||
# As long as we're stopped (breakpointed) in a called function,
|
||||
# verify that we can successfully backtrace & such from here.
|
||||
#
|
||||
if [istarget "hppa*-*-hpux*"] then {
|
||||
send_gdb "bt\n"
|
||||
gdb_expect {
|
||||
-re "#0\[ \t\]*marker2.*:42\r\n#1.*_sr4export.*$gdb_prompt $"\
|
||||
{pass "backtrace while in called function"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "backtrace while in called function"}
|
||||
timeout {fail "(timeout) backtrace while in called function"}
|
||||
}
|
||||
send_gdb "finish\n"
|
||||
gdb_expect {
|
||||
-re "Run till exit from .*marker2.* at .*42\r\n.* in _sr4export.*$gdb_prompt $"\
|
||||
{pass "finish from called function"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "finish from called function"}
|
||||
timeout {fail "(timeout) finish from called function"}
|
||||
}
|
||||
}
|
||||
|
||||
# Verify that GDB responds gracefully to a "finish" command with
|
||||
# arguments.
|
||||
#
|
||||
if ![runto_main] then { fail "break tests suppressed" }
|
||||
|
||||
send_gdb "finish 123\n"
|
||||
gdb_expect {
|
||||
-re "The \"finish\" command does not take any arguments.\r\n$gdb_prompt $"\
|
||||
{pass "finish with arguments disallowed"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "finish with arguments disallowed"}
|
||||
timeout {fail "(timeout) finish with arguments disallowed"}
|
||||
}
|
||||
|
||||
# Verify that GDB responds gracefully to a request to "finish" from
|
||||
# the outermost frame.
|
||||
#
|
||||
send_gdb "finish\n"
|
||||
gdb_expect {
|
||||
-re "\"finish\" not meaningful in the outermost frame.\r\n$gdb_prompt $"\
|
||||
{pass "finish from outermost frame disallowed"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "finish from outermost frame disallowed"}
|
||||
timeout {fail "(timeout) finish from outermost frame disallowed"}
|
||||
}
|
||||
|
||||
# Verify that we can explicitly ask GDB to stop on all shared library
|
||||
# events, and that it does so.
|
||||
#
|
||||
if [istarget "hppa*-*-hpux*"] then {
|
||||
if ![runto_main] then { fail "break tests suppressed" }
|
||||
|
||||
send_gdb "set stop-on-solib-events 1\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "set stop-on-solib-events"}
|
||||
timeout {fail "(timeout) set stop-on-solib-events"}
|
||||
}
|
||||
|
||||
send_gdb "run\n"
|
||||
gdb_expect {
|
||||
-re ".*Start it from the beginning.*y or n. $"\
|
||||
{send_gdb "y\n"
|
||||
gdb_expect {
|
||||
-re ".*Stopped due to shared library event.*$gdb_prompt $"\
|
||||
{pass "triggered stop-on-solib-events"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "triggered stop-on-solib-events"}
|
||||
timeout {fail "(timeout) triggered stop-on-solib-events"}
|
||||
}
|
||||
}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "rerun for stop-on-solib-events"}
|
||||
timeout {fail "(timeout) rerun for stop-on-solib-events"}
|
||||
}
|
||||
|
||||
send_gdb "set stop-on-solib-events 0\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "reset stop-on-solib-events"}
|
||||
timeout {fail "(timeout) reset stop-on-solib-events"}
|
||||
}
|
||||
}
|
||||
|
||||
# Hardware breakpoints are unsupported on HP-UX. Verify that GDB
|
||||
# gracefully responds to requests to create them.
|
||||
#
|
||||
if [istarget "hppa*-*-hpux*"] then {
|
||||
if ![runto_main] then { fail "break tests suppressed" }
|
||||
|
||||
send_gdb "hbreak\n"
|
||||
gdb_expect {
|
||||
-re "No hardware breakpoint support in the target.*$gdb_prompt $"\
|
||||
{pass "hw breaks disallowed"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "hw breaks disallowed"}
|
||||
timeout {fail "(timeout) hw breaks disallowed"}
|
||||
}
|
||||
|
||||
send_gdb "thbreak\n"
|
||||
gdb_expect {
|
||||
-re "No hardware breakpoint support in the target.*$gdb_prompt $"\
|
||||
{pass "temporary hw breaks disallowed"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "temporary hw breaks disallowed"}
|
||||
timeout {fail "(timeout) temporary hw breaks disallowed"}
|
||||
}
|
||||
}
|
||||
|
||||
#********
|
||||
|
||||
|
||||
proc test_clear_command {} {
|
||||
gdb_test "break main" "Breakpoint.*at.*" "break main #1"
|
||||
gdb_test "break main" "Breakpoint.*at.*" "break main #2"
|
||||
|
||||
# We don't test that it deletes the correct breakpoints. We do at
|
||||
# least test that it deletes more than one breakpoint.
|
||||
gdb_test "clear main" {Deleted breakpoints [0-9]+ [0-9]+.*}
|
||||
}
|
||||
|
||||
#
|
||||
# Test "next" over recursive function call.
|
||||
#
|
||||
|
||||
proc test_next_with_recursion {} {
|
||||
global gdb_prompt
|
||||
global decimal
|
||||
global binfile
|
||||
|
||||
if [target_info exists use_gdb_stub] {
|
||||
# Reload the program.
|
||||
delete_breakpoints
|
||||
gdb_load ${binfile};
|
||||
} else {
|
||||
# FIXME: should be using runto
|
||||
gdb_test "kill" "" "kill program" "Kill the program being debugged.*y or n. $" "y"
|
||||
|
||||
delete_breakpoints
|
||||
}
|
||||
|
||||
gdb_test "break factorial" "Breakpoint $decimal at .*" "break at factorial"
|
||||
|
||||
# Run until we call factorial with 6
|
||||
|
||||
if [istarget "*-*-vxworks*"] then {
|
||||
send_gdb "run vxmain \"6\"\n"
|
||||
} else {
|
||||
gdb_run_cmd
|
||||
}
|
||||
gdb_expect {
|
||||
-re "Break.* factorial .value=6. .*$gdb_prompt $" {}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "run to factorial(6)";
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
timeout { fail "run to factorial(6) (timeout)" ; gdb_suppress_tests }
|
||||
}
|
||||
|
||||
# Continue until we call factorial recursively with 5.
|
||||
|
||||
if [gdb_test "continue" \
|
||||
"Continuing.*Break.* factorial .value=5. .*" \
|
||||
"continue to factorial(5)"] then { gdb_suppress_tests }
|
||||
|
||||
# Do a backtrace just to confirm how many levels deep we are.
|
||||
|
||||
if [gdb_test "backtrace" \
|
||||
"#0\[ \t\]+ factorial .value=5..*" \
|
||||
"backtrace from factorial(5)"] then { gdb_suppress_tests }
|
||||
|
||||
# Now a "next" should position us at the recursive call, which
|
||||
# we will be performing with 4.
|
||||
|
||||
if [gdb_test "next" \
|
||||
".* factorial .value - 1.;.*" \
|
||||
"next to recursive call"] then { gdb_suppress_tests }
|
||||
|
||||
# Disable the breakpoint at the entry to factorial by deleting them all.
|
||||
# The "next" should run until we return to the next line from this
|
||||
# recursive call to factorial with 4.
|
||||
# Buggy versions of gdb will stop instead at the innermost frame on
|
||||
# the line where we are trying to "next" to.
|
||||
|
||||
delete_breakpoints
|
||||
|
||||
if [istarget "mips*tx39-*"] {
|
||||
set timeout 60
|
||||
} else {
|
||||
set timeout 20
|
||||
}
|
||||
|
||||
gdb_test next "\[0-9\]*\[\t \]+return \\(value\\);.*" \
|
||||
"next over recursive call"
|
||||
|
||||
# OK, we should be back in the same stack frame we started from.
|
||||
# Do a backtrace just to confirm.
|
||||
|
||||
set result [gdb_test "backtrace" \
|
||||
"#0\[ \t\]+ factorial .value=120.*\r\n#1\[ \t\]+ \[0-9a-fx\]+ in factorial .value=6..*" \
|
||||
"backtrace from factorial(5.1)"]
|
||||
if { $result != 0 } { gdb_suppress_tests }
|
||||
|
||||
if [target_info exists gdb,noresults] { gdb_suppress_tests }
|
||||
if [target_info exists use_gdb_stub] {
|
||||
gdb_breakpoint "exit"
|
||||
gdb_test "continue" "Continuing..*Breakpoint .*exit \[(\].*=0\[)\].*" "continue until exit in recursive next test"
|
||||
} else {
|
||||
# Continue until we exit. Should not stop again.
|
||||
# Don't bother to check the output of the program, that may be
|
||||
# extremely tough for some remote systems.
|
||||
gdb_test "continue"\
|
||||
"Continuing.\[\r\n0-9\]+Program exited normally\\..*"\
|
||||
"continue until exit in recursive next test"
|
||||
}
|
||||
gdb_stop_suppressing_tests;
|
||||
}
|
||||
|
||||
test_clear_command
|
||||
test_next_with_recursion
|
||||
|
||||
# Reset the default arguments for VxWorks
|
||||
if [istarget "*-*-vxworks*"] {
|
||||
set timeout 10
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
send_gdb "set args main\n"
|
||||
gdb_expect -re ".*$gdb_prompt $" {}
|
||||
}
|
||||
1137
gdb/testsuite/gdb.base/call-ar-st.c
Normal file
1137
gdb/testsuite/gdb.base/call-ar-st.c
Normal file
File diff suppressed because it is too large
Load Diff
451
gdb/testsuite/gdb.base/call-ar-st.exp
Normal file
451
gdb/testsuite/gdb.base/call-ar-st.exp
Normal file
@@ -0,0 +1,451 @@
|
||||
# Copyright (C) 1998
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# This file was written by Elena Zannoni (ezannoni@cygnus.com)
|
||||
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile "call-ar-st"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
|
||||
# Create and source the file that provides information about the compiler
|
||||
# used to compile the test case.
|
||||
|
||||
if [get_compiler_info ${binfile}] {
|
||||
return -1;
|
||||
}
|
||||
|
||||
# The a29k can't call functions, so don't even bother with this test.
|
||||
if [target_info exists gdb,cannot_call_functions] {
|
||||
setup_xfail "*-*-*" 2416
|
||||
fail "This target can not call functions"
|
||||
continue
|
||||
}
|
||||
|
||||
# Set the current language to C. This counts as a test. If it
|
||||
# fails, then we skip the other tests.
|
||||
|
||||
proc set_lang_c {} {
|
||||
global gdb_prompt
|
||||
|
||||
send_gdb "set language c\n"
|
||||
gdb_expect {
|
||||
-re ".*$gdb_prompt $" {}
|
||||
timeout { fail "set language c (timeout)" ; return 0; }
|
||||
}
|
||||
|
||||
send_gdb "show language\n"
|
||||
gdb_expect {
|
||||
-re ".* source language is \"c\".*$gdb_prompt $" {
|
||||
pass "set language to \"c\""
|
||||
return 1
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "setting language to \"c\""
|
||||
return 0
|
||||
}
|
||||
timeout {
|
||||
fail "can't show language (timeout)"
|
||||
return 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
source ${binfile}.ci
|
||||
|
||||
|
||||
# Start with a fresh gdb.
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
send_gdb "set print sevenbit-strings\n" ; gdb_expect -re "$gdb_prompt $"
|
||||
send_gdb "set print address off\n" ; gdb_expect -re "$gdb_prompt $"
|
||||
send_gdb "set width 0\n" ; gdb_expect -re "$gdb_prompt $"
|
||||
|
||||
|
||||
if ![runto_main] then {
|
||||
perror "couldn't run to breakpoint"
|
||||
continue
|
||||
}
|
||||
|
||||
#go -until 1007
|
||||
gdb_test "tbreak 1007" \
|
||||
"Breakpoint \[0-9\]+.*file.*$srcfile, line 1007.*" \
|
||||
"tbreakpoint line 1007"
|
||||
|
||||
gdb_test continue \
|
||||
"Continuing\\..*main \\(\\) at.*$srcfile:1007.*" \
|
||||
"run until breakpoint set at a line"
|
||||
|
||||
|
||||
#call print_double_array(double_array)
|
||||
send_gdb "print print_double_array(double_array)\n"
|
||||
gdb_expect {
|
||||
-re "array_d :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+0.000000\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600\[ \t\r\n\]+211.110300 234.567000 258.023700 281.480400 304.937100 328.393800 351.850500 375.307200\[ \t\r\n\]+398.763900 422.220600 445.677300 469.134000 492.590700 516.047400 539.504100 562.960800\[ \t\r\n\]+586.417500 609.874200 633.330900 656.787600 680.244300 703.701000 727.157700 750.614400\[ \t\r\n\]+774.071100 797.527800 820.984500 844.441200 867.897900 891.354600 914.811300 938.268000\[ \t\r\n\]+961.724700 985.181400 1008.638100 1032.094800 1055.551500 1079.008200 1102.464900 1125.921600\[ \t\r\n\]+1149.378300 1172.835000 1196.291700 1219.748400 1243.205100 1266.661800 1290.118500 1313.575200\[ \t\r\n\]+1337.031900 1360.488600 1383.945300 1407.402000 1430.858700 1454.315400 1477.772100 1501.228800\[ \t\r\n\]+1524.685500 1548.142200 1571.598900 1595.055600 1618.512300 1641.969000 1665.425700 1688.882400\[ \t\r\n\]+1712.339100 1735.795800 1759.252500 1782.709200 1806.165900 1829.622600 1853.079300 1876.536000\[ \t\r\n\]+1899.992700 1923.449400 1946.906100 1970.362800 1993.819500 2017.276200 2040.732900 2064.189600\[ \t\r\n\]+2087.646300 2111.103000 2134.559700 2158.016400 2181.473100 2204.929800 2228.386500 2251.843200\[ \t\r\n\]+2275.299900 2298.756600 2322.213300\[ \t\r\n\]+\[ \t\r\n\]+.*$gdb_prompt $" {
|
||||
pass "print print_double_array(double_array)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_double_array(double_array)" }
|
||||
timeout { fail "(timeout) print print_double_array(double_array)" }
|
||||
}
|
||||
|
||||
|
||||
#call print_char_array(char_array)
|
||||
send_gdb "print print_char_array(char_array)\n"
|
||||
gdb_expect {
|
||||
-re "array_c :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+Z\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZa\[ \t\r\n\]+\[ \t\r\n\]+.*\[ \t\r\n\]+.*$gdb_prompt $" {
|
||||
pass "print print_char_array(char_array)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_char_array(char_array)" }
|
||||
timeout { fail "(timeout) print print_char_array(char_array)" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
#go -until 1014
|
||||
gdb_test "tbreak 1014" \
|
||||
"Breakpoint.*file.*$srcfile, line 1014.*" \
|
||||
"tbreakpoint line 1014"
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re "array_c :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+Z\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZa\[ \t\r\n\]+\[ \t\r\n\]+\[ \t\r\n\]+main.*at.*$srcfile:1014\[ \t\r\n\]+.*print_double_array\\(double_array\\).*$gdb_prompt $" {
|
||||
pass "continue to 1014"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "continue to 1014" }
|
||||
timeout { fail "(timeout) continue to 1014" }
|
||||
}
|
||||
|
||||
# I am disabling this test, because it takes too long. I verified by
|
||||
# hand that it works, feel free to check for yourself.
|
||||
#call print_all_arrays(integer_array, char_array, float_array, double_array)
|
||||
#send_gdb "print print_all_arrays(integer_array, char_array, float_array, double_array)\n"
|
||||
#gdb_expect {
|
||||
# -re ".*array_i :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+0\[ \t\r\n\]+-1 -2 -3 -4 -5 -6 -7 -8\[ \t\r\n\]+-9 -10 -11 -12 -13 -14 -15 -16\[ \t\r\n\]+-17 -18 -19 -20 -21 -22 -23 -24\[ \t\r\n\]+-25 -26 -27 -28 -29 -30 -31 -32\[ \t\r\n\]+-33 -34 -35 -36 -37 -38 -39 -40\[ \t\r\n\]+-41 -42 -43 -44 -45 -46 -47 -48\[ \t\r\n\]+-49\[ \t\r\n\]+\[ \t\r\n\]+array_c :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+Z\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZa\[ \t\r\n\]+\[ \t\r\n\]+array_f :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+0.000000\[ \t\r\n\]+0.142450 0.284900 0.427350 0.569801 0.712251 0.854701 0.997151 1.139601\[ \t\r\n\]+1.282051 1.424501 1.566952 1.709402 1.851852 1.994302\[ \t\r\n\]+\[ \t\r\n\]+array_d :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+0.000000\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600\[ \t\r\n\]+211.110300 234.567000 258.023700 281.480400 304.937100 328.393800 351.850500 375.307200\[ \t\r\n\]+398.763900 422.220600 445.677300 469.134000 492.590700 516.047400 539.504100 562.960800\[ \t\r\n\]+586.41750 609.874200 633.330900 656.787600 680.244300 703.701000 727.157700 750.614400\[ \t\r\n\]+774.071100 797.527800 820.984500 844.441200 867.897900 891.354600 914.811300 938.268000\[ \t\r\n\]+961.724700 985.181400 1008.638100 1032.094800 1055.551500 1079.008200 1102.464900 1125.921600\[ \t\r\n\]+1149.378300 1172.835000 1196.291700 1219.748400 1243.205100 1266.661800 1290.118500 1313.575200\[ \t\r\n\]+1337.031900 1360.488600 1383.945300 1407.402000 1430.858700 1454.315400 1477.772100 1501.228800\[ \t\r\n\]+1524.685500 1548.142200 1571.598900 1595.055600 1618.512300 1641.969000 1665.425700 1688.882400\[ \t\r\n\]+1712.339100 1735.795800 1759.252500 1782.709200 1806.165900 1829.622600 1853.079300 1876.536000\[ \t\r\n\]+1899.992700 1923.449400 1946.906100 1970.362800 1993.819500 2017.276200 2040.732900 2064.189600\[ \t\r\n\]+2087.646300 2111.103000 2134.559700 2158.016400 2181.473100 2204.929800 2228.386500 2251.843200\[ \t\r\n\]+2275.299900 2298.756600 2322.213300.*$gdb_prompt $" {
|
||||
# pass "print print_all_arrays(integer_array, char_array, float_array, double_array)"
|
||||
# }
|
||||
# -re ".*$gdb_prompt $" { fail "print print_all_arrays(integer_array, char_array, float_array, double_array)" }
|
||||
# timeout { fail "(timeout) print print_all_arrays(integer_array, char_array, float_array, double_array)" }
|
||||
# }
|
||||
|
||||
#set timeout $oldtimeout
|
||||
#go -until 1018
|
||||
gdb_test "tbreak 1018" \
|
||||
"Breakpoint.* file .*$srcfile, line 1018.*" \
|
||||
"tbreakpoint line 1018"
|
||||
|
||||
gdb_test continue \
|
||||
"Continuing\\..*array_d :.*array_f :.*student id :\[\t \]+.*YELLOW.*array_i :.*main \\(\\) at .*call-ar-st.c:1018\[ \t\r\n\]+.*print_all_arrays\\(integer_array, char_array, float_array, double_array\\)." \
|
||||
"continuing to breakpoint 1018"
|
||||
|
||||
#step
|
||||
send_gdb "step\n"
|
||||
gdb_expect {
|
||||
-re "print_all_arrays \\(array_i=, array_c=.ZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZa., array_f=, array_d=\\) at .*call-ar-st.c:287\[ \t\r\n\]+287.*print_int_array\\(array_i\\);.*$gdb_prompt $" {pass "step inside print_all_arrays"}
|
||||
-re ".*$gdb_prompt $" { fail "step inside print_all_arrays" }
|
||||
timeout { fail "step inside print_all_arrays (timeout)" }
|
||||
}
|
||||
|
||||
|
||||
#step -over
|
||||
send_gdb "next\n"
|
||||
gdb_expect {
|
||||
-re "array_i :.*288.*print_char_array\\(array_c\\);.*$gdb_prompt $" {pass "next over print_int_array in print-all_arrays"}
|
||||
-re ".*$gdb_prompt $" { fail "next over print_int_array in print-all_arrays" }
|
||||
timeout { fail "next over print_int_array in print-all_arrays (timeout)" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
#call print_double_array(array_d)
|
||||
send_gdb "print print_double_array(array_d)\n"
|
||||
gdb_expect {
|
||||
-re "array_d :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+0.000000\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600\[ \t\r\n\]+211.110300 234.567000 258.023700 281.480400 304.937100 328.393800 351.850500 375.307200\[ \t\r\n\]+398.763900 422.220600 445.677300 469.134000 492.590700 516.047400 539.504100 562.960800\[ \t\r\n\]+586.417500 609.874200 633.330900 656.787600 680.244300 703.701000 727.157700 750.614400\[ \t\r\n\]+774.071100 797.527800 820.984500 844.441200 867.897900 891.354600 914.811300 938.268000\[ \t\r\n\]+961.724700 985.181400 1008.638100 1032.094800 1055.551500 1079.008200 1102.464900 1125.921600\[ \t\r\n\]+1149.378300 1172.835000 1196.291700 1219.748400 1243.205100 1266.661800 1290.118500 1313.575200\[ \t\r\n\]+1337.031900 1360.488600 1383.945300 1407.402000 1430.858700 1454.315400 1477.772100 1501.228800\[ \t\r\n\]+1524.685500 1548.142200 1571.598900 1595.055600 1618.512300 1641.969000 1665.425700 1688.882400\[ \t\r\n\]+1712.339100 1735.795800 1759.252500 1782.709200 1806.165900 1829.622600 1853.079300 1876.536000\[ \t\r\n\]+1899.992700 1923.449400 1946.906100 1970.362800 1993.819500 2017.276200 2040.732900 2064.189600\[ \t\r\n\]+2087.646300 2111.103000 2134.559700 2158.016400 2181.473100 2204.929800 2228.386500 2251.843200\[ \t\r\n\]+2275.299900 2298.756600 2322.213300\[ \t\r\n\]+\[ \t\r\n\]+.*$gdb_prompt $" {
|
||||
pass "print print_double_array(array_d)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_double_array(array_d)" }
|
||||
timeout { fail "(timeout) print print_double_array(array_d)" }
|
||||
}
|
||||
|
||||
|
||||
#go -until 1034
|
||||
gdb_test "tbreak 1034" \
|
||||
"Breakpoint.* file .*$srcfile, line 1034.*" \
|
||||
"tbreakpoint line 1034"
|
||||
|
||||
gdb_test continue "Continuing\\..*array_c.*array_f.*array_d.*HELLO WORLD.*main \\(\\) at .*call-ar-st.c:1034.*printf\\(.BYE BYE FOR NOW.n.\\)." "continuing to 1034"
|
||||
|
||||
|
||||
#call sum_array_print(10, *list1, *list2, *list3, *list4)
|
||||
send_gdb "print sum_array_print(10, *list1, *list2, *list3, *list4)\n"
|
||||
gdb_expect {
|
||||
-re ".*Sum of 4 arrays, by element \\(add in seed as well\\):\[ \t\r\n\]+Seed: 10\[ \t\r\n\]+Element Index . Sum\[ \t\r\n\]+-------------------------\[ \t\r\n\]+.*\[ \t\]+0\[ \t\]+52\[ \t\r\n\]+1\[ \t\]+60\[ \t\r\n\]+2\[ \t\]+68\[ \t\r\n\]+3\[ \t\]+76\[ \t\r\n\]+4\[ \t\]+84\[ \t\r\n\]+5\[ \t\]+92\[ \t\r\n\]+6\[ \t\]+100\[ \t\r\n\]+7\[ \t\]+108\[ \t\r\n\]+8\[ \t\]+116\[ \t\r\n\]+9\[ \t\]+124\[ \t\r\n\]+.*$gdb_prompt $" {
|
||||
pass "print sum_array_print(10, *list1, *list2, *list3, *list4)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print sum_array_print(10, *list1, *list2, *list3, *list4)" }
|
||||
timeout { fail "(timeout) print sum_array_print(10, *list1, *list2, *list3, *list4)" }
|
||||
}
|
||||
|
||||
|
||||
#step -over
|
||||
send_gdb "next\n"
|
||||
gdb_expect {
|
||||
-re "BYE BYE FOR NOW\[ \t\r\n\]+1035\[ \t\r\n\]+printf\\(.VERY GREEN GRASS.n.\\);\[ \t\r\n\]+.*$gdb_prompt $" { pass "next to 1035"}
|
||||
-re ".*$gdb_prompt $" { fail "next to 1035" }
|
||||
timeout { fail "next to 1035(timeout)" }
|
||||
}
|
||||
|
||||
#call print_array_rep(\*list1, \*list2, \*list3)
|
||||
|
||||
send_gdb "print print_array_rep(\*list1, \*list2, \*list3)\n"
|
||||
gdb_expect {
|
||||
-re ".*.*$gdb_prompt $" {
|
||||
pass "print print_array_rep(*list1, *list2, *list3)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_array_rep(*list1, *list2, *list3)" }
|
||||
timeout { fail "(timeout) print print_array_rep(*list1, *list2, *list3)"# }
|
||||
}
|
||||
|
||||
|
||||
|
||||
#go -until 1039
|
||||
gdb_test "tbreak 1039" \
|
||||
"Breakpoint..* file .*$srcfile, line 1039.*" \
|
||||
"tbreakpoint line 1039"
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re ".*main \\(\\) at .*call-ar-st.c:1039\r\n1039\t\[ \]+sum_array_print\\(10, \\*list1, \\*list2, \\*list3, \\*list4\\);.*$gdb_prompt $" {
|
||||
pass "continue to 1039"}
|
||||
-re ".*$gdb_prompt $" { fail "continue to 1039"}
|
||||
timeout { fail "(timeout) continue to 1039"}
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Run into sum_array_print, and verify that the arguments were passed
|
||||
# accurately.
|
||||
#
|
||||
# Note that we shouldn't use a `step' here to get into
|
||||
# sum_array_print; GCC may emit calls to memcpy to put the arguments
|
||||
# in the right place, and a step may end up in memcpy instead. This
|
||||
# may itself be a bug, but it's not the one we're trying to catch
|
||||
# here. I've added something to step-test.exp for this.
|
||||
gdb_test "break sum_array_print" \
|
||||
".*Breakpoint ${decimal}: file .*call-ar-st.c, line.*" \
|
||||
"set breakpoint in sum_array_print"
|
||||
gdb_test "continue" \
|
||||
".*Breakpoint ${decimal}, sum_array_print \\(seed=10, linked_list1=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .4, 6, 8, 10, 12, 14, 16, 18, 20, 22., head = 0., linked_list2=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .8, 10, 12, 14, 16, 18, 20, 22, 24, 26., head = 0., linked_list3=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .10, 12, 14, 16, 18, 20, 22, 24, 26, 28., head = 0., linked_list4=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .20, 22, 24, 26, 28, 30, 32, 34, 36, 38., head = 0.\\) at .*call-ar-st.c:909\[ \t\n\r\]+909.*printf\\(.Sum of 4 arrays, by element \\(add in seed as well\\).*\\);.*" \
|
||||
"check args of sum_array_print"
|
||||
|
||||
#call print_array_rep(linked_list1, linked_list2, linked_list3)
|
||||
# this calls works from gdb without gdb_expect. But it does seem to hang
|
||||
#from within gdb_expect.
|
||||
#I comment this out
|
||||
#send_gdb "print print_array_rep(linked_list1, linked_list2, linked_list3)\n"
|
||||
#gdb_expect {
|
||||
# -re ".*Contents of linked list1:\[ \t\n\r\]+Element Value . Index of Next Element\[ \t\n\r\]+-------------------------------------\[ \t\n\r\]+.*\[ \t\n\r\]+.*4.*1\[ \t\n\r\]+.*6.*2\[ \t\n\r\]+.*8.*3\[ \t\n\r\]+.*10.*4\[ \t\n\r\]+.*12.*5\[ \t\n\r\]+.*14.*6\[ \t\n\r\]+.*16.*7\[ \t\n\r\]+.*18.*8\[ \t\n\r\]+.*20.*9\[ \t\n\r\]+.*22.*10\[ \t\n\r\]+Contents of linked list2:\[ \t\n\r\]+Element Value | Index of Next Element\[ \t\n\r\]+-------------------------------------\[ \t\n\r\]+.*\[ \t\n\r\]+.*8.*1\[ \t\n\r\]+.*10.*2\[ \t\n\r\]+.*12.*3\[ \t\n\r\]+.*14.*4\[ \t\n\r\]+.*16.*5\[ \t\n\r\]+.*18.*6\[ \t\n\r\]+.*20.*7\[ \t\n\r\]+.*22.*8\[ \t\n\r\]+.*24.*9\[ \t\n\r\]+.*26.*10\[ \t\n\r\]+Contents of linked list3:\[ \t\n\r\]+Element Value | Index of Next Element\[ \t\n\r\]+-------------------------------------\[ \t\n\r\]+.*\[ \t\n\r\]+.*10.*1\[ \t\n\r\]+.*12.*2\[ \t\n\r\]+.*14.*3\[ \t\n\r\]+.*16.*4\[ \t\n\r\]+.*18.*5\[ \t\n\r\]+.*20.*6\[ \t\n\r\]+.*22.*7\[ \t\n\r\]+.*24.*8\[ \t\n\r\]+.*26.*9\[ \t\n\r\]+.*28.*10\[ \t\n\r\]+.*$gdb_prompt $" {
|
||||
# pass "print print_array_rep(linked_list1, linked_list2, linked_list3)"
|
||||
# }
|
||||
# -re ".*$gdb_prompt $" { fail "print print_array_rep(linked_list1, linked_list2, linked_list3)" }
|
||||
# timeout { fail "(timeout) print print_array_rep(linked_list1, linked_list2, linked_list3)" }
|
||||
#}
|
||||
|
||||
|
||||
#go -until 1079
|
||||
gdb_test "tbreak 1079" \
|
||||
"Breakpoint.* file .*call-ar-st.c, line 1079.*" \
|
||||
"tbreakpoint line 1079"
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re "Continuing\\..*Sum of 4 arrays.*Contents of linked list1.*Contents of two_floats_t.*main \\(\\) at .*call-ar-st.c:1079.*c = 0.*$gdb_prompt $" {
|
||||
pass "continue to 1079"}
|
||||
-re ".*$gdb_prompt $" { fail "continue to 1079"}
|
||||
timeout { fail "(timeout) continue to 1079"}
|
||||
}
|
||||
|
||||
#call print_small_structs(*struct1, *struct2, *struct3, *struct4,*flags, *flags_combo,
|
||||
#*three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)
|
||||
send_gdb "print print_small_structs(*struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)\n"
|
||||
gdb_expect {
|
||||
-re ".*alpha\[\t\r\n \]+gamma\[\t\r\n \]+epsilon\[\t\r\n \]+alpha\[\t\r\n \]+gamma\[\t\r\n \]+epsilon\[\t\r\n \]+ch1: y\tch2: n\[\t\r\n \]+Contents of three_char_t:\[\t\r\n \]+a\tb\tc\[\t\r\n \]+Contents of five_char_t:\[\t\r\n \]+l\tm\tn\to\tp\[\t\r\n \]+Contents of int_char_combo_t:\[\t\r\n \]+123.*z\[\t\r\n \]+Sum of the 4 struct values and seed :\[\t\r\n \]+52\[\t\r\n \]+Contents of struct1:\[\t\r\n \]+6.*0\[\t\r\n \]+Contents of struct2:\[\t\r\n \]+10.*0\[\t\r\n \]+Contents of struct3:\[\t\r\n \]+12.*0\[\t\r\n \]+Contents of one_double_t:\[\t\r\n \]+10.500000\[\t\r\n \]+Contents of one_double_t:.*-3.340000\[\t\r\n \]+Contents of one_double_t:.*675.091230\[\t\r\n \]+Contents of two_floats_t:.*45.234001.*43.599998\[\t\r\n \]+Contents of two_floats_t:.*78.010002.*122.099998\[\t\r\n \]+Contents of two_floats_t:.*-1232.344971.*-199.210007\[\t\r\n \]+.*$gdb_prompt $" {
|
||||
pass "print print_small_structs"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_small_structs" }
|
||||
timeout { fail "(timeout) print_small_structs" }
|
||||
}
|
||||
|
||||
|
||||
#call compute_with_small_structs(20)
|
||||
send_gdb "print compute_with_small_structs(20)\n"
|
||||
gdb_expect {
|
||||
-re ".*\[0-9\]+ =.*$gdb_prompt $" {
|
||||
pass "print compute_with_small_structs(20)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print compute_with_small_structs(20)" }
|
||||
timeout { fail "(timeout) compute_with_small_structs(20)" }
|
||||
}
|
||||
|
||||
|
||||
#call print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098, 3.14, -5678.12345, -0.11111111, 216.97065)
|
||||
send_gdb "print print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098, 3.14, -5678.12345, -0.11111111, 216.97065)\n"
|
||||
gdb_expect {
|
||||
-re ".*Two Doubles : 123.456000.*123.456000\[\t\r\n \]+Two Doubles : -0.120000.*-1.230000\[\t\r\n \]+Two Doubles : 343434.800000.*89.098000\[\t\r\n \]+Two Doubles : 3.140000.*-5678.123450\[\t\r\n \]+Two Doubles : -0.111111.*216.970650\[\t\r\n \]+.*$gdb_prompt $" {
|
||||
pass "print print_ten_doubles"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_ten_doubles" }
|
||||
timeout { fail "(timeout) print_ten_doubles" }
|
||||
}
|
||||
|
||||
#go -until 1084
|
||||
gdb_test "tbreak 1084" \
|
||||
"Breakpoint .* file .*call-ar-st.c, line 1084.*" \
|
||||
"tbreakpoint line 1084"
|
||||
|
||||
gdb_test continue "Continuing\\..*main \\(.*\\) at.*call-ar-st.c:1084\[\t\r\n \]+1084.*print_long_arg_list \\( a, b, c, d, e, f, .struct1, .struct2, .struct3, .struct4,.*" "continue to 1084"
|
||||
|
||||
|
||||
send_gdb "step\n"
|
||||
gdb_expect {
|
||||
-re ".*print_long_arg_list \\(a=22.219999999999999, b=33.332999999999998, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}, five_char=\{ch1 = 108 \'l\', ch2 = 109 \'m\', ch3 = 110 \'n\', ch4 = 111 \'o\', ch5 = 112 \'p\'\}, int_char_combo=\{int1 = 123, ch1 = 122 \'z\'\}, d1=\{double1 = 10.5\}, d2=\{double1 = -3.3399999999999999\}, d3=\{double1 = 675.09123\}, f1=\{float1 = 45.2340012, float2 = 43.5999985\}, f2=\{float1 = 78.0100021, float2 = 122.099998\}, f3=\{float1 = -1232.34497, float2 = -199.210007\}\\) at ${srcdir}/${subdir}/${srcfile}:813\[\r\n\]+813\[ \t\]+printf\\(\"double :.*\", a\\);.*$gdb_prompt $" {pass "step into print_long_arg_list"}
|
||||
-re ".*$gdb_prompt $" { fail "step into print_long_arg_list" }
|
||||
timeout { fail "step into print_long_arg_list (timeout)" }
|
||||
}
|
||||
|
||||
|
||||
#call print_small_structs(struct1, struct2, struct3, struct4, flags, flags_combo, three_char, five_char, int_char_combo, d1, d2, d3, f1, f2, f3)
|
||||
send_gdb "print print_small_structs(struct1, struct2, struct3, struct4, flags, flags_combo, three_char, five_char, int_char_combo, d1, d2, d3, f1, f2, f3)\n"
|
||||
gdb_expect {
|
||||
-re ".*alpha\[\t\r\n \]+gamma\[\t\r\n \]+epsilon\[\t\r\n \]+alpha\[\t\r\n \]+gamma\[\t\r\n \]+epsilon\[\t\r\n \]+ch1: y\tch2: n\[\t\r\n \]+Contents of three_char_t:\[\t\r\n \]+a\tb\tc\[\t\r\n \]+Contents of five_char_t:\[\t\r\n \]+l\tm\tn\to\tp\[\t\r\n \]+Contents of int_char_combo_t:\[\t\r\n \]+123.*z\[\t\r\n \]+Sum of the 4 struct values and seed :\[\t\r\n \]+52\[\t\r\n \]+Contents of struct1:\[\t\r\n \]+6.*0\[\t\r\n \]+Contents of struct2:\[\t\r\n \]+10.*0\[\t\r\n \]+Contents of struct3:\[\t\r\n \]+12.*0\[\t\r\n \]+Contents of one_double_t:\[\t\r\n \]+10.500000\[\t\r\n \]+Contents of one_double_t:\[\t\r\n \]+-3.340000\[\t\r\n \]+Contents of one_double_t:\[\t\r\n \]+675.091230\[\t\r\n \]+Contents of two_floats_t:\[\t\r\n \]+45.234001.*43.599998\[\t\r\n \]+Contents of two_floats_t:\[\t\r\n \]+78.010002.*122.099998\[\t\r\n \]+Contents of two_floats_t:\[\t\r\n \]+-1232.344971.*-199.210007\[\t\r\n \]+.*$gdb_prompt $" {
|
||||
pass "print print_small_structs from print_long_arg_list "
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_small_structs from print_long_arg_list" }
|
||||
timeout { fail "(timeout) print_small_structs from print_long_arg_list" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
#go -until 1098
|
||||
gdb_test "tbreak 1098" \
|
||||
"Breakpoint.* file .*call-ar-st.c, line 1098.*" \
|
||||
"tbreakpoint line 1098"
|
||||
|
||||
gdb_test continue "Continuing\\..*Contents of two_floats_t:.*-1232.344971.*-199.210007.*main \\(\\) at.*call-ar-st.c:1098.*1098.*init_bit_flags_combo\\(flags_combo, \\(unsigned\\)1, \\(unsigned\\)0, .y.,.*" \
|
||||
"continue to 1098"
|
||||
|
||||
|
||||
#step
|
||||
send_gdb "step\n"
|
||||
gdb_expect {
|
||||
-re "
|
||||
init_bit_flags_combo \\(bit_flags_combo=, a=1, b=0, ch1=121 .y., g=1, d=0, ch2=110 .n., e=1, o=0\\) at .*call-ar-st.c:385\[ \t\n\r\]+385.*bit_flags_combo->alpha = a;.*$gdb_prompt $" {
|
||||
pass "step into init_bit_flags_combo"}
|
||||
-re ".*$gdb_prompt $" { fail "step into init_bit_flags_combo" }
|
||||
timeout { fail "step into init_bit_flags_combo (timeout)" }
|
||||
}
|
||||
|
||||
#call print_bit_flags_combo(*bit_flags_combo)
|
||||
send_gdb "print print_bit_flags_combo(*bit_flags_combo)\n"
|
||||
gdb_expect {
|
||||
-re ".*alpha.*gamma.*epsilon.*ch1: y\tch2: n.*$gdb_prompt $" {
|
||||
pass "print print_bit_flags_combo from init_bit_flags_combo"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_bit_flags_combo from init_bit_flags_combo" }
|
||||
timeout { fail "(timeout) print_bit_flags_combo from init_bit_flags_combo" }
|
||||
}
|
||||
|
||||
|
||||
#go -until 1103
|
||||
gdb_test "tbreak 1103" \
|
||||
"Breakpoint.* file .*call-ar-st.c, line 1103.*" \
|
||||
"tbreakpoint line 1103"
|
||||
|
||||
gdb_test continue "Continuing\\..*main \\(\\) at .*call-ar-st.c:1103\[\r\n\t \]+1103.*init_int_char_combo\\(int_char_combo, 13, .!.\\);" \
|
||||
"continue to 1103"
|
||||
|
||||
#call print_long_arg_list(a, b, c, d, e, f, *struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)
|
||||
send_gdb "print print_long_arg_list(a, b, c, d, e, f, *struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)\n"
|
||||
gdb_expect {
|
||||
-re ".*double : 22.220000.*double : 33.333000.*int : 0.*int : -25.*int : 100.*int : 2345.*alpha.*gamma.*epsilon.*ch1: y\tch2: n.*Contents of three_char_t:.*x\ty\tz.*Contents of five_char_t:.*h\te\tl\tl\to.*Contents of int_char_combo_t:.*123\tz.*Sum of the 4 struct values and seed :.*52.*Contents of struct1:.*6\[ \]+0.*Contents of struct2:.*10\[ \]+0.*Contents of struct3:.*12.*0.*Contents of one_double_t:\[ \n\r\t\]+1.111110\[ \n\r\t\]+Contents of one_double_t:\[ \n\r\t\]+-345.340000\[ \n\r\t\]+Contents of one_double_t:\[ \n\r\t\]+546464.200000\[ \n\r\t\]+Contents of two_floats_t:\[ \n\r\t\]+0.234000\t453.100006\[ \n\r\t\]+Contents of two_floats_t:\[ \n\r\t\]+78.345001\t23.090000\[ \n\r\t\]+Contents of two_floats_t:\[ \n\r\t\]+-2.345000\t1.000000.*$gdb_prompt $" {
|
||||
pass "print print_long_arg_list"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_long_arg_list" }
|
||||
timeout { fail "(timeout) print_long_arg_list" }
|
||||
}
|
||||
|
||||
|
||||
#go -until 1109
|
||||
gdb_test "tbreak 1109" \
|
||||
"Breakpoint.* file .*call-ar-st.c, line 1109.*" \
|
||||
"tbreakpoint line 1109"
|
||||
|
||||
gdb_test continue "Continuing\\..*main \\(\\) at .*call-ar-st.c:1109\[ \t\n\r\]+1109.*compute_with_small_structs\\(35\\);" \
|
||||
"continue to 1109"
|
||||
|
||||
|
||||
#call sum_struct_print(10, *struct1, *struct2, *struct3, *struct4)
|
||||
send_gdb "print sum_struct_print(10, *struct1, *struct2, *struct3, *struct4)\n"
|
||||
gdb_expect {
|
||||
-re ".*Sum of the 4 struct values and seed :\[ \t\n\r\]+218.*$gdb_prompt $" {
|
||||
pass "print sum_struct_print(10, *struct1, *struct2, *struct3, *struct4)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print sum_struct_print(10, *struct1, *struct2, *struct3, *struct4)" }
|
||||
timeout { fail "(timeout) sum_struct_print(10, *struct1, *struct2, *struct3, *struct4)" }
|
||||
}
|
||||
|
||||
|
||||
#call print_struct_rep(*struct1, *struct2, *struct3)
|
||||
send_gdb "print print_struct_rep(*struct1, *struct2, *struct3)\n"
|
||||
gdb_expect {
|
||||
-re ".*Contents of struct1:\[ \t\n\r\]+ 22 0\[ \t\n\r\]+Contents of struct2:\[ \t\n\r\]+ 42 0\[ \t\n\r\]+Contents of struct3:\[ \t\n\r\]+ 62 0\[ \t\n\r\]+.*$gdb_prompt $" {
|
||||
pass "print print_struct_rep(*struct1, *struct2, *struct3)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_struct_rep(*struct1, *struct2, *struct3)" }
|
||||
timeout { fail "(timeout) print_struct_rep(*struct1, *struct2, *struct3)" }
|
||||
}
|
||||
|
||||
send_gdb "print print_one_large_struct(*list1)\n"
|
||||
gdb_expect {
|
||||
-re ".* 4 1.*$gdb_prompt $" {
|
||||
pass "print print_one_large_struct(*list1)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_one_large_struct(*list1)" }
|
||||
timeout { fail "(timeout) print_one_large_struct(*list1)" }
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
~
|
||||
530
gdb/testsuite/gdb.base/call-rt-st.c
Normal file
530
gdb/testsuite/gdb.base/call-rt-st.c
Normal file
@@ -0,0 +1,530 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/**************************************************************************
|
||||
* TESTS :
|
||||
* function returning large structures, which go on the stack
|
||||
* functions returning varied sized structs which go on in the registers.
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
/* A large structure (> 64 bits) used to test passing large structures as
|
||||
* parameters
|
||||
*/
|
||||
|
||||
struct array_rep_info_t {
|
||||
int next_index[10];
|
||||
int values[10];
|
||||
int head;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* Small structures ( <= 64 bits). These are used to test passing small
|
||||
* structures as parameters and test argument size promotion.
|
||||
*****************************************************************************/
|
||||
|
||||
/* 64 bits
|
||||
*/
|
||||
struct small_rep_info_t {
|
||||
int value;
|
||||
int head;
|
||||
};
|
||||
|
||||
/* 6 bits : really fits in 8 bits and is promoted to 32 bits
|
||||
*/
|
||||
struct bit_flags_t {
|
||||
unsigned alpha :1;
|
||||
unsigned beta :1;
|
||||
unsigned gamma :1;
|
||||
unsigned delta :1;
|
||||
unsigned epsilon :1;
|
||||
unsigned omega :1;
|
||||
};
|
||||
|
||||
/* 22 bits : really fits in 40 bits and is promoted to 64 bits
|
||||
*/
|
||||
struct bit_flags_combo_t {
|
||||
unsigned alpha :1;
|
||||
unsigned beta :1;
|
||||
char ch1;
|
||||
unsigned gamma :1;
|
||||
unsigned delta :1;
|
||||
char ch2;
|
||||
unsigned epsilon :1;
|
||||
unsigned omega :1;
|
||||
};
|
||||
|
||||
/* 64 bits
|
||||
*/
|
||||
struct one_double_t {
|
||||
double double1;
|
||||
};
|
||||
|
||||
/* 64 bits
|
||||
*/
|
||||
struct two_floats_t {
|
||||
float float1;
|
||||
float float2;
|
||||
};
|
||||
|
||||
|
||||
/* 24 bits : promoted to 32 bits
|
||||
*/
|
||||
struct three_char_t {
|
||||
char ch1;
|
||||
char ch2;
|
||||
char ch3;
|
||||
};
|
||||
|
||||
/* 40 bits : promoted to 64 bits
|
||||
*/
|
||||
struct five_char_t {
|
||||
char ch1;
|
||||
char ch2;
|
||||
char ch3;
|
||||
char ch4;
|
||||
char ch5;
|
||||
};
|
||||
|
||||
/* 40 bits : promoted to 64 bits
|
||||
*/
|
||||
struct int_char_combo_t {
|
||||
int int1;
|
||||
char ch1;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************
|
||||
* LOOP_COUNT :
|
||||
* A do nothing function. Used to provide a point at which calls can be made.
|
||||
*****************************************************************/
|
||||
void loop_count () {
|
||||
|
||||
int index;
|
||||
|
||||
for (index=0; index<4; index++);
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* INIT_BIT_FLAGS :
|
||||
* Initializes a bit_flags_t structure. Can call this function see
|
||||
* the call command behavior when integer arguments do not fit into
|
||||
* registers and must be placed on the stack.
|
||||
* OUT struct bit_flags_t *bit_flags -- structure to be filled
|
||||
* IN unsigned a -- 0 or 1
|
||||
* IN unsigned b -- 0 or 1
|
||||
* IN unsigned g -- 0 or 1
|
||||
* IN unsigned d -- 0 or 1
|
||||
* IN unsigned e -- 0 or 1
|
||||
* IN unsigned o -- 0 or 1
|
||||
*****************************************************************/
|
||||
void init_bit_flags (bit_flags,a,b,g,d,e,o)
|
||||
struct bit_flags_t *bit_flags;
|
||||
unsigned a;
|
||||
unsigned b;
|
||||
unsigned g;
|
||||
unsigned d;
|
||||
unsigned e;
|
||||
unsigned o;
|
||||
{
|
||||
|
||||
bit_flags->alpha = a;
|
||||
bit_flags->beta = b;
|
||||
bit_flags->gamma = g;
|
||||
bit_flags->delta = d;
|
||||
bit_flags->epsilon = e;
|
||||
bit_flags->omega = o;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* INIT_BIT_FLAGS_COMBO :
|
||||
* Initializes a bit_flags_combo_t structure. Can call this function
|
||||
* to see the call command behavior when integer and character arguments
|
||||
* do not fit into registers and must be placed on the stack.
|
||||
* OUT struct bit_flags_combo_t *bit_flags_combo -- structure to fill
|
||||
* IN unsigned a -- 0 or 1
|
||||
* IN unsigned b -- 0 or 1
|
||||
* IN char ch1
|
||||
* IN unsigned g -- 0 or 1
|
||||
* IN unsigned d -- 0 or 1
|
||||
* IN char ch2
|
||||
* IN unsigned e -- 0 or 1
|
||||
* IN unsigned o -- 0 or 1
|
||||
*****************************************************************/
|
||||
void init_bit_flags_combo (bit_flags_combo, a, b, ch1, g, d, ch2, e, o)
|
||||
struct bit_flags_combo_t *bit_flags_combo;
|
||||
unsigned a;
|
||||
unsigned b;
|
||||
char ch1;
|
||||
unsigned g;
|
||||
unsigned d;
|
||||
char ch2;
|
||||
unsigned e;
|
||||
unsigned o;
|
||||
{
|
||||
|
||||
bit_flags_combo->alpha = a;
|
||||
bit_flags_combo->beta = b;
|
||||
bit_flags_combo->ch1 = ch1;
|
||||
bit_flags_combo->gamma = g;
|
||||
bit_flags_combo->delta = d;
|
||||
bit_flags_combo->ch2 = ch2;
|
||||
bit_flags_combo->epsilon = e;
|
||||
bit_flags_combo->omega = o;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************
|
||||
* INIT_ONE_DOUBLE :
|
||||
* OUT struct one_double_t *one_double -- structure to fill
|
||||
* IN double init_val
|
||||
*****************************************************************/
|
||||
void init_one_double (one_double, init_val)
|
||||
struct one_double_t *one_double;
|
||||
double init_val;
|
||||
{
|
||||
|
||||
one_double->double1 = init_val;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* INIT_TWO_FLOATS :
|
||||
* OUT struct two_floats_t *two_floats -- structure to be filled
|
||||
* IN float init_val1
|
||||
* IN float init_val2
|
||||
*****************************************************************/
|
||||
void init_two_floats (two_floats, init_val1, init_val2)
|
||||
struct two_floats_t *two_floats;
|
||||
float init_val1;
|
||||
float init_val2;
|
||||
{
|
||||
|
||||
two_floats->float1 = init_val1;
|
||||
two_floats->float2 = init_val2;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* INIT_THREE_CHARS :
|
||||
* OUT struct three_char_t *three_char -- structure to be filled
|
||||
* IN char init_val1
|
||||
* IN char init_val2
|
||||
* IN char init_val3
|
||||
*****************************************************************/
|
||||
void init_three_chars ( three_char, init_val1, init_val2, init_val3)
|
||||
struct three_char_t *three_char;
|
||||
char init_val1;
|
||||
char init_val2;
|
||||
char init_val3;
|
||||
{
|
||||
|
||||
three_char->ch1 = init_val1;
|
||||
three_char->ch2 = init_val2;
|
||||
three_char->ch3 = init_val3;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* INIT_FIVE_CHARS :
|
||||
* OUT struct five_char_t *five_char -- structure to be filled
|
||||
* IN char init_val1
|
||||
* IN char init_val2
|
||||
* IN char init_val3
|
||||
* IN char init_val4
|
||||
* IN char init_val5
|
||||
*****************************************************************/
|
||||
void init_five_chars ( five_char, init_val1, init_val2, init_val3, init_val4, init_val5)
|
||||
struct five_char_t *five_char;
|
||||
char init_val1;
|
||||
char init_val2;
|
||||
char init_val3;
|
||||
char init_val4;
|
||||
char init_val5;
|
||||
{
|
||||
|
||||
five_char->ch1 = init_val1;
|
||||
five_char->ch2 = init_val2;
|
||||
five_char->ch3 = init_val3;
|
||||
five_char->ch4 = init_val4;
|
||||
five_char->ch5 = init_val5;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* INIT_INT_CHAR_COMBO :
|
||||
* OUT struct int_char_combo_t *combo -- structure to be filled
|
||||
* IN int init_val1
|
||||
* IN char init_val2
|
||||
*****************************************************************/
|
||||
void init_int_char_combo ( combo, init_val1, init_val2)
|
||||
struct int_char_combo_t *combo;
|
||||
int init_val1;
|
||||
char init_val2;
|
||||
{
|
||||
|
||||
combo->int1 = init_val1;
|
||||
combo->ch1 = init_val2;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* INIT_STRUCT_REP :
|
||||
* OUT struct small_rep_into_t *small_struct -- structure to be filled
|
||||
* IN int seed
|
||||
*****************************************************************/
|
||||
void init_struct_rep( small_struct, seed)
|
||||
struct small_rep_info_t *small_struct;
|
||||
int seed;
|
||||
|
||||
{
|
||||
|
||||
small_struct->value = 2 + (seed*2);
|
||||
small_struct->head = 0;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* PRINT_BIT_FLAGS :
|
||||
* IN struct bit_flags_t bit_flags
|
||||
****************************************************************/
|
||||
struct bit_flags_t print_bit_flags ( bit_flags)
|
||||
struct bit_flags_t bit_flags;
|
||||
{
|
||||
|
||||
if (bit_flags.alpha) printf("alpha\n");
|
||||
if (bit_flags.beta) printf("beta\n");
|
||||
if (bit_flags.gamma) printf("gamma\n");
|
||||
if (bit_flags.delta) printf("delta\n");
|
||||
if (bit_flags.epsilon) printf("epsilon\n");
|
||||
if (bit_flags.omega) printf("omega\n");
|
||||
return bit_flags;
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* PRINT_BIT_FLAGS_COMBO :
|
||||
* IN struct bit_flags_combo_t bit_flags_combo
|
||||
****************************************************************/
|
||||
struct bit_flags_combo_t print_bit_flags_combo ( bit_flags_combo )
|
||||
struct bit_flags_combo_t bit_flags_combo;
|
||||
{
|
||||
|
||||
if (bit_flags_combo.alpha) printf("alpha\n");
|
||||
if (bit_flags_combo.beta) printf("beta\n");
|
||||
if (bit_flags_combo.gamma) printf("gamma\n");
|
||||
if (bit_flags_combo.delta) printf("delta\n");
|
||||
if (bit_flags_combo.epsilon) printf("epsilon\n");
|
||||
if (bit_flags_combo.omega) printf("omega\n");
|
||||
printf("ch1: %c\tch2: %c\n", bit_flags_combo.ch1, bit_flags_combo.ch2);
|
||||
return bit_flags_combo;
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* PRINT_ONE_DOUBLE :
|
||||
* IN struct one_double_t one_double
|
||||
****************************************************************/
|
||||
struct one_double_t print_one_double ( one_double )
|
||||
struct one_double_t one_double;
|
||||
{
|
||||
|
||||
printf("Contents of one_double_t: \n\n");
|
||||
printf("%f\n", one_double.double1);
|
||||
return one_double;
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* PRINT_TWO_FLOATS :
|
||||
* IN struct two_floats_t two_floats
|
||||
****************************************************************/
|
||||
struct two_floats_t print_two_floats ( two_floats )
|
||||
struct two_floats_t two_floats;
|
||||
{
|
||||
|
||||
printf("Contents of two_floats_t: \n\n");
|
||||
printf("%f\t%f\n", two_floats.float1, two_floats.float2);
|
||||
return two_floats;
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* PRINT_THREE_CHARS :
|
||||
* IN struct three_char_t three_char
|
||||
****************************************************************/
|
||||
struct three_char_t print_three_chars ( three_char )
|
||||
struct three_char_t three_char;
|
||||
{
|
||||
|
||||
printf("Contents of three_char_t: \n\n");
|
||||
printf("%c\t%c\t%c\n", three_char.ch1, three_char.ch2, three_char.ch3);
|
||||
return three_char;
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* PRINT_FIVE_CHARS :
|
||||
* IN struct five_char_t five_char
|
||||
****************************************************************/
|
||||
struct five_char_t print_five_chars ( five_char )
|
||||
struct five_char_t five_char;
|
||||
{
|
||||
|
||||
printf("Contents of five_char_t: \n\n");
|
||||
printf("%c\t%c\t%c\t%c\t%c\n", five_char.ch1, five_char.ch2,
|
||||
five_char.ch3, five_char.ch4,
|
||||
five_char.ch5);
|
||||
return five_char;
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* PRINT_INT_CHAR_COMBO :
|
||||
* IN struct int_char_combo_t int_char_combo
|
||||
****************************************************************/
|
||||
struct int_char_combo_t print_int_char_combo ( int_char_combo )
|
||||
struct int_char_combo_t int_char_combo;
|
||||
{
|
||||
|
||||
printf("Contents of int_char_combo_t: \n\n");
|
||||
printf("%d\t%c\n", int_char_combo.int1, int_char_combo.ch1);
|
||||
return int_char_combo;
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* PRINT_STRUCT_REP :
|
||||
****************************************************************/
|
||||
struct small_rep_info_t print_struct_rep( struct1 )
|
||||
struct small_rep_info_t struct1;
|
||||
|
||||
{
|
||||
|
||||
printf("Contents of struct1: \n\n");
|
||||
printf("%10d%10d\n", struct1.value, struct1.head);
|
||||
struct1.value =+5;
|
||||
|
||||
return struct1;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
struct array_rep_info_t print_one_large_struct( linked_list1 )
|
||||
struct array_rep_info_t linked_list1;
|
||||
{
|
||||
|
||||
|
||||
printf("%10d%10d\n", linked_list1.values[0],
|
||||
linked_list1.next_index[0]);
|
||||
|
||||
return linked_list1;
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* INIT_ARRAY_REP :
|
||||
* IN struct array_rep_info_t *linked_list
|
||||
* IN int seed
|
||||
****************************************************************/
|
||||
void init_array_rep( linked_list, seed )
|
||||
struct array_rep_info_t *linked_list;
|
||||
int seed;
|
||||
|
||||
{
|
||||
|
||||
int index;
|
||||
|
||||
for (index = 0; index < 10; index++) {
|
||||
|
||||
linked_list->values[index] = (2*index) + (seed*2);
|
||||
linked_list->next_index[index] = index + 1;
|
||||
}
|
||||
linked_list->head = 0;
|
||||
}
|
||||
|
||||
|
||||
int main () {
|
||||
|
||||
/* variables for large structure testing
|
||||
*/
|
||||
int number = 10;
|
||||
struct array_rep_info_t *list1;
|
||||
|
||||
/* variables for testing a small structures and a very long argument list
|
||||
*/
|
||||
struct small_rep_info_t *struct1;
|
||||
struct bit_flags_t *flags;
|
||||
struct bit_flags_combo_t *flags_combo;
|
||||
struct three_char_t *three_char;
|
||||
struct five_char_t *five_char;
|
||||
struct int_char_combo_t *int_char_combo;
|
||||
struct one_double_t *d1;
|
||||
struct two_floats_t *f3;
|
||||
|
||||
|
||||
/* Allocate space for large structures
|
||||
*/
|
||||
list1 = (struct array_rep_info_t *)malloc(sizeof(struct array_rep_info_t));
|
||||
|
||||
/* Initialize large structures
|
||||
*/
|
||||
init_array_rep(list1, 2);
|
||||
|
||||
/* Print large structures
|
||||
*/
|
||||
print_one_large_struct(*list1);
|
||||
|
||||
/* Allocate space for small structures
|
||||
*/
|
||||
struct1 = (struct small_rep_info_t *)malloc(sizeof(struct small_rep_info_t));
|
||||
flags = (struct bit_flags_t *)malloc(sizeof(struct bit_flags_t));
|
||||
flags_combo = (struct bit_flags_combo_t *)malloc(sizeof(struct bit_flags_combo_t));
|
||||
three_char = (struct three_char_t *)malloc(sizeof(struct three_char_t));
|
||||
five_char = (struct five_char_t *)malloc(sizeof(struct five_char_t));
|
||||
int_char_combo = (struct int_char_combo_t *)malloc(sizeof(struct int_char_combo_t));
|
||||
|
||||
d1 = (struct one_double_t *)malloc(sizeof(struct one_double_t));
|
||||
f3 = (struct two_floats_t *)malloc(sizeof(struct two_floats_t));
|
||||
|
||||
/* Initialize small structures
|
||||
*/
|
||||
init_one_double ( d1, 1.11111);
|
||||
init_two_floats ( f3, -2.345, 1.0);
|
||||
init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1,
|
||||
(unsigned)0, (unsigned)1, (unsigned)0 );
|
||||
init_bit_flags_combo(flags_combo, (unsigned)1, (unsigned)0, 'y',
|
||||
(unsigned)1, (unsigned)0, 'n',
|
||||
(unsigned)1, (unsigned)0 );
|
||||
init_three_chars(three_char, 'x', 'y', 'z');
|
||||
init_five_chars(five_char, 'h', 'e', 'l', 'l', 'o');
|
||||
init_int_char_combo(int_char_combo, 13, '!');
|
||||
init_struct_rep(struct1, 10);
|
||||
|
||||
|
||||
/* Print small structures
|
||||
*/
|
||||
print_one_double(*d1);
|
||||
print_two_floats(*f3);
|
||||
print_bit_flags(*flags);
|
||||
print_bit_flags_combo(*flags_combo);
|
||||
print_three_chars(*three_char);
|
||||
print_five_chars(*five_char);
|
||||
print_int_char_combo(*int_char_combo);
|
||||
print_struct_rep(*struct1);
|
||||
|
||||
loop_count();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
230
gdb/testsuite/gdb.base/call-rt-st.exp
Normal file
230
gdb/testsuite/gdb.base/call-rt-st.exp
Normal file
@@ -0,0 +1,230 @@
|
||||
# Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# This file was written by Elena Zannoni (ezannoni@cygnus.com)
|
||||
|
||||
# this file tests command line calls with functions returning structures
|
||||
# corresponding source file: call_return_struct.c
|
||||
|
||||
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile "call-rt-st"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Create and source the file that provides information about the compiler
|
||||
# used to compile the test case.
|
||||
|
||||
if [get_compiler_info ${binfile}] {
|
||||
return -1;
|
||||
}
|
||||
|
||||
# The a29k can't call functions, so don't even bother with this test.
|
||||
if [target_info exists gdb,cannot_call_functions] {
|
||||
setup_xfail "*-*-*" 2416
|
||||
fail "This target can not call functions"
|
||||
continue
|
||||
}
|
||||
|
||||
# Set the current language to C. This counts as a test. If it
|
||||
# fails, then we skip the other tests.
|
||||
|
||||
proc set_lang_c {} {
|
||||
global gdb_prompt
|
||||
|
||||
send_gdb "set language c\n"
|
||||
gdb_expect {
|
||||
-re ".*$gdb_prompt $" {}
|
||||
timeout { fail "set language c (timeout)" ; return 0; }
|
||||
}
|
||||
|
||||
send_gdb "show language\n"
|
||||
gdb_expect {
|
||||
-re ".* source language is \"c\".*$gdb_prompt $" {
|
||||
pass "set language to \"c\""
|
||||
return 1
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "setting language to \"c\""
|
||||
return 0
|
||||
}
|
||||
timeout {
|
||||
fail "can't show language (timeout)"
|
||||
return 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
source ${binfile}.ci
|
||||
|
||||
|
||||
# Start with a fresh gdb.
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
send_gdb "set print sevenbit-strings\n" ; gdb_expect -re "$gdb_prompt $"
|
||||
send_gdb "set print address off\n" ; gdb_expect -re "$gdb_prompt $"
|
||||
send_gdb "set width 0\n" ; gdb_expect -re "$gdb_prompt $"
|
||||
|
||||
|
||||
if ![runto_main] then {
|
||||
perror "couldn't run to breakpoint"
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
gdb_test "break loop_count" \
|
||||
"Breakpoint.* file .*call-rt-st.c, line 106\\." \
|
||||
"breakpoint loop_count"
|
||||
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re "Continuing\\..*Breakpoint.*loop_count \\(\\) at.*call-rt-st.c:106\[ \t\r\n\]+106\[\t \]+for \\(index=0; index.4; index..\\);\[\r\n \]+$gdb_prompt $" {
|
||||
pass "continue to loop_count"}
|
||||
-re ".*$gdb_prompt $" { fail "continue to loop_count"}
|
||||
timeout { fail "(timeout) continue to loop_count"}
|
||||
}
|
||||
|
||||
send_gdb "finish\n"
|
||||
gdb_expect {
|
||||
-re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:106\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:514\[ \t\r\n\]+514\[\t \]+return 0;.*$gdb_prompt $" {
|
||||
pass "finish out from loop_count"}
|
||||
-re ".*$gdb_prompt $" { fail "finish out from loop_count"}
|
||||
timeout { fail "(timeout)finish out from loop_count"}
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print print_struct_rep(*struct1)\n"
|
||||
gdb_expect {
|
||||
-re ".*Contents of struct1:\[ \t\n\r\]+22\[ \t\]+0\[ \t\n\r\]+.\[0-9\]+ = \{value = 5, head = 0\}.*$gdb_prompt $" {
|
||||
pass "print print_struct_rep(*struct1, *struct2, *struct3)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_struct_rep(*struct1, *struct2, *struct3)" }
|
||||
timeout { fail "(timeout) print_struct_rep(*struct1, *struct2, *struct3)" }
|
||||
}
|
||||
|
||||
send_gdb "print print_one_large_struct(*list1)\n"
|
||||
gdb_expect {
|
||||
-re ".*\[ \t\]+4\[ \t\]+1\[ \r\n\]+.\[0-9\]+ = \{next_index = \{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}, values = \{4, 6, 8, 10, 12, 14, 16, 18, 20, 22\}, head = 0\}.*$gdb_prompt $" {
|
||||
pass "print print_one_large_struct(*list1)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_one_large_struct(*list1)" }
|
||||
timeout { fail "(timeout) print_one_large_struct(*list1)" }
|
||||
}
|
||||
|
||||
send_gdb "print print_one_double(*d1)\n"
|
||||
gdb_expect {
|
||||
-re ".*Contents of one_double_t:\[ \r\n\]+1\\.111110\[ \r\n\]+.\[0-9\]+ = \{double1 = 1\\.11111\}.*$gdb_prompt $" {
|
||||
pass "print print_one_double(*d1)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_one_double(*d1)" }
|
||||
timeout { fail "(timeout) print_one_double(*d1)" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
send_gdb "print print_two_floats(*f3)\n"
|
||||
gdb_expect {
|
||||
-re ".*Contents of two_floats_t:\[ \r\n\]+-2\\.345000\[ \t]+1\\.000000\[ \r\n\]+.\[0-9\]+ = \{float1 = -2\\.34500003, float2 = 1\}.*$gdb_prompt $" {
|
||||
pass "print print_two_floats(*f3)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_two_floats(*f3)" }
|
||||
timeout { fail "(timeout) print_two_floats(*f3)" }
|
||||
}
|
||||
|
||||
send_gdb "print print_bit_flags(*flags)\n"
|
||||
gdb_expect {
|
||||
-re ".*alpha\[ \r\n\]+gamma\[ \r\n\]+epsilon\[ \r\n\]+.\[0-9\]+ = \{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}\[ \r\n\]+$gdb_prompt $" {
|
||||
pass "print print_bit_flags(*flags)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_bit_flags(*flags)" }
|
||||
timeout { fail "(timeout) print_bit_flags(*flags)" }
|
||||
}
|
||||
|
||||
send_gdb "print print_bit_flags_combo(*flags_combo)\n"
|
||||
gdb_expect {
|
||||
-re ".*alpha\[ \r\n\]+gamma\[ \r\n\]+epsilon\[ \r\n\]+ch1: y\[ \t\]+ch2: n\[ \r\n\]+.\[0-9\]+ = \{alpha = 1, beta = 0, ch1 = 121 'y', gamma = 1, delta = 0, ch2 = 110 'n', epsilon = 1, omega = 0\}\[ \r\n\]+$gdb_prompt $" {
|
||||
pass "print print_bit_flags_combo(*flags_combo)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_bit_flags_combo(*flags_combo)" }
|
||||
timeout { fail "(timeout) print_bit_flags_combo(*flags_combo)" }
|
||||
}
|
||||
|
||||
send_gdb "print print_three_chars(*three_char)\n"
|
||||
gdb_expect {
|
||||
-re ".*Contents of three_char_t:\[ \r\n\]+x\[ \t\]+y\[ \t\]+z\[ \r\n\]+.\[0-9\]+ = \{ch1 = 120 'x', ch2 = 121 'y', ch3 = 122 'z'\}\[ \r\n\]+$gdb_prompt $" {
|
||||
pass "print print_three_chars(*three_char)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_three_chars(*three_char)" }
|
||||
timeout { fail "(timeout) print_three_chars(*three_char)" }
|
||||
}
|
||||
|
||||
send_gdb "print print_five_chars(*five_char)\n"
|
||||
gdb_expect {
|
||||
-re ".*Contents of five_char_t:\[ \r\n\]+h\[ \t\]+e\[ \t\]+l\[ \t\]+l\[ \t\]+o\[ \r\n\]+.\[0-9\]+ = \{ch1 = 104 'h', ch2 = 101 'e', ch3 = 108 'l', ch4 = 108 'l', ch5 = 111 'o'\}\[ \r\n\]+$gdb_prompt $" {
|
||||
pass "print print_five_chars(*five_char)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_five_chars(*five_char)" }
|
||||
timeout { fail "(timeout) print_five_chars(*five_char)" }
|
||||
}
|
||||
|
||||
send_gdb "print print_int_char_combo(*int_char_combo)\n"
|
||||
gdb_expect {
|
||||
-re ".*Contents of int_char_combo_t:\[ \r\n\]+13\[ \t\]+!\[ \r\n\]+.\[0-9\]+ = \{int1 = 13, ch1 = 33 '!'\}\[ \r\n\]+$gdb_prompt $" {
|
||||
pass "print print_int_char_combo(*int_char_combo)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print print_int_char_combo(*int_char_combo)" }
|
||||
timeout { fail "(timeout) print_int_char_combo(*int_char_combo)" }
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
54
gdb/testsuite/gdb.base/call-strs.c
Normal file
54
gdb/testsuite/gdb.base/call-strs.c
Normal file
@@ -0,0 +1,54 @@
|
||||
#include <stdio.h>
|
||||
char buf[100];
|
||||
char bigbuf[1000];
|
||||
char * s;
|
||||
|
||||
char * str_func1(s1)
|
||||
char *s1;
|
||||
{
|
||||
printf("first string arg is: %s\n", s1);
|
||||
strcpy(bigbuf, s1);
|
||||
return bigbuf;
|
||||
}
|
||||
|
||||
char * str_func(s1,
|
||||
s2,
|
||||
s3,
|
||||
s4,
|
||||
s5,
|
||||
s6,
|
||||
s7)
|
||||
char * s1;
|
||||
char * s2;
|
||||
char * s3;
|
||||
char * s4;
|
||||
char * s5;
|
||||
char * s6;
|
||||
char * s7;
|
||||
{
|
||||
printf("first string arg is: %s\n", s1);
|
||||
printf("second string arg is: %s\n", s2);
|
||||
printf("third string arg is: %s\n", s3);
|
||||
printf("fourth string arg is: %s\n", s4);
|
||||
printf("fifth string arg is: %s\n", s5);
|
||||
printf("sixth string arg is: %s\n", s6);
|
||||
printf("seventh string arg is: %s\n", s7);
|
||||
strcpy(bigbuf, s1);
|
||||
strcat(bigbuf, s2);
|
||||
strcat(bigbuf, s3);
|
||||
strcat(bigbuf, s4);
|
||||
strcat(bigbuf, s5);
|
||||
strcat(bigbuf, s6);
|
||||
strcat(bigbuf, s7);
|
||||
return bigbuf;
|
||||
}
|
||||
|
||||
|
||||
main()
|
||||
{
|
||||
s = &buf[0];
|
||||
strcpy(buf, "test string");
|
||||
str_func("abcd", "efgh", "ijkl", "mnop", "qrst", "uvwx", "yz12");
|
||||
str_func1("abcd");
|
||||
}
|
||||
|
||||
242
gdb/testsuite/gdb.base/call-strs.exp
Normal file
242
gdb/testsuite/gdb.base/call-strs.exp
Normal file
@@ -0,0 +1,242 @@
|
||||
# Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# This file was written by Elena Zannoni (ezannoni@cygnus.com)
|
||||
|
||||
# This test deals with calling functions which have strings as parameters.
|
||||
# it plays around with constant strings.
|
||||
# the corresponding source file is call-strs.c
|
||||
#
|
||||
|
||||
#debug strarg
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile "call-strs"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
|
||||
|
||||
# The a29k can't call functions, so don't even bother with this test.
|
||||
if [target_info exists gdb,cannot_call_functions] {
|
||||
setup_xfail "*-*-*" 2416
|
||||
fail "This target can not call functions"
|
||||
continue
|
||||
}
|
||||
|
||||
# Set the current language to C. This counts as a test. If it
|
||||
# fails, then we skip the other tests.
|
||||
|
||||
proc set_lang_c {} {
|
||||
global gdb_prompt
|
||||
|
||||
send_gdb "set language c\n"
|
||||
gdb_expect {
|
||||
-re ".*$gdb_prompt $" {}
|
||||
timeout { fail "set language c (timeout)" ; return 0; }
|
||||
}
|
||||
|
||||
send_gdb "show language\n"
|
||||
gdb_expect {
|
||||
-re ".* source language is \"c\".*$gdb_prompt $" {
|
||||
pass "set language to \"c\""
|
||||
return 1
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "setting language to \"c\""
|
||||
return 0
|
||||
}
|
||||
timeout {
|
||||
fail "can't show language (timeout)"
|
||||
return 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Start with a fresh gdb.
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
send_gdb "set print sevenbit-strings\n" ; gdb_expect -re "$gdb_prompt $"
|
||||
send_gdb "set print address off\n" ; gdb_expect -re "$gdb_prompt $"
|
||||
send_gdb "set width 0\n" ; gdb_expect -re "$gdb_prompt $"
|
||||
|
||||
|
||||
if ![runto_main] then {
|
||||
perror "couldn't run to breakpoint"
|
||||
continue
|
||||
}
|
||||
|
||||
#step
|
||||
send_gdb "step\n"
|
||||
gdb_expect {
|
||||
-re ".*strcpy\\(buf, \"test string\"\\);.*$gdb_prompt $" {pass "step after assignment to s"}
|
||||
-re ".*$gdb_prompt $" { fail "step after assignment to s" }
|
||||
timeout { fail "step after assignment to s (timeout)" }
|
||||
}
|
||||
|
||||
|
||||
#step
|
||||
send_gdb "step\n"
|
||||
gdb_expect {
|
||||
-re ".*str_func\\(\"abcd\", \"efgh\", \"ijkl\", \"mnop\", \"qrst\", \"uvwx\", \"yz12\"\\);.*$gdb_prompt $" {pass "step after strcpy"}
|
||||
-re ".*$gdb_prompt $" { fail "step after strcpy" }
|
||||
timeout { fail "step after strcpy (timeout)" }
|
||||
}
|
||||
|
||||
#print buf
|
||||
send_gdb "print buf\n"
|
||||
gdb_expect {
|
||||
-re ".*\"test string\",.*repeats 88 times.*$gdb_prompt $" {
|
||||
pass "print buf"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print buf" }
|
||||
timeout { fail "(timeout) print buf" }
|
||||
}
|
||||
|
||||
|
||||
#print s
|
||||
send_gdb "print s\n"
|
||||
gdb_expect {
|
||||
-re ".*= \"test string\".*$gdb_prompt $" {
|
||||
pass "print s"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print s" }
|
||||
timeout { fail "(timeout) print sum_array_print(10, *list1, *list2, *list3, *list4)" }
|
||||
}
|
||||
|
||||
|
||||
#print str_func1(s)
|
||||
send_gdb "print str_func1(s)\n"
|
||||
gdb_expect {
|
||||
-re "first string arg is: test string.*\"test string\".*$gdb_prompt $" {
|
||||
pass "print str_func1(s)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print str_func1(s)" }
|
||||
timeout { fail "(timeout) print str_func1(s)" }
|
||||
}
|
||||
|
||||
|
||||
#print str_func1("test string")
|
||||
send_gdb "print str_func1(\"test string\")\n"
|
||||
gdb_expect {
|
||||
-re "first string arg is: test string.*\"test string\".*$gdb_prompt $" {
|
||||
pass "print str_func1(\"test string\")"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print str_func1(\"test string\")" }
|
||||
timeout { fail "(timeout) print str_func1(\"test string\")" }
|
||||
}
|
||||
|
||||
#call str_func1(s)
|
||||
send_gdb "call str_func1(s)\n"
|
||||
gdb_expect {
|
||||
-re "first string arg is: test string.*\"test string\".*$gdb_prompt $" {
|
||||
pass "call str_func1(s)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "call str_func1(s)" }
|
||||
timeout { fail "(timeout) call str_func1(s)" }
|
||||
}
|
||||
|
||||
#call str_func1("test string")
|
||||
send_gdb "call str_func1(\"test string\")\n"
|
||||
gdb_expect {
|
||||
-re "first string arg is: test string.*\"test string\".*$gdb_prompt $" {
|
||||
pass "call str_func1(\"test string\")"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "call str_func1(\"test string\")" }
|
||||
timeout { fail "(timeout) call str_func1(\"test string\")" }
|
||||
}
|
||||
|
||||
#print str_func1(buf)
|
||||
send_gdb "print str_func1(buf)\n"
|
||||
gdb_expect {
|
||||
-re "first string arg is: test string.*\"test string\".*$gdb_prompt $" {
|
||||
pass "print str_func1(buf)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print str_func1(buf)" }
|
||||
timeout { fail "(timeout) print str_func1(buf)" }
|
||||
}
|
||||
|
||||
#call str_func1(buf)
|
||||
send_gdb "call str_func1(buf)\n"
|
||||
gdb_expect {
|
||||
-re "first string arg is: test string.*\"test string\".*$gdb_prompt $" {
|
||||
pass "call str_func1(buf)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "call str_func1(buf)" }
|
||||
timeout { fail "(timeout) call str_func1(buf)" }
|
||||
}
|
||||
|
||||
#print str_func("a","b","c","d","e","f","g")
|
||||
send_gdb "print str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")\n"
|
||||
gdb_expect {
|
||||
-re "first string arg is: a\[ \t\r\n\]+second string arg is: b\[ \t\r\n\]+third string arg is: c\[ \t\r\n\]+fourth string arg is: d\[ \t\r\n\]+fifth string arg is: e\[ \t\r\n\]+sixth string arg is: f\[ \t\r\n\]+seventh string arg is: g\[ \t\r\n\]+.*= \"abcdefg\".*$gdb_prompt $" {
|
||||
pass "print str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")" }
|
||||
timeout { fail "(timeout) print str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")" }
|
||||
}
|
||||
|
||||
#call str_func("a","b","c","d","e","f","g")
|
||||
send_gdb "call str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")\n"
|
||||
gdb_expect {
|
||||
-re "first string arg is: a\[ \t\r\n\]+second string arg is: b\[ \t\r\n\]+third string arg is: c\[ \t\r\n\]+fourth string arg is: d\[ \t\r\n\]+fifth string arg is: e\[ \t\r\n\]+sixth string arg is: f\[ \t\r\n\]+seventh string arg is: g\[ \t\r\n\]+.*= \"abcdefg\".*$gdb_prompt $" {
|
||||
pass "call str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "call str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")" }
|
||||
timeout { fail "(timeout) call str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")" }
|
||||
}
|
||||
|
||||
#print str_func(s,s,s,s,s,s,s,s)
|
||||
send_gdb "print str_func(s,s,s,s,s,s,s,s)\n"
|
||||
gdb_expect {
|
||||
-re "first string arg is: test string\[ \t\r\n\]+second string arg is: test string\[ \t\r\n\]+third string arg is: test string\[ \t\r\n\]+fourth string arg is: test string\[ \t\r\n\]+fifth string arg is: test string\[ \t\r\n\]+sixth string arg is: test string\[ \t\r\n\]+seventh string arg is: test string\[ \t\r\n\]+.*\"test stringtest stringtest stringtest stringtest stringtest stringtest string\".*$gdb_prompt $" {
|
||||
pass "print str_func(s,s,s,s,s,s,s,s)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print str_func(s,s,s,s,s,s,s,s)" }
|
||||
timeout { fail "(timeout) print str_func(s,s,s,s,s,s,s,s)" }
|
||||
}
|
||||
|
||||
#call str_func(s,s,s,s,s,s,s,s)
|
||||
send_gdb "call str_func(s,s,s,s,s,s,s,s)\n"
|
||||
gdb_expect {
|
||||
-re "first string arg is: test string\[ \t\r\n\]+second string arg is: test string\[ \t\r\n\]+third string arg is: test string\[ \t\r\n\]+fourth string arg is: test string\[ \t\r\n\]+fifth string arg is: test string\[ \t\r\n\]+sixth string arg is: test string\[ \t\r\n\]+seventh string arg is: test string\[ \t\r\n\]+.*\"test stringtest stringtest stringtest stringtest stringtest stringtest string\".*$gdb_prompt $" {
|
||||
pass "call str_func(s,s,s,s,s,s,s,s)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "call str_func(s,s,s,s,s,s,s,s)" }
|
||||
timeout { fail "(timeout) call str_func(s,s,s,s,s,s,s,s)" }
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
return 0
|
||||
~
|
||||
280
gdb/testsuite/gdb.base/callfuncs.c
Normal file
280
gdb/testsuite/gdb.base/callfuncs.c
Normal file
@@ -0,0 +1,280 @@
|
||||
/* Support program for testing gdb's ability to call functions
|
||||
in the inferior, pass appropriate arguments to those functions,
|
||||
and get the returned result. */
|
||||
|
||||
#ifdef NO_PROTOTYPES
|
||||
#define PARAMS(paramlist) ()
|
||||
#else
|
||||
#define PARAMS(paramlist) paramlist
|
||||
#endif
|
||||
|
||||
char char_val1 = 'a';
|
||||
char char_val2 = 'b';
|
||||
|
||||
short short_val1 = 10;
|
||||
short short_val2 = -23;
|
||||
|
||||
int int_val1 = 87;
|
||||
int int_val2 = -26;
|
||||
|
||||
long long_val1 = 789;
|
||||
long long_val2 = -321;
|
||||
|
||||
float float_val1 = 3.14159;
|
||||
float float_val2 = -2.3765;
|
||||
|
||||
double double_val1 = 45.654;
|
||||
double double_val2 = -67.66;
|
||||
|
||||
#define DELTA (0.001)
|
||||
|
||||
char *string_val1 = "string 1";
|
||||
char *string_val2 = "string 2";
|
||||
|
||||
char char_array_val1[] = "carray 1";
|
||||
char char_array_val2[] = "carray 2";
|
||||
|
||||
struct struct1 {
|
||||
char c;
|
||||
short s;
|
||||
int i;
|
||||
long l;
|
||||
float f;
|
||||
double d;
|
||||
char a[4];
|
||||
} struct_val1 = { 'x', 87, 76, 51, 2.1234, 9.876, "foo" };
|
||||
|
||||
/* Some functions that can be passed as arguments to other test
|
||||
functions, or called directly. */
|
||||
|
||||
int add (a, b)
|
||||
int a, b;
|
||||
{
|
||||
return (a + b);
|
||||
}
|
||||
|
||||
int doubleit (a)
|
||||
int a;
|
||||
{
|
||||
return (a + a);
|
||||
}
|
||||
|
||||
int (*func_val1) PARAMS((int,int)) = add;
|
||||
int (*func_val2) PARAMS((int)) = doubleit;
|
||||
|
||||
/* An enumeration and functions that test for specific values. */
|
||||
|
||||
enum enumtype { enumval1, enumval2, enumval3 };
|
||||
enum enumtype enum_val1 = enumval1;
|
||||
enum enumtype enum_val2 = enumval2;
|
||||
enum enumtype enum_val3 = enumval3;
|
||||
|
||||
int t_enum_value1 (enum_arg)
|
||||
enum enumtype enum_arg;
|
||||
{
|
||||
return (enum_arg == enum_val1);
|
||||
}
|
||||
|
||||
int t_enum_value2 (enum_arg)
|
||||
enum enumtype enum_arg;
|
||||
{
|
||||
return (enum_arg == enum_val2);
|
||||
}
|
||||
|
||||
int t_enum_value3 (enum_arg)
|
||||
enum enumtype enum_arg;
|
||||
{
|
||||
return (enum_arg == enum_val3);
|
||||
}
|
||||
|
||||
/* A function that takes a vector of integers (along with an explicit
|
||||
count) and returns their sum. */
|
||||
|
||||
int sum_args (argc, argv)
|
||||
int argc;
|
||||
int argv[];
|
||||
{
|
||||
int sumval = 0;
|
||||
int idx;
|
||||
|
||||
for (idx = 0; idx < argc; idx++)
|
||||
{
|
||||
sumval += argv[idx];
|
||||
}
|
||||
return (sumval);
|
||||
}
|
||||
|
||||
/* Test that we can call functions that take structs and return
|
||||
members from that struct */
|
||||
|
||||
char t_structs_c (tstruct) struct struct1 tstruct; { return (tstruct.c); }
|
||||
short t_structs_s (tstruct) struct struct1 tstruct; { return (tstruct.s); }
|
||||
int t_structs_i (tstruct) struct struct1 tstruct; { return (tstruct.i); }
|
||||
long t_structs_l (tstruct) struct struct1 tstruct; { return (tstruct.l); }
|
||||
float t_structs_f (tstruct) struct struct1 tstruct; { return (tstruct.f); }
|
||||
double t_structs_d (tstruct) struct struct1 tstruct; { return (tstruct.d); }
|
||||
char *t_structs_a (tstruct) struct struct1 tstruct; { return (tstruct.a); }
|
||||
|
||||
/* Test that calling functions works if there are a lot of arguments. */
|
||||
int
|
||||
sum10 (i0, i1, i2, i3, i4, i5, i6, i7, i8, i9)
|
||||
int i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
|
||||
{
|
||||
return i0 + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9;
|
||||
}
|
||||
|
||||
/* Test that args are passed in the right order. */
|
||||
int
|
||||
cmp10 (i0, i1, i2, i3, i4, i5, i6, i7, i8, i9)
|
||||
int i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
|
||||
{
|
||||
return
|
||||
(i0 == 0) && (i1 == 1) && (i2 == 2) && (i3 == 3) && (i4 == 4) &&
|
||||
(i5 == 5) && (i6 == 6) && (i7 == 7) && (i8 == 8) && (i9 == 9);
|
||||
}
|
||||
|
||||
|
||||
/* Gotta have a main to be able to generate a linked, runnable
|
||||
executable, and also provide a useful place to set a breakpoint. */
|
||||
extern void * malloc() ;
|
||||
int main ()
|
||||
{
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
breakpoint();
|
||||
#endif
|
||||
malloc(1);
|
||||
t_structs_c(struct_val1);
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
/* Functions that expect specific values to be passed and return
|
||||
either 0 or 1, depending upon whether the values were
|
||||
passed incorrectly or correctly, respectively. */
|
||||
|
||||
int t_char_values (char_arg1, char_arg2)
|
||||
char char_arg1, char_arg2;
|
||||
{
|
||||
return ((char_arg1 == char_val1) && (char_arg2 == char_val2));
|
||||
}
|
||||
|
||||
int
|
||||
#ifdef NO_PROTOTYPES
|
||||
t_small_values (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)
|
||||
char arg1;
|
||||
short arg2;
|
||||
int arg3;
|
||||
char arg4;
|
||||
short arg5;
|
||||
char arg6;
|
||||
short arg7;
|
||||
int arg8;
|
||||
short arg9;
|
||||
short arg10;
|
||||
#else
|
||||
t_small_values (char arg1, short arg2, int arg3, char arg4, short arg5,
|
||||
char arg6, short arg7, int arg8, short arg9, short arg10)
|
||||
#endif
|
||||
{
|
||||
return arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10;
|
||||
}
|
||||
|
||||
int t_short_values (short_arg1, short_arg2)
|
||||
short short_arg1, short_arg2;
|
||||
{
|
||||
return ((short_arg1 == short_val1) && (short_arg2 == short_val2));
|
||||
}
|
||||
|
||||
int t_int_values (int_arg1, int_arg2)
|
||||
int int_arg1, int_arg2;
|
||||
{
|
||||
return ((int_arg1 == int_val1) && (int_arg2 == int_val2));
|
||||
}
|
||||
|
||||
int t_long_values (long_arg1, long_arg2)
|
||||
long long_arg1, long_arg2;
|
||||
{
|
||||
return ((long_arg1 == long_val1) && (long_arg2 == long_val2));
|
||||
}
|
||||
|
||||
int t_float_values (float_arg1, float_arg2)
|
||||
float float_arg1, float_arg2;
|
||||
{
|
||||
return ((float_arg1 - float_val1) < DELTA
|
||||
&& (float_arg1 - float_val1) > -DELTA
|
||||
&& (float_arg2 - float_val2) < DELTA
|
||||
&& (float_arg2 - float_val2) > -DELTA);
|
||||
}
|
||||
|
||||
int
|
||||
#ifdef NO_PROTOTYPES
|
||||
/* In this case we are just duplicating t_float_values, but that is the
|
||||
easiest way to deal with either ANSI or non-ANSI. */
|
||||
t_float_values2 (float_arg1, float_arg2)
|
||||
float float_arg1, float_arg2;
|
||||
#else
|
||||
t_float_values2 (float float_arg1, float float_arg2)
|
||||
#endif
|
||||
{
|
||||
return ((float_arg1 - float_val1) < DELTA
|
||||
&& (float_arg1 - float_val1) > -DELTA
|
||||
&& (float_arg2 - float_val2) < DELTA
|
||||
&& (float_arg2 - float_val2) > -DELTA);
|
||||
}
|
||||
|
||||
int t_double_values (double_arg1, double_arg2)
|
||||
double double_arg1, double_arg2;
|
||||
{
|
||||
return ((double_arg1 - double_val1) < DELTA
|
||||
&& (double_arg1 - double_val1) > -DELTA
|
||||
&& (double_arg2 - double_val2) < DELTA
|
||||
&& (double_arg2 - double_val2) > -DELTA);
|
||||
}
|
||||
|
||||
int t_string_values (string_arg1, string_arg2)
|
||||
char *string_arg1, *string_arg2;
|
||||
{
|
||||
return (!strcmp (string_arg1, string_val1) &&
|
||||
!strcmp (string_arg2, string_val2));
|
||||
}
|
||||
|
||||
int t_char_array_values (char_array_arg1, char_array_arg2)
|
||||
char char_array_arg1[], char_array_arg2[];
|
||||
{
|
||||
return (!strcmp (char_array_arg1, char_array_val1) &&
|
||||
!strcmp (char_array_arg2, char_array_val2));
|
||||
}
|
||||
|
||||
|
||||
/* This used to simply compare the function pointer arguments with
|
||||
known values for func_val1 and func_val2. Doing so is valid ANSI
|
||||
code, but on some machines (RS6000, HPPA, others?) it may fail when
|
||||
called directly by GDB.
|
||||
|
||||
In a nutshell, it's not possible for GDB to determine when the address
|
||||
of a function or the address of the function's stub/trampoline should
|
||||
be passed.
|
||||
|
||||
So, to avoid GDB lossage in the common case, we perform calls through the
|
||||
various function pointers and compare the return values. For the HPPA
|
||||
at least, this allows the common case to work.
|
||||
|
||||
If one wants to try something more complicated, pass the address of
|
||||
a function accepting a "double" as one of its first 4 arguments. Call
|
||||
that function indirectly through the function pointer. This would fail
|
||||
on the HPPA. */
|
||||
|
||||
int t_func_values (func_arg1, func_arg2)
|
||||
int (*func_arg1) PARAMS ((int, int));
|
||||
int (*func_arg2) PARAMS ((int));
|
||||
{
|
||||
return ((*func_arg1) (5,5) == (*func_val1) (5,5)
|
||||
&& (*func_arg2) (6) == (*func_val2) (6));
|
||||
}
|
||||
|
||||
int t_call_add (func_arg1, a, b)
|
||||
int (*func_arg1) PARAMS ((int, int));
|
||||
int a, b;
|
||||
{
|
||||
return ((*func_arg1)(a, b));
|
||||
}
|
||||
269
gdb/testsuite/gdb.base/callfuncs.exp
Normal file
269
gdb/testsuite/gdb.base/callfuncs.exp
Normal file
@@ -0,0 +1,269 @@
|
||||
# Copyright (C) 92, 96, 1997 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# 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)
|
||||
# and modified by Bob Manson. (manson@cygnus.com)
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile "callfuncs"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
set prototypes 1
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
set prototypes 0;
|
||||
# built the second test case since we can't use prototypes
|
||||
warning "Prototypes not supported, rebuilding with -DNO_PROTOTYPES"
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DNO_PROTOTYPES}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
}
|
||||
|
||||
# Create and source the file that provides information about the compiler
|
||||
# used to compile the test case.
|
||||
|
||||
if [get_compiler_info ${binfile}] {
|
||||
return -1;
|
||||
}
|
||||
|
||||
# The a29k can't call functions, so don't even bother with this test.
|
||||
if [target_info exists gdb,cannot_call_functions] {
|
||||
setup_xfail "*-*-*" 2416
|
||||
fail "This target can not call functions"
|
||||
continue
|
||||
}
|
||||
|
||||
# Set the current language to C. This counts as a test. If it
|
||||
# fails, then we skip the other tests.
|
||||
|
||||
proc set_lang_c {} {
|
||||
global gdb_prompt
|
||||
|
||||
send_gdb "set language c\n"
|
||||
gdb_expect {
|
||||
-re ".*$gdb_prompt $" {}
|
||||
timeout { fail "set language c (timeout)" ; return 0; }
|
||||
}
|
||||
|
||||
send_gdb "show language\n"
|
||||
gdb_expect {
|
||||
-re ".* source language is \"c\".*$gdb_prompt $" {
|
||||
pass "set language to \"c\""
|
||||
return 1
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "setting language to \"c\""
|
||||
return 0
|
||||
}
|
||||
timeout {
|
||||
fail "can't show language (timeout)"
|
||||
return 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# FIXME: Before calling this proc, we should probably verify that
|
||||
# we can call inferior functions and get a valid integral value
|
||||
# returned.
|
||||
# Note that it is OK to check for 0 or 1 as the returned values, because C
|
||||
# specifies that the numeric value of a relational or logical expression
|
||||
# (computed in the inferior) is 1 for true and 0 for false.
|
||||
|
||||
proc do_function_calls {} {
|
||||
global prototypes
|
||||
global gcc_compiled
|
||||
# We need to up this because this can be really slow on some boards.
|
||||
set timeout 60;
|
||||
|
||||
gdb_test "p t_char_values(0,0)" " = 0"
|
||||
gdb_test "p t_char_values('a','b')" " = 1"
|
||||
gdb_test "p t_char_values(char_val1,char_val2)" " = 1"
|
||||
gdb_test "p t_char_values('a',char_val2)" " = 1"
|
||||
gdb_test "p t_char_values(char_val1,'b')" " = 1"
|
||||
|
||||
gdb_test "p t_short_values(0,0)" " = 0"
|
||||
gdb_test "p t_short_values(10,-23)" " = 1"
|
||||
gdb_test "p t_short_values(short_val1,short_val2)" " = 1"
|
||||
gdb_test "p t_short_values(10,short_val2)" " = 1"
|
||||
gdb_test "p t_short_values(short_val1,-23)" " = 1"
|
||||
|
||||
gdb_test "p t_int_values(0,0)" " = 0"
|
||||
gdb_test "p t_int_values(87,-26)" " = 1"
|
||||
gdb_test "p t_int_values(int_val1,int_val2)" " = 1"
|
||||
gdb_test "p t_int_values(87,int_val2)" " = 1"
|
||||
gdb_test "p t_int_values(int_val1,-26)" " = 1"
|
||||
|
||||
gdb_test "p t_long_values(0,0)" " = 0"
|
||||
gdb_test "p t_long_values(789,-321)" " = 1"
|
||||
gdb_test "p t_long_values(long_val1,long_val2)" " = 1"
|
||||
gdb_test "p t_long_values(789,long_val2)" " = 1"
|
||||
gdb_test "p t_long_values(long_val1,-321)" " = 1"
|
||||
|
||||
if ![target_info exists gdb,skip_float_tests] {
|
||||
gdb_test "p t_float_values(0.0,0.0)" " = 0"
|
||||
|
||||
# These next four tests fail on the mn10300.
|
||||
# The first value is passed in regs, the other in memory.
|
||||
# Gcc emits different stabs for the two parameters; the first is
|
||||
# claimed to be a float, the second a double.
|
||||
# dbxout.c in gcc claims this is the desired behavior.
|
||||
setup_xfail "mn10300-*-*"
|
||||
gdb_test "p t_float_values(3.14159,-2.3765)" " = 1"
|
||||
setup_xfail "mn10300-*-*"
|
||||
gdb_test "p t_float_values(float_val1,float_val2)" " = 1"
|
||||
setup_xfail "mn10300-*-*"
|
||||
gdb_test "p t_float_values(3.14159,float_val2)" " = 1"
|
||||
setup_xfail "mn10300-*-*"
|
||||
gdb_test "p t_float_values(float_val1,-2.3765)" " = 1"
|
||||
|
||||
# Test passing of arguments which might not be widened.
|
||||
gdb_test "p t_float_values2(0.0,0.0)" " = 0"
|
||||
|
||||
# Although PR 5318 mentions SunOS specifically, this seems
|
||||
# to be a generic problem on quite a few platforms.
|
||||
if $prototypes then {
|
||||
setup_xfail "hppa*-*-*" "sparc-*-*" "mips*-*-*" 5318
|
||||
if {!$gcc_compiled} then {
|
||||
setup_xfail "alpha-dec-osf2*" "i*86-*-sysv4*" 5318
|
||||
}
|
||||
}
|
||||
gdb_test "p t_float_values2(3.14159,float_val2)" " = 1"
|
||||
gdb_test "p t_small_values(1,2,3,4,5,6,7,8,9,10)" " = 55"
|
||||
|
||||
gdb_test "p t_double_values(0.0,0.0)" " = 0"
|
||||
gdb_test "p t_double_values(45.654,-67.66)" " = 1"
|
||||
gdb_test "p t_double_values(double_val1,double_val2)" " = 1"
|
||||
gdb_test "p t_double_values(45.654,double_val2)" " = 1"
|
||||
gdb_test "p t_double_values(double_val1,-67.66)" " = 1"
|
||||
}
|
||||
|
||||
gdb_test "p t_string_values(string_val2,string_val1)" " = 0"
|
||||
gdb_test "p t_string_values(string_val1,string_val2)" " = 1"
|
||||
gdb_test "p t_string_values(\"string 1\",\"string 2\")" " = 1"
|
||||
gdb_test "p t_string_values(\"string 1\",string_val2)" " = 1"
|
||||
gdb_test "p t_string_values(string_val1,\"string 2\")" " = 1"
|
||||
|
||||
gdb_test "p t_char_array_values(char_array_val2,char_array_val1)" " = 0"
|
||||
gdb_test "p t_char_array_values(char_array_val1,char_array_val2)" " = 1"
|
||||
gdb_test "p t_char_array_values(\"carray 1\",\"carray 2\")" " = 1"
|
||||
gdb_test "p t_char_array_values(\"carray 1\",char_array_val2)" " = 1"
|
||||
gdb_test "p t_char_array_values(char_array_val1,\"carray 2\")" " = 1"
|
||||
|
||||
gdb_test "p doubleit(4)" " = 8"
|
||||
gdb_test "p add(4,5)" " = 9"
|
||||
gdb_test "p t_func_values(func_val2,func_val1)" " = 0"
|
||||
gdb_test "p t_func_values(func_val1,func_val2)" " = 1"
|
||||
|
||||
# On the rs6000, we need to pass the address of the trampoline routine,
|
||||
# not the address of add itself. I don't know how to go from add to
|
||||
# the address of the trampoline. Similar problems exist on the HPPA,
|
||||
# and in fact can present an unsolvable problem as the stubs may not
|
||||
# even exist in the user's program. We've slightly recoded t_func_values
|
||||
# to avoid such problems in the common case. This may or may not help
|
||||
# the RS6000.
|
||||
setup_xfail "rs6000*-*-*"
|
||||
setup_xfail "powerpc*-*-*"
|
||||
if {!$gcc_compiled && [istarget hppa*-*-hpux*]} then {
|
||||
gdb_test "p t_func_values(add,func_val2)" "You cannot.*ignored.*"
|
||||
} else {
|
||||
gdb_test "p t_func_values(add,func_val2)" " = 1"
|
||||
}
|
||||
|
||||
setup_xfail "rs6000*-*-*"
|
||||
setup_xfail "powerpc*-*-*"
|
||||
if {!$gcc_compiled && [istarget hppa*-*-hpux*]} then {
|
||||
gdb_test "p t_func_values(func_val1,doubleit)" "You cannot.*ignored.*"
|
||||
} else {
|
||||
gdb_test "p t_func_values(func_val1,doubleit)" " = 1"
|
||||
}
|
||||
|
||||
gdb_test "p t_call_add(func_val1,3,4)" " = 7"
|
||||
|
||||
setup_xfail "rs6000*-*-*"
|
||||
setup_xfail "powerpc*-*-*"
|
||||
if {!$gcc_compiled && [istarget hppa*-*-hpux*]} then {
|
||||
gdb_test "p t_call_add(add,3,4)" "You cannot.*ignored.*"
|
||||
} else {
|
||||
gdb_test "p t_call_add(add,3,4)" " = 7"
|
||||
}
|
||||
|
||||
gdb_test "p t_enum_value1(enumval1)" " = 1"
|
||||
gdb_test "p t_enum_value1(enum_val1)" " = 1"
|
||||
gdb_test "p t_enum_value1(enum_val2)" " = 0"
|
||||
|
||||
gdb_test "p t_enum_value2(enumval2)" " = 1"
|
||||
gdb_test "p t_enum_value2(enum_val2)" " = 1"
|
||||
gdb_test "p t_enum_value2(enum_val1)" " = 0"
|
||||
|
||||
gdb_test "p sum_args(1,{2})" " = 2"
|
||||
gdb_test "p sum_args(2,{2,3})" " = 5"
|
||||
gdb_test "p sum_args(3,{2,3,4})" " = 9"
|
||||
gdb_test "p sum_args(4,{2,3,4,5})" " = 14"
|
||||
|
||||
gdb_test "p sum10 (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)" " = 55"
|
||||
|
||||
gdb_test "p cmp10 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)" " = 1"
|
||||
|
||||
gdb_test "p t_structs_c(struct_val1)" "= 120 'x'" \
|
||||
"call inferior func with struct - returns char"
|
||||
gdb_test "p t_structs_s(struct_val1)" "= 87" \
|
||||
"call inferior func with struct - returns short"
|
||||
gdb_test "p t_structs_i(struct_val1)" "= 76" \
|
||||
"call inferior func with struct - returns int"
|
||||
gdb_test "p t_structs_l(struct_val1)" "= 51" \
|
||||
"call inferior func with struct - returns long"
|
||||
setup_xfail "i*86-*-*"
|
||||
gdb_test "p t_structs_f(struct_val1)" "= 2.12.*" \
|
||||
"call inferior func with struct - returns float"
|
||||
setup_xfail "i*86-*-*"
|
||||
gdb_test "p t_structs_d(struct_val1)" "= 9.87.*" \
|
||||
"call inferior func with struct - returns double"
|
||||
gdb_test "p t_structs_a(struct_val1)" "= (.unsigned char .. )?\"foo\"" \
|
||||
"call inferior func with struct - returns char *"
|
||||
}
|
||||
|
||||
# Start with a fresh gdb.
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
gdb_test "set print sevenbit-strings" ""
|
||||
gdb_test "set print address off" ""
|
||||
gdb_test "set width 0" ""
|
||||
|
||||
if { ![set_lang_c] } {
|
||||
gdb_suppress_tests;
|
||||
} else {
|
||||
if { ![runto_main] } {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
}
|
||||
|
||||
gdb_test "next" ".*"
|
||||
do_function_calls
|
||||
|
||||
return 0
|
||||
267
gdb/testsuite/gdb.base/callfuncs2.c
Normal file
267
gdb/testsuite/gdb.base/callfuncs2.c
Normal file
@@ -0,0 +1,267 @@
|
||||
/* Support program for testing gdb's ability to call functions
|
||||
in an inferior which doesn't itself call malloc, pass appropriate
|
||||
arguments to those functions, and get the returned result. */
|
||||
|
||||
#ifdef NO_PROTOTYPES
|
||||
#define PARAMS(paramlist) ()
|
||||
#else
|
||||
#define PARAMS(paramlist) paramlist
|
||||
#endif
|
||||
|
||||
char char_val1 = 'a';
|
||||
char char_val2 = 'b';
|
||||
|
||||
short short_val1 = 10;
|
||||
short short_val2 = -23;
|
||||
|
||||
int int_val1 = 87;
|
||||
int int_val2 = -26;
|
||||
|
||||
long long_val1 = 789;
|
||||
long long_val2 = -321;
|
||||
|
||||
float float_val1 = 3.14159;
|
||||
float float_val2 = -2.3765;
|
||||
|
||||
double double_val1 = 45.654;
|
||||
double double_val2 = -67.66;
|
||||
|
||||
#define DELTA (0.001)
|
||||
|
||||
char *string_val1 = "string 1";
|
||||
char *string_val2 = "string 2";
|
||||
|
||||
char char_array_val1[] = "carray 1";
|
||||
char char_array_val2[] = "carray 2";
|
||||
|
||||
struct struct1 {
|
||||
char c;
|
||||
short s;
|
||||
int i;
|
||||
long l;
|
||||
float f;
|
||||
double d;
|
||||
char a[4];
|
||||
} struct_val1 = { 'x', 87, 76, 51, 2.1234, 9.876, "foo" };
|
||||
|
||||
/* Some functions that can be passed as arguments to other test
|
||||
functions, or called directly. */
|
||||
|
||||
int add (a, b)
|
||||
int a, b;
|
||||
{
|
||||
return (a + b);
|
||||
}
|
||||
|
||||
int doubleit (a)
|
||||
int a;
|
||||
{
|
||||
return (a + a);
|
||||
}
|
||||
|
||||
int (*func_val1) PARAMS((int,int)) = add;
|
||||
int (*func_val2) PARAMS((int)) = doubleit;
|
||||
|
||||
/* An enumeration and functions that test for specific values. */
|
||||
|
||||
enum enumtype { enumval1, enumval2, enumval3 };
|
||||
enum enumtype enum_val1 = enumval1;
|
||||
enum enumtype enum_val2 = enumval2;
|
||||
enum enumtype enum_val3 = enumval3;
|
||||
|
||||
t_enum_value1 (enum_arg)
|
||||
enum enumtype enum_arg;
|
||||
{
|
||||
return (enum_arg == enum_val1);
|
||||
}
|
||||
|
||||
t_enum_value2 (enum_arg)
|
||||
enum enumtype enum_arg;
|
||||
{
|
||||
return (enum_arg == enum_val2);
|
||||
}
|
||||
|
||||
t_enum_value3 (enum_arg)
|
||||
enum enumtype enum_arg;
|
||||
{
|
||||
return (enum_arg == enum_val3);
|
||||
}
|
||||
|
||||
/* A function that takes a vector of integers (along with an explicit
|
||||
count) and returns their sum. */
|
||||
|
||||
int sum_args (argc, argv)
|
||||
int argc;
|
||||
int argv[];
|
||||
{
|
||||
int sumval = 0;
|
||||
int idx;
|
||||
|
||||
for (idx = 0; idx < argc; idx++)
|
||||
{
|
||||
sumval += argv[idx];
|
||||
}
|
||||
return (sumval);
|
||||
}
|
||||
|
||||
/* Test that we can call functions that take structs and return
|
||||
members from that struct */
|
||||
|
||||
char t_structs_c (tstruct) struct struct1 tstruct; { return (tstruct.c); }
|
||||
short t_structs_s (tstruct) struct struct1 tstruct; { return (tstruct.s); }
|
||||
int t_structs_i (tstruct) struct struct1 tstruct; { return (tstruct.i); }
|
||||
long t_structs_l (tstruct) struct struct1 tstruct; { return (tstruct.l); }
|
||||
float t_structs_f (tstruct) struct struct1 tstruct; { return (tstruct.f); }
|
||||
double t_structs_d (tstruct) struct struct1 tstruct; { return (tstruct.d); }
|
||||
char *t_structs_a (tstruct) struct struct1 tstruct; { return (tstruct.a); }
|
||||
|
||||
/* Test that calling functions works if there are a lot of arguments. */
|
||||
int
|
||||
sum10 (i0, i1, i2, i3, i4, i5, i6, i7, i8, i9)
|
||||
int i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
|
||||
{
|
||||
return i0 + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9;
|
||||
}
|
||||
|
||||
/* Gotta have a main to be able to generate a linked, runnable
|
||||
executable, and also provide a useful place to set a breakpoint. */
|
||||
|
||||
main ()
|
||||
{
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
breakpoint();
|
||||
#endif
|
||||
t_structs_c(struct_val1);
|
||||
}
|
||||
|
||||
/* Functions that expect specific values to be passed and return
|
||||
either 0 or 1, depending upon whether the values were
|
||||
passed incorrectly or correctly, respectively. */
|
||||
|
||||
int t_char_values (char_arg1, char_arg2)
|
||||
char char_arg1, char_arg2;
|
||||
{
|
||||
return ((char_arg1 == char_val1) && (char_arg2 == char_val2));
|
||||
}
|
||||
|
||||
int
|
||||
#ifdef NO_PROTOTYPES
|
||||
t_small_values (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)
|
||||
char arg1;
|
||||
short arg2;
|
||||
int arg3;
|
||||
char arg4;
|
||||
short arg5;
|
||||
char arg6;
|
||||
short arg7;
|
||||
int arg8;
|
||||
short arg9;
|
||||
short arg10;
|
||||
#else
|
||||
t_small_values (char arg1, short arg2, int arg3, char arg4, short arg5,
|
||||
char arg6, short arg7, int arg8, short arg9, short arg10)
|
||||
#endif
|
||||
{
|
||||
return arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10;
|
||||
}
|
||||
|
||||
int t_short_values (short_arg1, short_arg2)
|
||||
short short_arg1, short_arg2;
|
||||
{
|
||||
return ((short_arg1 == short_val1) && (short_arg2 == short_val2));
|
||||
}
|
||||
|
||||
int t_int_values (int_arg1, int_arg2)
|
||||
int int_arg1, int_arg2;
|
||||
{
|
||||
return ((int_arg1 == int_val1) && (int_arg2 == int_val2));
|
||||
}
|
||||
|
||||
int t_long_values (long_arg1, long_arg2)
|
||||
long long_arg1, long_arg2;
|
||||
{
|
||||
return ((long_arg1 == long_val1) && (long_arg2 == long_val2));
|
||||
}
|
||||
|
||||
int t_float_values (float_arg1, float_arg2)
|
||||
float float_arg1, float_arg2;
|
||||
{
|
||||
return ((float_arg1 - float_val1) < DELTA
|
||||
&& (float_arg1 - float_val1) > -DELTA
|
||||
&& (float_arg2 - float_val2) < DELTA
|
||||
&& (float_arg2 - float_val2) > -DELTA);
|
||||
}
|
||||
|
||||
int
|
||||
#ifdef NO_PROTOTYPES
|
||||
/* In this case we are just duplicating t_float_values, but that is the
|
||||
easiest way to deal with either ANSI or non-ANSI. */
|
||||
t_float_values2 (float_arg1, float_arg2)
|
||||
float float_arg1, float_arg2;
|
||||
#else
|
||||
t_float_values2 (float float_arg1, float float_arg2)
|
||||
#endif
|
||||
{
|
||||
return ((float_arg1 - float_val1) < DELTA
|
||||
&& (float_arg1 - float_val1) > -DELTA
|
||||
&& (float_arg2 - float_val2) < DELTA
|
||||
&& (float_arg2 - float_val2) > -DELTA);
|
||||
}
|
||||
|
||||
int t_double_values (double_arg1, double_arg2)
|
||||
double double_arg1, double_arg2;
|
||||
{
|
||||
return ((double_arg1 - double_val1) < DELTA
|
||||
&& (double_arg1 - double_val1) > -DELTA
|
||||
&& (double_arg2 - double_val2) < DELTA
|
||||
&& (double_arg2 - double_val2) > -DELTA);
|
||||
}
|
||||
|
||||
int t_string_values (string_arg1, string_arg2)
|
||||
char *string_arg1, *string_arg2;
|
||||
{
|
||||
return (!strcmp (string_arg1, string_val1) &&
|
||||
!strcmp (string_arg2, string_val2));
|
||||
}
|
||||
|
||||
int t_char_array_values (char_array_arg1, char_array_arg2)
|
||||
char char_array_arg1[], char_array_arg2[];
|
||||
{
|
||||
return (!strcmp (char_array_arg1, char_array_val1) &&
|
||||
!strcmp (char_array_arg2, char_array_val2));
|
||||
}
|
||||
|
||||
|
||||
/* This used to simply compare the function pointer arguments with
|
||||
known values for func_val1 and func_val2. Doing so is valid ANSI
|
||||
code, but on some machines (RS6000, HPPA, others?) it may fail when
|
||||
called directly by GDB.
|
||||
|
||||
In a nutshell, it's not possible for GDB to determine when the address
|
||||
of a function or the address of the function's stub/trampoline should
|
||||
be passed.
|
||||
|
||||
So, to avoid GDB lossage in the common case, we perform calls through the
|
||||
various function pointers and compare the return values. For the HPPA
|
||||
at least, this allows the common case to work.
|
||||
|
||||
If one wants to try something more complicated, pass the address of
|
||||
a function accepting a "double" as one of its first 4 arguments. Call
|
||||
that function indirectly through the function pointer. This would fail
|
||||
on the HPPA. */
|
||||
|
||||
int t_func_values (func_arg1, func_arg2)
|
||||
int (*func_arg1) PARAMS ((int, int));
|
||||
int (*func_arg2) PARAMS ((int));
|
||||
{
|
||||
return ((*func_arg1) (5,5) == (*func_val1) (5,5)
|
||||
&& (*func_arg2) (6) == (*func_val2) (6));
|
||||
}
|
||||
|
||||
int t_call_add (func_arg1, a, b)
|
||||
int (*func_arg1) PARAMS ((int, int));
|
||||
int a, b;
|
||||
{
|
||||
return ((*func_arg1)(a, b));
|
||||
}
|
||||
276
gdb/testsuite/gdb.base/callfuncs2.exp
Normal file
276
gdb/testsuite/gdb.base/callfuncs2.exp
Normal file
@@ -0,0 +1,276 @@
|
||||
# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
# 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)
|
||||
|
||||
# SAME tests as in callfuncs.exp but here the inferior program does not call malloc.
|
||||
|
||||
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile "callfuncs2"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
set prototypes 1
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
set prototypes 0;
|
||||
# built the second test case since we can't use prototypes
|
||||
warning "Prototypes not supported, rebuilding with -DNO_PROTOTYPES"
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DNO_PROTOTYPES}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
}
|
||||
|
||||
# Create and source the file that provides information about the compiler
|
||||
# used to compile the test case.
|
||||
|
||||
if [get_compiler_info ${binfile}] {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
# The a29k can't call functions, so don't even bother with this test.
|
||||
if [target_info exists gdb,cannot_call_functions] {
|
||||
setup_xfail "*-*-*" 2416
|
||||
fail "This target can not call functions"
|
||||
continue
|
||||
}
|
||||
|
||||
# Set the current language to C. This counts as a test. If it
|
||||
# fails, then we skip the other tests.
|
||||
|
||||
proc set_lang_c {} {
|
||||
global gdb_prompt
|
||||
|
||||
send_gdb "set language c\n"
|
||||
gdb_expect {
|
||||
-re ".*$gdb_prompt $" {}
|
||||
timeout { fail "set language c (timeout)" ; return 0 }
|
||||
}
|
||||
|
||||
send_gdb "show language\n"
|
||||
gdb_expect {
|
||||
-re ".* source language is \"c\".*$gdb_prompt $" {
|
||||
pass "set language to \"c\""
|
||||
return 1
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "setting language to \"c\""
|
||||
return 0
|
||||
}
|
||||
timeout {
|
||||
fail "can't show language (timeout)"
|
||||
return 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# FIXME: Before calling this proc, we should probably verify that
|
||||
# we can call inferior functions and get a valid integral value
|
||||
# returned.
|
||||
# Note that it is OK to check for 0 or 1 as the returned values, because C
|
||||
# specifies that the numeric value of a relational or logical expression
|
||||
# (computed in the inferior) is 1 for true and 0 for false.
|
||||
|
||||
proc do_function_calls {} {
|
||||
global prototypes
|
||||
global gcc_compiled
|
||||
# We need to up this because this can be really slow on some boards.
|
||||
set timeout 60;
|
||||
|
||||
gdb_test "p t_char_values(0,0)" " = 0"
|
||||
gdb_test "p t_char_values('a','b')" " = 1"
|
||||
gdb_test "p t_char_values(char_val1,char_val2)" " = 1"
|
||||
gdb_test "p t_char_values('a',char_val2)" " = 1"
|
||||
gdb_test "p t_char_values(char_val1,'b')" " = 1"
|
||||
|
||||
gdb_test "p t_short_values(0,0)" " = 0"
|
||||
gdb_test "p t_short_values(10,-23)" " = 1"
|
||||
gdb_test "p t_short_values(short_val1,short_val2)" " = 1"
|
||||
gdb_test "p t_short_values(10,short_val2)" " = 1"
|
||||
gdb_test "p t_short_values(short_val1,-23)" " = 1"
|
||||
|
||||
gdb_test "p t_int_values(0,0)" " = 0"
|
||||
gdb_test "p t_int_values(87,-26)" " = 1"
|
||||
gdb_test "p t_int_values(int_val1,int_val2)" " = 1"
|
||||
gdb_test "p t_int_values(87,int_val2)" " = 1"
|
||||
gdb_test "p t_int_values(int_val1,-26)" " = 1"
|
||||
|
||||
gdb_test "p t_long_values(0,0)" " = 0"
|
||||
gdb_test "p t_long_values(789,-321)" " = 1"
|
||||
gdb_test "p t_long_values(long_val1,long_val2)" " = 1"
|
||||
gdb_test "p t_long_values(789,long_val2)" " = 1"
|
||||
gdb_test "p t_long_values(long_val1,-321)" " = 1"
|
||||
|
||||
if ![target_info exists gdb,skip_float_tests] {
|
||||
gdb_test "p t_float_values(0.0,0.0)" " = 0"
|
||||
|
||||
# These next four tests fail on the mn10300.
|
||||
# The first value is passed in regs, the other in memory.
|
||||
# Gcc emits different stabs for the two parameters; the first is
|
||||
# claimed to be a float, the second a double.
|
||||
# dbxout.c in gcc claims this is the desired behavior.
|
||||
setup_xfail "mn10300-*-*"
|
||||
gdb_test "p t_float_values(3.14159,-2.3765)" " = 1"
|
||||
setup_xfail "mn10300-*-*"
|
||||
gdb_test "p t_float_values(float_val1,float_val2)" " = 1"
|
||||
setup_xfail "mn10300-*-*"
|
||||
gdb_test "p t_float_values(3.14159,float_val2)" " = 1"
|
||||
setup_xfail "mn10300-*-*"
|
||||
gdb_test "p t_float_values(float_val1,-2.3765)" " = 1"
|
||||
|
||||
# Test passing of arguments which might not be widened.
|
||||
gdb_test "p t_float_values2(0.0,0.0)" " = 0"
|
||||
|
||||
# Although PR 5318 mentions SunOS specifically, this seems
|
||||
# to be a generic problem on quite a few platforms.
|
||||
if $prototypes then {
|
||||
setup_xfail "hppa*-*-*" "sparc-*-*" "mips*-*-*" 5318
|
||||
if {!$gcc_compiled} then {
|
||||
setup_xfail "alpha-dec-osf2*" "i*86-*-sysv4*" 5318
|
||||
}
|
||||
}
|
||||
gdb_test "p t_float_values2(3.14159,float_val2)" " = 1"
|
||||
gdb_test "p t_small_values(1,2,3,4,5,6,7,8,9,10)" " = 55"
|
||||
|
||||
gdb_test "p t_double_values(0.0,0.0)" " = 0"
|
||||
gdb_test "p t_double_values(45.654,-67.66)" " = 1"
|
||||
gdb_test "p t_double_values(double_val1,double_val2)" " = 1"
|
||||
gdb_test "p t_double_values(45.654,double_val2)" " = 1"
|
||||
gdb_test "p t_double_values(double_val1,-67.66)" " = 1"
|
||||
|
||||
}
|
||||
|
||||
gdb_test "p t_string_values(string_val2,string_val1)" " = 0"
|
||||
gdb_test "p t_string_values(string_val1,string_val2)" " = 1"
|
||||
gdb_test "p t_string_values(\"string 1\",\"string 2\")" " = 1"
|
||||
gdb_test "p t_string_values(\"string 1\",string_val2)" " = 1"
|
||||
gdb_test "p t_string_values(string_val1,\"string 2\")" " = 1"
|
||||
|
||||
gdb_test "p t_char_array_values(char_array_val2,char_array_val1)" " = 0"
|
||||
gdb_test "p t_char_array_values(char_array_val1,char_array_val2)" " = 1"
|
||||
gdb_test "p t_char_array_values(\"carray 1\",\"carray 2\")" " = 1"
|
||||
gdb_test "p t_char_array_values(\"carray 1\",char_array_val2)" " = 1"
|
||||
gdb_test "p t_char_array_values(char_array_val1,\"carray 2\")" " = 1"
|
||||
|
||||
gdb_test "p doubleit(4)" " = 8"
|
||||
gdb_test "p add(4,5)" " = 9"
|
||||
gdb_test "p t_func_values(func_val2,func_val1)" " = 0"
|
||||
gdb_test "p t_func_values(func_val1,func_val2)" " = 1"
|
||||
|
||||
# On the rs6000, we need to pass the address of the trampoline routine,
|
||||
# not the address of add itself. I don't know how to go from add to
|
||||
# the address of the trampoline. Similar problems exist on the HPPA,
|
||||
# and in fact can present an unsolvable problem as the stubs may not
|
||||
# even exist in the user's program. We've slightly recoded t_func_values
|
||||
# to avoid such problems in the common case. This may or may not help
|
||||
# the RS6000.
|
||||
setup_xfail "rs6000*-*-*"
|
||||
setup_xfail "powerpc*-*-*"
|
||||
|
||||
if {!$gcc_compiled && [istarget hppa*-*-hpux*]} then {
|
||||
gdb_test "p t_func_values(add,func_val2)" "You cannot.*ignored.*"
|
||||
} else {
|
||||
gdb_test "p t_func_values(add,func_val2)" " = 1"
|
||||
}
|
||||
|
||||
setup_xfail "rs6000*-*-*"
|
||||
setup_xfail "powerpc*-*-*"
|
||||
|
||||
if {!$gcc_compiled && [istarget hppa*-*-hpux*]} then {
|
||||
gdb_test "p t_func_values(func_val1,doubleit)" "You cannot.*ignored.*"
|
||||
} else {
|
||||
gdb_test "p t_func_values(func_val1,doubleit)" " = 1"
|
||||
}
|
||||
|
||||
gdb_test "p t_call_add(func_val1,3,4)" " = 7"
|
||||
|
||||
setup_xfail "rs6000*-*-*"
|
||||
setup_xfail "powerpc*-*-*"
|
||||
|
||||
if {!$gcc_compiled && [istarget hppa*-*-hpux*]} then {
|
||||
gdb_test "p t_call_add(add,3,4)" "You cannot.*ignored.*"
|
||||
} else {
|
||||
gdb_test "p t_call_add(add,3,4)" " = 7"
|
||||
}
|
||||
|
||||
gdb_test "p t_enum_value1(enumval1)" " = 1"
|
||||
gdb_test "p t_enum_value1(enum_val1)" " = 1"
|
||||
gdb_test "p t_enum_value1(enum_val2)" " = 0"
|
||||
|
||||
gdb_test "p t_enum_value2(enumval2)" " = 1"
|
||||
gdb_test "p t_enum_value2(enum_val2)" " = 1"
|
||||
gdb_test "p t_enum_value2(enum_val1)" " = 0"
|
||||
|
||||
gdb_test "p sum_args(1,{2})" " = 2"
|
||||
gdb_test "p sum_args(2,{2,3})" " = 5"
|
||||
gdb_test "p sum_args(3,{2,3,4})" " = 9"
|
||||
gdb_test "p sum_args(4,{2,3,4,5})" " = 14"
|
||||
gdb_test "p sum10 (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)" " = 55"
|
||||
|
||||
gdb_test "p t_structs_c(struct_val1)" "= 120 'x'" \
|
||||
"call inferior func with struct - returns char"
|
||||
gdb_test "p t_structs_s(struct_val1)" "= 87" \
|
||||
"call inferior func with struct - returns short"
|
||||
gdb_test "p t_structs_i(struct_val1)" "= 76" \
|
||||
"call inferior func with struct - returns int"
|
||||
gdb_test "p t_structs_l(struct_val1)" "= 51" \
|
||||
"call inferior func with struct - returns long"
|
||||
setup_xfail "i*86-*-*"
|
||||
gdb_test "p t_structs_f(struct_val1)" "= 2.12.*" \
|
||||
"call inferior func with struct - returns float"
|
||||
setup_xfail "i*86-*-*"
|
||||
gdb_test "p t_structs_d(struct_val1)" "= 9.87.*" \
|
||||
"call inferior func with struct - returns double"
|
||||
gdb_test "p t_structs_a(struct_val1)" "= (.unsigned char .. )?\"foo\"" \
|
||||
"call inferior func with struct - returns char *"
|
||||
|
||||
}
|
||||
|
||||
# Start with a fresh gdb.
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
gdb_test "set print sevenbit-strings" ""
|
||||
gdb_test "set print address off" ""
|
||||
gdb_test "set width 0" ""
|
||||
|
||||
if { ![set_lang_c] } {
|
||||
gdb_suppress_tests;
|
||||
} else {
|
||||
if { ![runto_main] } {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
}
|
||||
|
||||
gdb_test "next" ".*"
|
||||
do_function_calls
|
||||
|
||||
return 0
|
||||
248
gdb/testsuite/gdb.base/commands.exp
Normal file
248
gdb/testsuite/gdb.base/commands.exp
Normal file
@@ -0,0 +1,248 @@
|
||||
# Copyright (C) 1988, 1990, 1991, 1992, 1997 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
#
|
||||
# test special commands (if, while, etc)
|
||||
#
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile "run"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/commands
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
delete_breakpoints
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
proc gdbvar_simple_if_test {} {
|
||||
global gdb_prompt
|
||||
|
||||
gdb_test "set \$foo = 0" "" "set foo in gdbvar_simple_if_test"
|
||||
# All this test should do is print 0xdeadbeef once.
|
||||
gdb_test "if \$foo == 1\np/x 0xfeedface\nelse\np/x 0xdeadbeef\nend" "\\\$\[0-9\]* = 0xdeadbeef" "gdbvar_simple_if_test #1"
|
||||
# All this test should do is print 0xfeedface once.
|
||||
gdb_test "if \$foo == 0\np/x 0xfeedface\nelse\np/x 0xdeadbeef\nend" "\\\$\[0-9\]* = 0xfeedface" "gdbvar_simple_if_test #2"
|
||||
}
|
||||
|
||||
proc gdbvar_simple_while_test {} {
|
||||
global gdb_prompt
|
||||
|
||||
gdb_test "set \$foo = 5" "" "set foo in gdbvar_simple_while_test"
|
||||
# This test should print 0xfeedface five times.
|
||||
gdb_test "while \$foo > 0\np/x 0xfeedface\nset \$foo -= 1\nend" "\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" "gdbvar_simple_while_test #1"
|
||||
}
|
||||
|
||||
proc gdbvar_complex_if_while_test {} {
|
||||
global gdb_prompt
|
||||
|
||||
gdb_test "set \$foo = 4" "" "set foo in gdbvar complex_if_while_test"
|
||||
# This test should alternate between 0xdeadbeef and 0xfeedface two times.
|
||||
gdb_test "while \$foo > 0\nset \$foo -= 1\nif \(\$foo % 2\) == 1\np/x 0xdeadbeef\nelse\np/x 0xfeedface\nend\nend" "\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" "gdbvar_complex_if_while_test #1"
|
||||
}
|
||||
|
||||
proc progvar_simple_if_test {} {
|
||||
global gdb_prompt
|
||||
|
||||
if [target_info exists noargs] {
|
||||
verbose "Skipping progvar_simple_if_test because of noargs."
|
||||
return
|
||||
}
|
||||
|
||||
if { ![runto factorial] } then { gdb_suppress_tests; }
|
||||
# Don't depend upon argument passing, since most simulators don't currently
|
||||
# support it. Bash value variable to be what we want.
|
||||
gdb_test "p value=5" "" "set value to 5 in progvar_simple_if_test #1"
|
||||
# All this test should do is print 0xdeadbeef once.
|
||||
gdb_test "if value == 1\np/x 0xfeedface\nelse\np/x 0xdeadbeef\nend" "\\\$\[0-9\]* = 0xdeadbeef" "progvar_simple_if_test #1"
|
||||
# All this test should do is print 0xfeedface once.
|
||||
gdb_test "if value == 5\np/x 0xfeedface\nelse\np/x 0xdeadbeef\nend" "\\\$\[0-9\]* = 0xfeedface" "progvar_simple_if_test #2"
|
||||
gdb_stop_suppressing_tests;
|
||||
}
|
||||
|
||||
proc progvar_simple_while_test {} {
|
||||
global gdb_prompt
|
||||
|
||||
if [target_info exists noargs] {
|
||||
verbose "Skipping progvar_simple_while_test because of noargs."
|
||||
return
|
||||
}
|
||||
|
||||
if { ![runto factorial] } then { gdb_suppress_tests }
|
||||
# Don't depend upon argument passing, since most simulators don't currently
|
||||
# support it. Bash value variable to be what we want.
|
||||
gdb_test "p value=5" "" "set value to 5 in progvar_simple_if_test #2"
|
||||
# This test should print 0xfeedface five times.
|
||||
gdb_test "while value > 0\np/x 0xfeedface\nset value -= 1\nend" "\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" "progvar_simple_while_test #1"
|
||||
gdb_stop_suppressing_tests;
|
||||
}
|
||||
|
||||
proc progvar_complex_if_while_test {} {
|
||||
global gdb_prompt
|
||||
|
||||
if [target_info exists noargs] {
|
||||
verbose "Skipping progvar_simple_if_while_test because of noargs."
|
||||
return
|
||||
}
|
||||
|
||||
if { ![runto factorial] } then { gdb_suppress_tests }
|
||||
# Don't depend upon argument passing, since most simulators don't currently
|
||||
# support it. Bash value variable to be what we want.
|
||||
gdb_test "p value=4" "" "set value to 4 in progvar_simple_if_test"
|
||||
# This test should alternate between 0xdeadbeef and 0xfeedface two times.
|
||||
gdb_test "while value > 0\nset value -= 1\nif \(value % 2\) == 1\np/x 0xdeadbeef\nelse\np/x 0xfeedface\nend\nend" "\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" "progvar_complex_if_while_test #1"
|
||||
gdb_stop_suppressing_tests;
|
||||
}
|
||||
|
||||
proc if_while_breakpoint_command_test {} {
|
||||
if [target_info exists noargs] {
|
||||
verbose "Skipping if_while_breakpoint_command_test because of noargs."
|
||||
return
|
||||
}
|
||||
|
||||
if { ![runto factorial] } then { gdb_suppress_tests }
|
||||
# Don't depend upon argument passing, since most simulators don't currently
|
||||
# support it. Bash value variable to be what we want.
|
||||
gdb_test "p value=5" "" "set value to 5 in progvar_simple_if_test"
|
||||
delete_breakpoints
|
||||
gdb_test "break factorial" "Breakpoint.*at.*" "break factorial #1"
|
||||
|
||||
send_gdb "commands\n"
|
||||
gdb_expect {
|
||||
-re "End with" {
|
||||
pass "commands in if_while_breakpoint_command_test"
|
||||
}
|
||||
default {
|
||||
fail "(timeout or eof) commands in if_while_breakpoint_command_test"
|
||||
}
|
||||
}
|
||||
# This test should alternate between 0xdeadbeef and 0xfeedface two times.
|
||||
gdb_test "while value > 0\nset value -= 1\nif \(value % 2\) == 1\np/x 0xdeadbeef\nelse\np/x 0xfeedface\nend\nend\nend" "" "commands part 2 in if_while_breakpoint_command_test"
|
||||
gdb_test "continue" "\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" "if_while_breakpoint_command_test #1"
|
||||
gdb_test "info break" "while.*set.*if.*p/x.*else.*p/x.*end.*" "info break in if_while_breakpoint_command_test"
|
||||
gdb_stop_suppressing_tests;
|
||||
}
|
||||
|
||||
# Test that we can run the inferior from breakpoint commands.
|
||||
proc infrun_breakpoint_command_test {} {
|
||||
if [target_info exists noargs] {
|
||||
verbose "Skipping infrun_breakpoint_command_test because of noargs."
|
||||
return
|
||||
}
|
||||
|
||||
if { ![runto factorial] } then { gdb_suppress_tests }
|
||||
# Don't depend upon argument passing, since most simulators don't currently
|
||||
# support it. Bash value variable to be what we want.
|
||||
gdb_test "p value=6" "" "set value to 6 in progvar_simple_if_test #1"
|
||||
delete_breakpoints
|
||||
gdb_test "break factorial if value == 5" "Breakpoint.*at.*"
|
||||
|
||||
# infrun_breakpoint_command_test - This test was broken into two parts
|
||||
# to get around a synchronization problem in expect.
|
||||
# part1: issue the gdb command "commands"
|
||||
# part2: send the list of commands
|
||||
send_gdb "commands\n"
|
||||
gdb_expect {
|
||||
-re "End with" {
|
||||
pass "commands in infrun_breakpoint_command_test #1"
|
||||
}
|
||||
default {
|
||||
fail "(timeout or eof) commands in infrun_breakpoint_command_test"
|
||||
}
|
||||
}
|
||||
gdb_test "step\nstep\nstep\nstep\nbt\nend" "" \
|
||||
"commands in infrun_breakpoint_command_test #2"
|
||||
|
||||
gdb_test "continue" "Breakpoint \[0-9\]*, factorial \\(value=5\\).*at.*
|
||||
\[0-9\]*\[ \]*if \\(value > 1\\) \{.*
|
||||
\[0-9\]*\[ \]*value \\*= factorial \\(value - 1\\);.*
|
||||
factorial \\(value=4\\) at.*\[0-9\]*\[ \]*if \\(value > 1\\) \{.*
|
||||
\[0-9\]*\[ \]*value \\*= factorial \\(value - 1\\);.*
|
||||
factorial \\(value=3\\) at .*
|
||||
\[0-9\]*\[ \]*if \\(value > 1\\) \{.*
|
||||
#0 factorial \\(value=3\\).*
|
||||
#1 \[0-9a-fx\]* in factorial \\(value=4\\).*
|
||||
#2 \[0-9a-fx\]* in factorial \\(value=5\\).*
|
||||
#3 \[0-9a-fx\]* in factorial \\(value=6\\).*
|
||||
#4 \[0-9a-fx\]* in main \\(.*\\).*" \
|
||||
"continue in infrun_breakpoint_command_test";
|
||||
gdb_stop_suppressing_tests;
|
||||
}
|
||||
|
||||
proc breakpoint_command_test {} {
|
||||
if [target_info exists noargs] {
|
||||
verbose "Skipping breakpoint_command_test because of noargs."
|
||||
return
|
||||
}
|
||||
|
||||
if { ![runto factorial] } then { gdb_suppress_tests; }
|
||||
# Don't depend upon argument passing, since most simulators don't currently
|
||||
# support it. Bash value variable to be what we want.
|
||||
gdb_test "p value=6" "" "set value to 6 in progvar_simple_if_test #2"
|
||||
delete_breakpoints
|
||||
gdb_test "break factorial" "Breakpoint.*at.*" "break factorial #2"
|
||||
gdb_test "commands\nprintf \"Now the value is %d\\n\", value\nend" \
|
||||
"Type commands.*\nEnd with.*" "commands in breakpoint_command_test"
|
||||
gdb_test "continue" "Breakpoint \[0-9\]*, factorial.*Now the value is 5" \
|
||||
"continue in breakpoint_command_test"
|
||||
gdb_test "print value" " = 5" "print value in breakpoint_command_test"
|
||||
gdb_stop_suppressing_tests;
|
||||
}
|
||||
|
||||
# Test a simple user defined command (with arguments)
|
||||
proc user_defined_command_test {} {
|
||||
global gdb_prompt
|
||||
|
||||
gdb_test "set \$foo = 4" "" "set foo in user_defined_command_test"
|
||||
|
||||
send_gdb "define mycommand\n"
|
||||
gdb_expect {
|
||||
-re "End with" {
|
||||
pass "define mycommand in user_defined_command_test"
|
||||
}
|
||||
default {
|
||||
fail "(timeout or eof) define mycommand in user_defined_command_test"
|
||||
}
|
||||
}
|
||||
# This test should alternate between 0xdeadbeef and 0xfeedface two times.
|
||||
gdb_test "while \$arg0 > 0\nset \$arg0 -= 1\nif \(\$arg0 % 2\) == 1\np/x 0xdeadbeef\nelse\np/x 0xfeedface\nend\nend\nend" "" "enter commands in user_defined_command_test"
|
||||
|
||||
gdb_test "mycommand \$foo" "\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" "execute user defined command in user_defined_command_test"
|
||||
gdb_test "show user mycommand" "while.*set.*if.*p/x.*else.*p/x.*end.*" "display user command in user_defined_command_test"
|
||||
}
|
||||
|
||||
gdbvar_simple_if_test
|
||||
gdbvar_simple_while_test
|
||||
gdbvar_complex_if_while_test
|
||||
progvar_simple_if_test
|
||||
progvar_simple_while_test
|
||||
progvar_complex_if_while_test
|
||||
if_while_breakpoint_command_test
|
||||
infrun_breakpoint_command_test
|
||||
breakpoint_command_test
|
||||
user_defined_command_test
|
||||
31
gdb/testsuite/gdb.base/compiler.c
Normal file
31
gdb/testsuite/gdb.base/compiler.c
Normal file
@@ -0,0 +1,31 @@
|
||||
/* Often the behavior of any particular test depends upon what compiler was
|
||||
used to compile the test. As each test is compiled, this file is
|
||||
preprocessed by the same compiler used to compile that specific test
|
||||
(different tests might be compiled by different compilers, particularly
|
||||
if compiled at different times), and used to generate a *.ci (compiler
|
||||
info) file for that test.
|
||||
|
||||
I.E., when callfuncs is compiled, a callfuncs.ci file will be generated,
|
||||
which can then be sourced by callfuncs.exp to give callfuncs.exp access
|
||||
to information about the compilation environment.
|
||||
|
||||
TODO: It might be a good idea to add expect code that tests each
|
||||
definition made with 'set" to see if one already exists, and if so
|
||||
warn about conflicts if it is being set to something else. */
|
||||
|
||||
/* This needs to be kept in sync with whatis.c and gdb.exp(get_compiler_info).
|
||||
If this ends up being hairy, we could use a common header file. */
|
||||
|
||||
#if defined (__STDC__) || defined (_AIX)
|
||||
set signed_keyword_not_used 0
|
||||
#else
|
||||
set signed_keyword_not_used 1
|
||||
#endif
|
||||
|
||||
#if defined (__GNUC__)
|
||||
set gcc_compiled __GNUC__
|
||||
#else
|
||||
set gcc_compiled 0
|
||||
#endif
|
||||
|
||||
return 0
|
||||
568
gdb/testsuite/gdb.base/completion.exp
Normal file
568
gdb/testsuite/gdb.base/completion.exp
Normal file
@@ -0,0 +1,568 @@
|
||||
# Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# This file was written by Elena Zannoni (ezannoni@cygnus.com)
|
||||
|
||||
# This file is part of the gdb testsuite.
|
||||
|
||||
#
|
||||
# tests for command completion
|
||||
#
|
||||
# Here are some useful test cases for completion.
|
||||
# They should be tested with both M-? and TAB.
|
||||
#
|
||||
# "show output-" "radix"
|
||||
# "show output" "-radix"
|
||||
# "p" ambiguous (commands starting with p--path, print, printf, etc.)
|
||||
# "p " ambiguous (all symbols)
|
||||
# "info t foo" no completions
|
||||
# "info t " no completions
|
||||
# "info t" ambiguous ("info target", "info terminal", etc.)
|
||||
# "info ajksdlfk" no completions
|
||||
# "info ajksdlfk " no completions
|
||||
# "info" " "
|
||||
# "info " ambiguous (all info commands)
|
||||
# "p \"a" no completions (string constant)
|
||||
# "p 'a" ambiguous (all symbols starting with a)
|
||||
# "p b-a" ambiguous (all symbols starting with a)
|
||||
# "p b-" ambiguous (all symbols)
|
||||
# "file Make" "file" (word break hard to screw up here)
|
||||
# "file ../gdb.stabs/we" "ird" (needs to not break word at slash)
|
||||
#
|
||||
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
|
||||
#skip all these tests for now (FIXME)
|
||||
|
||||
continue
|
||||
|
||||
global usestubs
|
||||
|
||||
#
|
||||
# test running programs
|
||||
#
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile "break"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
if ![runto_main] then {
|
||||
perror "tests suppressed"
|
||||
}
|
||||
|
||||
set oldtimeout1 $timeout
|
||||
set timeout [expr $timeout + 500]
|
||||
|
||||
|
||||
send_gdb "hfgfh\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^hfgfh\\\x07$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "Undefined command: \"hfgfh\"\\. Try \"help\"\\..*$gdb_prompt $"\
|
||||
{ pass "complete 'hfgfh'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'hfgfh'"}
|
||||
timeout {fail "(timeout) complete 'hfgfh'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'hfgfh'" }
|
||||
timeout { fail "(timeout) complete 'hfgfh'" }
|
||||
}
|
||||
|
||||
#exp_internal 0
|
||||
|
||||
send_gdb "show output\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^show output-radix $"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "Default output radix for printing of values is 10\\..*$gdb_prompt $"\
|
||||
{ pass "complete 'show output'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'show output'"}
|
||||
timeout {fail "(timeout) complete 'show output'"}
|
||||
}
|
||||
}
|
||||
-re "^show output$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "Default output radix for printing of values is 10\\..*$gdb_prompt $"\
|
||||
{ fail "complete 'show output'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'show output'"}
|
||||
timeout { fail "(timeout) complete 'show output'"}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-re ".*$gdb_prompt $" { fail "complete 'show output'" }
|
||||
timeout { fail "(timeout) complete 'show output'" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "show output-\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^show output-radix $"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "Default output radix for printing of values is 10\\..*$gdb_prompt $"\
|
||||
{ pass "complete 'show output-'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'show output-'"}
|
||||
timeout {fail "(timeout) complete 'show output-'"}
|
||||
}
|
||||
}
|
||||
-re "^show output-$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "Default output radix for printing of values is 10\\..*$gdb_prompt $"\
|
||||
{ fail "complete 'show output-'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'show output-'"}
|
||||
timeout { fail "(timeout) complete 'show output-'"}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-re ".*$gdb_prompt $" { fail "complete 'show output-'" }
|
||||
timeout { fail "(timeout) complete 'show output-'" }
|
||||
}
|
||||
|
||||
send_gdb "p\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^p\\\x07$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "The history is empty\\..*$gdb_prompt $"\
|
||||
{ pass "complete 'p'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'p'"}
|
||||
timeout {fail "(timeout) complete 'p'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'p'" }
|
||||
timeout { fail "(timeout) complete 'p'" }
|
||||
}
|
||||
|
||||
send_gdb "p \t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^p \\\x07$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "The history is empty\\..*$gdb_prompt $"\
|
||||
{ pass "complete 'p '"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'p '"}
|
||||
timeout {fail "(timeout) complete 'p '"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'p '" }
|
||||
timeout { fail "(timeout) complete 'p '" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "info t foo\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^info t foo\\\x07$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "Ambiguous info command \"t foo\": target, terminal, threads, tp, tracepoints, types\\..*$gdb_prompt $"\
|
||||
{ pass "complete 'info t foo'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'info t foo'"}
|
||||
timeout {fail "(timeout) complete 'info t foo'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'info t foo'" }
|
||||
timeout { fail "(timeout) complete 'info t foo'" }
|
||||
}
|
||||
|
||||
send_gdb "info t\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^info t\\\x07$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "Ambiguous info command \"t\": target, terminal, threads, tp, tracepoints, types\\..
|
||||
*$gdb_prompt $"\
|
||||
{ pass "complete 'info t'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'info t'"}
|
||||
timeout {fail "(timeout) complete 'info t'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'info t'" }
|
||||
timeout { fail "(timeout) complete 'info t'" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "info t \t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^info t \\\x07$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "Ambiguous info command \"t \": target, terminal, threads, tp, tracepoints, types\\..
|
||||
*$gdb_prompt $"\
|
||||
{ pass "complete 'info t '"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'info t '"}
|
||||
timeout {fail "(timeout) complete 'info t '"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'info t '" }
|
||||
timeout { fail "(timeout) complete 'info t '" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "info asdfgh\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^info asdfgh\\\x07$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "Undefined info command: \"asdfgh\". Try \"help info\"\\..
|
||||
*$gdb_prompt $"\
|
||||
{ pass "complete 'info asdfgh'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'info asdfgh'"}
|
||||
timeout {fail "(timeout) complete 'info asdfgh'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'info asdfgh'" }
|
||||
timeout { fail "(timeout) complete 'info asdfgh'" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "info asdfgh \t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^info asdfgh \\\x07$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "Undefined info command: \"asdfgh \". Try \"help info\"\\..
|
||||
*$gdb_prompt $"\
|
||||
{ pass "complete 'info asdfgh '"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'info asdfgh '"}
|
||||
timeout {fail "(timeout) complete 'info asdfgh '"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'info asdfgh '" }
|
||||
timeout { fail "(timeout) complete 'info asdfgh '" }
|
||||
}
|
||||
|
||||
send_gdb "info\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^info $"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "\"info\" must be followed by the name of an info command\\.\r\nList of info subcommands:\r\n\r\ninfo address.*info watchpoints.*\r\n\r\nType \"help info\" followed by info subcommand name for full documentation.\r\nCommand name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
|
||||
{ pass "complete 'info'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'info'"}
|
||||
timeout {fail "(timeout) complete 'info'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'info'" }
|
||||
timeout { fail "(timeout) complete 'info'" }
|
||||
}
|
||||
|
||||
send_gdb "info \t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^info \\\x07$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "\"info\" must be followed by the name of an info command\\.\r\nList of info subcommands:\r\n\r\ninfo address.*Type \"help info\" followed by info subcommand name for full documentation.\r\nCommand name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
|
||||
{ pass "complete 'info '"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'info '"}
|
||||
timeout {fail "(timeout) complete 'info '"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'info '" }
|
||||
timeout { fail "(timeout) complete 'info '" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "info \t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^info \0x7$"\
|
||||
{ send_gdb "\t"
|
||||
gdb_expect {
|
||||
-re "address.*types.*$gdb_prompt info $"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "\"info\".*unambiguous\\..*$gdb_prompt $"\
|
||||
{ pass "complete (2) 'info '"}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'info '"}
|
||||
timeout {fail "(timeout) complete (2) 'info '"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'info '"}
|
||||
timeout {fail "(timeout) complete (2) 'info '"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'info '" }
|
||||
timeout { fail "(timeout) complete (2) 'info '" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "p \"a\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^p \"a\\\x07$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "Unterminated string in expression\\..*$gdb_prompt $"\
|
||||
{ pass "complete 'p a'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'p a'"}
|
||||
timeout {fail "(timeout) complete 'p a'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'p \"a'" }
|
||||
timeout { fail "(timeout) complete 'p \"a'" }
|
||||
}
|
||||
|
||||
send_gdb "p 'a\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^p 'a\\\x07$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "Invalid character constant\\..*$gdb_prompt $"\
|
||||
{ pass "complete 'p \'a'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'p \'a'"}
|
||||
timeout {fail "(timeout) complete 'p \'a'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'p \'a'" }
|
||||
timeout { fail "(timeout) complete 'p \'a'" }
|
||||
}
|
||||
|
||||
send_gdb "p 'a\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^p 'a\\\x07$"\
|
||||
{ send_gdb "\t"
|
||||
gdb_expect {
|
||||
-re "a64l.*atol.*$gdb_prompt p .a$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "Invalid character constant\\..*$gdb_prompt $"\
|
||||
{ pass "complete (2) 'p \'a'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'"}
|
||||
timeout {fail "(timeout) complete (2) 'p \'a'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'"}
|
||||
timeout {fail "(timeout) complete (2) 'p \'a'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'" }
|
||||
timeout { fail "(timeout) complete (2) 'p \'a'" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "p b-a\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^p b-a\\\x07$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "No symbol \"b\" in current context\\..*$gdb_prompt $"\
|
||||
{ pass "complete 'p b-a'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'p b-a'"}
|
||||
timeout {fail "(timeout) complete 'p b-a'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'p b-a'" }
|
||||
timeout { fail "(timeout) complete 'p b-a'" }
|
||||
}
|
||||
|
||||
send_gdb "p b-a\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^p b-a\\\x07$"\
|
||||
{ send_gdb "\t"
|
||||
gdb_expect {
|
||||
-re "a64l.*atol.*$gdb_prompt p b-a$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "No symbol \"b\" in current context\\..*$gdb_prompt $"\
|
||||
{ pass "complete (2) 'p b-a'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p b-a'"}
|
||||
timeout {fail "(timeout) complete (2) 'p b-a'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p b-a'"}
|
||||
timeout {fail "(timeout) complete (2) 'p b-a'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p b-a'" }
|
||||
timeout { fail "(timeout) complete (2) 'p b-a'" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "p b-\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^p b-\\\x07$"\
|
||||
{ send_gdb "\t"
|
||||
gdb_expect {
|
||||
-re "There are $decimal possibilities\\. Do you really\r\nwish to see them all. \\(y or n\\)$"\
|
||||
{ send_gdb "n"
|
||||
gdb_expect {
|
||||
-re "\\(gdb\\) p b-$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "No symbol \"b\" in current context\\..*$gdb_prompt $"\
|
||||
{ pass "complete (2) 'p b-'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p b-'"}
|
||||
timeout {fail "(timeout) complete (2) 'p b-'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p b-'"}
|
||||
timeout {fail "(timeout) complete (2) 'p b-'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p b-'"}
|
||||
timeout {fail "(timeout) complete (2) 'p b-'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete (2) 'p b-'" }
|
||||
timeout { fail "(timeout) complete (2) 'p b-'" }
|
||||
}
|
||||
|
||||
send_gdb "file ${objdir}/Make\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "file ${objdir}/Makefile.*$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "\r\nA program is being debugged already\\. Kill it\\? \\(y or n\\) $"\
|
||||
{ send_gdb "n\n"
|
||||
gdb_expect {
|
||||
-re "\r\nProgram not killed\\.\r\n$gdb_prompt $"\
|
||||
{ pass "complete 'file Make'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'file Make'"}
|
||||
timeout {fail "(timeout) complete 'file Make'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'file Make'"}
|
||||
timeout {fail "(timeout) complete 'file Make'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'file Make'" }
|
||||
timeout { fail "(timeout) complete 'file Make'" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "file ${srcdir}/gdb.base/a1\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^file ${srcdir}/gdb.base/.*'a1.*-selftest\\.exp' $"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "\r\nA program is being debugged already\\. Kill it\\? \\(y or n\\) $"
|
||||
\
|
||||
{ send_gdb "n\n"
|
||||
gdb_expect {
|
||||
-re "\r\nProgram not killed\\.\r\n$gdb_prompt $"\
|
||||
{ pass "complete 'file gdb.base/a1'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'file gdb.base/a1'"}
|
||||
timeout {fail "(timeout) complete 'file gdb.base/a1'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'file gdb.base/a1'"}
|
||||
timeout {fail "(timeout) complete 'file gdb.base/a1'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'file gdb.base/a1'" }
|
||||
timeout { fail "(timeout) complete 'file gdb.base/a1'" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "info func mark\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "^info func mark.*er$"\
|
||||
{ send_gdb "\t\t"
|
||||
sleep 3
|
||||
gdb_expect {
|
||||
-re "marker1 marker2 marker3 marker4.*$gdb_prompt info func marker$"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "All functions matching regular expression \"marker\":\r\n\r\nFile.*break.c:\r\nint marker1\\(\\);\r\nint marker2\\(int\\).*marker3\\(char.*char.*\\);\r\n$gdb_prompt $"\
|
||||
{ pass "complete 'info func mar'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'info func mar'"}
|
||||
timeout {fail "(timeout) complete 'info func mar'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'info func mar'"}
|
||||
timeout {fail "(timeout) complete 'info func mar'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'info func mar'" }
|
||||
timeout { fail "(timeout) complete 'info func mar'" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "set follow-fork-mode \t\t"
|
||||
sleep 1
|
||||
gdb_expect {
|
||||
-re "ask.*child.*parent.*$gdb_prompt set follow-fork-mode $"\
|
||||
{ send_gdb "\n"
|
||||
gdb_expect {
|
||||
-re "Ambiguous item \"\"\\..*$gdb_prompt $"\
|
||||
{ pass "complete 'set follow-fork-mode'"}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'set follow-fork-mode'"}
|
||||
timeout {fail "(timeout) complete 'set follow-fork-mode'"}
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "complete 'set follow-fork-mode'" }
|
||||
timeout { fail "(timeout) complete 'set follow-fork-mode'" }
|
||||
}
|
||||
|
||||
set timeout $oldtimeout1
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
122
gdb/testsuite/gdb.base/cond-expr.exp
Normal file
122
gdb/testsuite/gdb.base/cond-expr.exp
Normal file
@@ -0,0 +1,122 @@
|
||||
# Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# This file was written by Elena Zannoni (ezannoni@cygnus.com)
|
||||
|
||||
# This file is part of the gdb testsuite
|
||||
|
||||
#
|
||||
# test of evaluation of conditional expressions, with constants and
|
||||
# variables. Using the print and the whatis command
|
||||
# written with the only purpose in mind to cover the holes in the
|
||||
# eval.c file
|
||||
#
|
||||
# source file "int-type.c"
|
||||
#
|
||||
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
# Check to see if we have an executable to test. If not, then either we
|
||||
# haven't tried to compile one, or the compilation failed for some reason.
|
||||
# In either case, just notify the user and skip the tests in this file.
|
||||
|
||||
set testfile "int-type"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
|
||||
if ![runto_main] then {
|
||||
perror "couldn't run to breakpoint"
|
||||
continue
|
||||
}
|
||||
|
||||
send_gdb "print (2 ? 3 : 4)\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 3.*$gdb_prompt $" {
|
||||
pass "print value of cond expr (const true)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of cond expr (const true)" }
|
||||
timeout { fail "(timeout) print value of cond expr (const true)" }
|
||||
}
|
||||
|
||||
send_gdb "print (0 ? 3 : 4)\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 4.*$gdb_prompt $" {
|
||||
pass "print value of cond expr (const false)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of cond expr (const false)" }
|
||||
timeout { fail "(timeout) print value of cond expr (const false)" }
|
||||
}
|
||||
|
||||
gdb_test "set variable x=14" "" "set variable x=14"
|
||||
gdb_test "set variable y=2" "" "set variable y=2"
|
||||
gdb_test "set variable z=3" "" "set variable z=3"
|
||||
|
||||
send_gdb "print (x ? y : z)\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 2.*$gdb_prompt $" {
|
||||
pass "print value of cond expr (var true)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of cond expr (var true)" }
|
||||
timeout { fail "(timeout) print value of cond expr (var true)" }
|
||||
}
|
||||
|
||||
gdb_test "set variable x=0" "" "set variable x=0"
|
||||
|
||||
send_gdb "print (x ? y : z)\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 3.*$gdb_prompt $" {
|
||||
pass "print value of cond expr (var false)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of cond expr (var false)" }
|
||||
timeout { fail "(timeout) print value of cond expr (var false)" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "whatis (0 ? 3 : 4)\n"
|
||||
gdb_expect {
|
||||
-re "type = int.*$gdb_prompt $" {
|
||||
pass "print whatis of cond expr"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print whatis of cond expr" }
|
||||
timeout { fail "(timeout) print whatis of cond expr" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
81
gdb/testsuite/gdb.base/condbreak.c
Normal file
81
gdb/testsuite/gdb.base/condbreak.c
Normal file
@@ -0,0 +1,81 @@
|
||||
#ifdef vxworks
|
||||
|
||||
# include <stdio.h>
|
||||
|
||||
/* VxWorks does not supply atoi. */
|
||||
static int
|
||||
atoi (z)
|
||||
char *z;
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
while (*z >= '0' && *z <= '9')
|
||||
i = i * 10 + (*z++ - '0');
|
||||
return i;
|
||||
}
|
||||
|
||||
/* I don't know of any way to pass an array to VxWorks. This function
|
||||
can be called directly from gdb. */
|
||||
|
||||
vxmain (arg)
|
||||
char *arg;
|
||||
{
|
||||
char *argv[2];
|
||||
|
||||
argv[0] = "";
|
||||
argv[1] = arg;
|
||||
main (2, argv, (char **) 0);
|
||||
}
|
||||
|
||||
#else /* ! vxworks */
|
||||
# include <stdio.h>
|
||||
#endif /* ! vxworks */
|
||||
|
||||
/*
|
||||
* The following functions do nothing useful. They are included simply
|
||||
* as places to try setting breakpoints at. They are explicitly
|
||||
* "one-line functions" to verify that this case works (some versions
|
||||
* of gcc have or have had problems with this).
|
||||
*/
|
||||
|
||||
int marker1 () { return (0); }
|
||||
int marker2 (a) int a; { return (1); }
|
||||
void marker3 (a, b) char *a, *b; {}
|
||||
void marker4 (d) long d; {}
|
||||
|
||||
/*
|
||||
* This simple classical example of recursion is useful for
|
||||
* testing stack backtraces and such.
|
||||
*/
|
||||
|
||||
int
|
||||
main (argc, argv, envp)
|
||||
int argc;
|
||||
char *argv[], **envp;
|
||||
{
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
breakpoint();
|
||||
#endif
|
||||
if (argc == 123456) {
|
||||
fprintf (stderr, "usage: factorial <number>\n");
|
||||
return 1;
|
||||
}
|
||||
printf ("%d\n", factorial (atoi ("6")));
|
||||
|
||||
marker1 ();
|
||||
marker2 (43);
|
||||
marker3 ("stack", "trace");
|
||||
marker4 (177601976L);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int factorial (value)
|
||||
int value;
|
||||
{
|
||||
if (value > 1) {
|
||||
value *= factorial (value - 1);
|
||||
}
|
||||
return (value);
|
||||
}
|
||||
|
||||
157
gdb/testsuite/gdb.base/condbreak.exp
Normal file
157
gdb/testsuite/gdb.base/condbreak.exp
Normal file
@@ -0,0 +1,157 @@
|
||||
# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# This test was written by Rich Title.
|
||||
# Purpose is to test conditional breakpoints.
|
||||
# Modeled after "break.exp".
|
||||
|
||||
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
global usestubs
|
||||
|
||||
#
|
||||
# test running programs
|
||||
#
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile "condbreak"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
|
||||
if [target_info exists gdb_stub] {
|
||||
gdb_step_for_stub;
|
||||
}
|
||||
|
||||
#
|
||||
# test break at function
|
||||
#
|
||||
gdb_test "break main" \
|
||||
"Breakpoint.*at.* file .*$srcfile, line.*" \
|
||||
"breakpoint function"
|
||||
|
||||
#
|
||||
# test conditional break at function
|
||||
#
|
||||
gdb_test "break marker1 if 1==1" \
|
||||
"Breakpoint.*at.* file .*$srcfile, line.*" \
|
||||
"break function if condition"
|
||||
|
||||
gdb_test "delete 2" \
|
||||
"" \
|
||||
"delete break"
|
||||
|
||||
#
|
||||
# test conditional break at line number
|
||||
#
|
||||
gdb_test "break 64 if 1==1" \
|
||||
"Breakpoint.*at.* file .*$srcfile, line 64\\." \
|
||||
"break line if condition"
|
||||
|
||||
gdb_test "delete 3" \
|
||||
"" \
|
||||
"delete break"
|
||||
|
||||
#
|
||||
# test conditional break at function
|
||||
#
|
||||
gdb_test "break marker1 if (1==1)" \
|
||||
"Breakpoint.*at.* file .*$srcfile, line.*" \
|
||||
"break function if (condition)"
|
||||
|
||||
#
|
||||
# test conditional break at line number
|
||||
#
|
||||
gdb_test "break 64 if (1==1)" \
|
||||
"Breakpoint.*at.* file .*$srcfile, line 64\\." \
|
||||
"break line if (condition)"
|
||||
|
||||
gdb_test "break marker2 if (a==43)" \
|
||||
"Breakpoint.*at.* file .*$srcfile, line.*" \
|
||||
"break function if (condition)"
|
||||
|
||||
#
|
||||
# check to see what breakpoints are set
|
||||
#
|
||||
|
||||
set main_line 60
|
||||
gdb_test "info break" \
|
||||
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$main_line.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in marker1 at .*$srcfile:41.*
|
||||
\[\t \]+stop only if 1 == 1.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:64.*
|
||||
\[\t \]+stop only if 1 == 1.*
|
||||
\[0-9\]+\[\t \]+breakpoint keep y.* in marker2 at .*$srcfile:42.*
|
||||
\[\t \]+stop only if a == 43.*" \
|
||||
"breakpoint info"
|
||||
|
||||
|
||||
#
|
||||
# run until the breakpoint at main is hit. For non-stubs-using targets.
|
||||
#
|
||||
gdb_test "run" \
|
||||
"Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:60.*60\[\t \]+if .argc.* \{.*" \
|
||||
"run until function breakpoint"
|
||||
|
||||
#
|
||||
# run until the breakpoint at a line number
|
||||
#
|
||||
gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:64.*64\[\t \]+printf.*factorial.*" \
|
||||
"run until breakpoint set at a line number"
|
||||
|
||||
#
|
||||
# run until the breakpoint at marker1
|
||||
#
|
||||
gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, marker1 \\(\\) at .*$srcfile:41.*41\[\t \]+.*" \
|
||||
"run until breakpoint at marker1"
|
||||
|
||||
#
|
||||
# run until the breakpoint at marker2
|
||||
#
|
||||
gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, marker2 \\(a=43\\) at .*$srcfile:42.*42\[\t \]+.*" \
|
||||
"run until breakpoint at marker2"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
899
gdb/testsuite/gdb.base/configure
vendored
Normal file
899
gdb/testsuite/gdb.base/configure
vendored
Normal file
@@ -0,0 +1,899 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated automatically using autoconf version 2.12.1
|
||||
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
#
|
||||
# This configure script is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy, distribute and modify it.
|
||||
|
||||
# Defaults:
|
||||
ac_help=
|
||||
ac_default_prefix=/usr/local
|
||||
# Any additions from configure.in:
|
||||
|
||||
# Initialize some variables set by options.
|
||||
# The variables have the same names as the options, with
|
||||
# dashes changed to underlines.
|
||||
build=NONE
|
||||
cache_file=./config.cache
|
||||
exec_prefix=NONE
|
||||
host=NONE
|
||||
no_create=
|
||||
nonopt=NONE
|
||||
no_recursion=
|
||||
prefix=NONE
|
||||
program_prefix=NONE
|
||||
program_suffix=NONE
|
||||
program_transform_name=s,x,x,
|
||||
silent=
|
||||
site=
|
||||
srcdir=
|
||||
target=NONE
|
||||
verbose=
|
||||
x_includes=NONE
|
||||
x_libraries=NONE
|
||||
bindir='${exec_prefix}/bin'
|
||||
sbindir='${exec_prefix}/sbin'
|
||||
libexecdir='${exec_prefix}/libexec'
|
||||
datadir='${prefix}/share'
|
||||
sysconfdir='${prefix}/etc'
|
||||
sharedstatedir='${prefix}/com'
|
||||
localstatedir='${prefix}/var'
|
||||
libdir='${exec_prefix}/lib'
|
||||
includedir='${prefix}/include'
|
||||
oldincludedir='/usr/include'
|
||||
infodir='${prefix}/info'
|
||||
mandir='${prefix}/man'
|
||||
|
||||
# Initialize some other variables.
|
||||
subdirs=
|
||||
MFLAGS= MAKEFLAGS=
|
||||
SHELL=${CONFIG_SHELL-/bin/sh}
|
||||
# Maximum number of lines to put in a shell here document.
|
||||
ac_max_here_lines=12
|
||||
|
||||
ac_prev=
|
||||
for ac_option
|
||||
do
|
||||
|
||||
# If the previous option needs an argument, assign it.
|
||||
if test -n "$ac_prev"; then
|
||||
eval "$ac_prev=\$ac_option"
|
||||
ac_prev=
|
||||
continue
|
||||
fi
|
||||
|
||||
case "$ac_option" in
|
||||
-*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||
*) ac_optarg= ;;
|
||||
esac
|
||||
|
||||
# Accept the important Cygnus configure options, so we can diagnose typos.
|
||||
|
||||
case "$ac_option" in
|
||||
|
||||
-bindir | --bindir | --bindi | --bind | --bin | --bi)
|
||||
ac_prev=bindir ;;
|
||||
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
|
||||
bindir="$ac_optarg" ;;
|
||||
|
||||
-build | --build | --buil | --bui | --bu)
|
||||
ac_prev=build ;;
|
||||
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
|
||||
build="$ac_optarg" ;;
|
||||
|
||||
-cache-file | --cache-file | --cache-fil | --cache-fi \
|
||||
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
|
||||
ac_prev=cache_file ;;
|
||||
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
|
||||
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
|
||||
cache_file="$ac_optarg" ;;
|
||||
|
||||
-datadir | --datadir | --datadi | --datad | --data | --dat | --da)
|
||||
ac_prev=datadir ;;
|
||||
-datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
|
||||
| --da=*)
|
||||
datadir="$ac_optarg" ;;
|
||||
|
||||
-disable-* | --disable-*)
|
||||
ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
|
||||
# Reject names that are not valid shell variable names.
|
||||
if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
|
||||
{ echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
|
||||
fi
|
||||
ac_feature=`echo $ac_feature| sed 's/-/_/g'`
|
||||
eval "enable_${ac_feature}=no" ;;
|
||||
|
||||
-enable-* | --enable-*)
|
||||
ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
|
||||
# Reject names that are not valid shell variable names.
|
||||
if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
|
||||
{ echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
|
||||
fi
|
||||
ac_feature=`echo $ac_feature| sed 's/-/_/g'`
|
||||
case "$ac_option" in
|
||||
*=*) ;;
|
||||
*) ac_optarg=yes ;;
|
||||
esac
|
||||
eval "enable_${ac_feature}='$ac_optarg'" ;;
|
||||
|
||||
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
|
||||
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
|
||||
| --exec | --exe | --ex)
|
||||
ac_prev=exec_prefix ;;
|
||||
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
|
||||
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
|
||||
| --exec=* | --exe=* | --ex=*)
|
||||
exec_prefix="$ac_optarg" ;;
|
||||
|
||||
-gas | --gas | --ga | --g)
|
||||
# Obsolete; use --with-gas.
|
||||
with_gas=yes ;;
|
||||
|
||||
-help | --help | --hel | --he)
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat << EOF
|
||||
Usage: configure [options] [host]
|
||||
Options: [defaults in brackets after descriptions]
|
||||
Configuration:
|
||||
--cache-file=FILE cache test results in FILE
|
||||
--help print this message
|
||||
--no-create do not create output files
|
||||
--quiet, --silent do not print \`checking...' messages
|
||||
--version print the version of autoconf that created configure
|
||||
Directory and file names:
|
||||
--prefix=PREFIX install architecture-independent files in PREFIX
|
||||
[$ac_default_prefix]
|
||||
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
|
||||
[same as prefix]
|
||||
--bindir=DIR user executables in DIR [EPREFIX/bin]
|
||||
--sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
|
||||
--libexecdir=DIR program executables in DIR [EPREFIX/libexec]
|
||||
--datadir=DIR read-only architecture-independent data in DIR
|
||||
[PREFIX/share]
|
||||
--sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
|
||||
--sharedstatedir=DIR modifiable architecture-independent data in DIR
|
||||
[PREFIX/com]
|
||||
--localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
|
||||
--libdir=DIR object code libraries in DIR [EPREFIX/lib]
|
||||
--includedir=DIR C header files in DIR [PREFIX/include]
|
||||
--oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
|
||||
--infodir=DIR info documentation in DIR [PREFIX/info]
|
||||
--mandir=DIR man documentation in DIR [PREFIX/man]
|
||||
--srcdir=DIR find the sources in DIR [configure dir or ..]
|
||||
--program-prefix=PREFIX prepend PREFIX to installed program names
|
||||
--program-suffix=SUFFIX append SUFFIX to installed program names
|
||||
--program-transform-name=PROGRAM
|
||||
run sed PROGRAM on installed program names
|
||||
EOF
|
||||
cat << EOF
|
||||
Host type:
|
||||
--build=BUILD configure for building on BUILD [BUILD=HOST]
|
||||
--host=HOST configure for HOST [guessed]
|
||||
--target=TARGET configure for TARGET [TARGET=HOST]
|
||||
Features and packages:
|
||||
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
|
||||
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
|
||||
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
||||
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
|
||||
--x-includes=DIR X include files are in DIR
|
||||
--x-libraries=DIR X library files are in DIR
|
||||
EOF
|
||||
if test -n "$ac_help"; then
|
||||
echo "--enable and --with options recognized:$ac_help"
|
||||
fi
|
||||
exit 0 ;;
|
||||
|
||||
-host | --host | --hos | --ho)
|
||||
ac_prev=host ;;
|
||||
-host=* | --host=* | --hos=* | --ho=*)
|
||||
host="$ac_optarg" ;;
|
||||
|
||||
-includedir | --includedir | --includedi | --included | --include \
|
||||
| --includ | --inclu | --incl | --inc)
|
||||
ac_prev=includedir ;;
|
||||
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
|
||||
| --includ=* | --inclu=* | --incl=* | --inc=*)
|
||||
includedir="$ac_optarg" ;;
|
||||
|
||||
-infodir | --infodir | --infodi | --infod | --info | --inf)
|
||||
ac_prev=infodir ;;
|
||||
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
|
||||
infodir="$ac_optarg" ;;
|
||||
|
||||
-libdir | --libdir | --libdi | --libd)
|
||||
ac_prev=libdir ;;
|
||||
-libdir=* | --libdir=* | --libdi=* | --libd=*)
|
||||
libdir="$ac_optarg" ;;
|
||||
|
||||
-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
|
||||
| --libexe | --libex | --libe)
|
||||
ac_prev=libexecdir ;;
|
||||
-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
|
||||
| --libexe=* | --libex=* | --libe=*)
|
||||
libexecdir="$ac_optarg" ;;
|
||||
|
||||
-localstatedir | --localstatedir | --localstatedi | --localstated \
|
||||
| --localstate | --localstat | --localsta | --localst \
|
||||
| --locals | --local | --loca | --loc | --lo)
|
||||
ac_prev=localstatedir ;;
|
||||
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
|
||||
| --localstate=* | --localstat=* | --localsta=* | --localst=* \
|
||||
| --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
|
||||
localstatedir="$ac_optarg" ;;
|
||||
|
||||
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
|
||||
ac_prev=mandir ;;
|
||||
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
|
||||
mandir="$ac_optarg" ;;
|
||||
|
||||
-nfp | --nfp | --nf)
|
||||
# Obsolete; use --without-fp.
|
||||
with_fp=no ;;
|
||||
|
||||
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
|
||||
| --no-cr | --no-c)
|
||||
no_create=yes ;;
|
||||
|
||||
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
|
||||
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
|
||||
no_recursion=yes ;;
|
||||
|
||||
-oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
|
||||
| --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
|
||||
| --oldin | --oldi | --old | --ol | --o)
|
||||
ac_prev=oldincludedir ;;
|
||||
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
|
||||
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
|
||||
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
|
||||
oldincludedir="$ac_optarg" ;;
|
||||
|
||||
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
|
||||
ac_prev=prefix ;;
|
||||
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
|
||||
prefix="$ac_optarg" ;;
|
||||
|
||||
-program-prefix | --program-prefix | --program-prefi | --program-pref \
|
||||
| --program-pre | --program-pr | --program-p)
|
||||
ac_prev=program_prefix ;;
|
||||
-program-prefix=* | --program-prefix=* | --program-prefi=* \
|
||||
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
|
||||
program_prefix="$ac_optarg" ;;
|
||||
|
||||
-program-suffix | --program-suffix | --program-suffi | --program-suff \
|
||||
| --program-suf | --program-su | --program-s)
|
||||
ac_prev=program_suffix ;;
|
||||
-program-suffix=* | --program-suffix=* | --program-suffi=* \
|
||||
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
|
||||
program_suffix="$ac_optarg" ;;
|
||||
|
||||
-program-transform-name | --program-transform-name \
|
||||
| --program-transform-nam | --program-transform-na \
|
||||
| --program-transform-n | --program-transform- \
|
||||
| --program-transform | --program-transfor \
|
||||
| --program-transfo | --program-transf \
|
||||
| --program-trans | --program-tran \
|
||||
| --progr-tra | --program-tr | --program-t)
|
||||
ac_prev=program_transform_name ;;
|
||||
-program-transform-name=* | --program-transform-name=* \
|
||||
| --program-transform-nam=* | --program-transform-na=* \
|
||||
| --program-transform-n=* | --program-transform-=* \
|
||||
| --program-transform=* | --program-transfor=* \
|
||||
| --program-transfo=* | --program-transf=* \
|
||||
| --program-trans=* | --program-tran=* \
|
||||
| --progr-tra=* | --program-tr=* | --program-t=*)
|
||||
program_transform_name="$ac_optarg" ;;
|
||||
|
||||
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
|
||||
| -silent | --silent | --silen | --sile | --sil)
|
||||
silent=yes ;;
|
||||
|
||||
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
||||
ac_prev=sbindir ;;
|
||||
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
||||
| --sbi=* | --sb=*)
|
||||
sbindir="$ac_optarg" ;;
|
||||
|
||||
-sharedstatedir | --sharedstatedir | --sharedstatedi \
|
||||
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
|
||||
| --sharedst | --shareds | --shared | --share | --shar \
|
||||
| --sha | --sh)
|
||||
ac_prev=sharedstatedir ;;
|
||||
-sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
|
||||
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
|
||||
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
|
||||
| --sha=* | --sh=*)
|
||||
sharedstatedir="$ac_optarg" ;;
|
||||
|
||||
-site | --site | --sit)
|
||||
ac_prev=site ;;
|
||||
-site=* | --site=* | --sit=*)
|
||||
site="$ac_optarg" ;;
|
||||
|
||||
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
|
||||
ac_prev=srcdir ;;
|
||||
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
|
||||
srcdir="$ac_optarg" ;;
|
||||
|
||||
-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
|
||||
| --syscon | --sysco | --sysc | --sys | --sy)
|
||||
ac_prev=sysconfdir ;;
|
||||
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
|
||||
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
|
||||
sysconfdir="$ac_optarg" ;;
|
||||
|
||||
-target | --target | --targe | --targ | --tar | --ta | --t)
|
||||
ac_prev=target ;;
|
||||
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
|
||||
target="$ac_optarg" ;;
|
||||
|
||||
-v | -verbose | --verbose | --verbos | --verbo | --verb)
|
||||
verbose=yes ;;
|
||||
|
||||
-version | --version | --versio | --versi | --vers)
|
||||
echo "configure generated by autoconf version 2.12.1"
|
||||
exit 0 ;;
|
||||
|
||||
-with-* | --with-*)
|
||||
ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
|
||||
# Reject names that are not valid shell variable names.
|
||||
if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
|
||||
{ echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
|
||||
fi
|
||||
ac_package=`echo $ac_package| sed 's/-/_/g'`
|
||||
case "$ac_option" in
|
||||
*=*) ;;
|
||||
*) ac_optarg=yes ;;
|
||||
esac
|
||||
eval "with_${ac_package}='$ac_optarg'" ;;
|
||||
|
||||
-without-* | --without-*)
|
||||
ac_package=`echo $ac_option|sed -e 's/-*without-//'`
|
||||
# Reject names that are not valid shell variable names.
|
||||
if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
|
||||
{ echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
|
||||
fi
|
||||
ac_package=`echo $ac_package| sed 's/-/_/g'`
|
||||
eval "with_${ac_package}=no" ;;
|
||||
|
||||
--x)
|
||||
# Obsolete; use --with-x.
|
||||
with_x=yes ;;
|
||||
|
||||
-x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
|
||||
| --x-incl | --x-inc | --x-in | --x-i)
|
||||
ac_prev=x_includes ;;
|
||||
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
|
||||
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
|
||||
x_includes="$ac_optarg" ;;
|
||||
|
||||
-x-libraries | --x-libraries | --x-librarie | --x-librari \
|
||||
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
|
||||
ac_prev=x_libraries ;;
|
||||
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
|
||||
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
|
||||
x_libraries="$ac_optarg" ;;
|
||||
|
||||
-*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
|
||||
;;
|
||||
|
||||
*)
|
||||
if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
|
||||
echo "configure: warning: $ac_option: invalid host type" 1>&2
|
||||
fi
|
||||
if test "x$nonopt" != xNONE; then
|
||||
{ echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
|
||||
fi
|
||||
nonopt="$ac_option"
|
||||
;;
|
||||
|
||||
esac
|
||||
done
|
||||
|
||||
if test -n "$ac_prev"; then
|
||||
{ echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
|
||||
fi
|
||||
|
||||
trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
|
||||
|
||||
# File descriptor usage:
|
||||
# 0 standard input
|
||||
# 1 file creation
|
||||
# 2 errors and warnings
|
||||
# 3 some systems may open it to /dev/tty
|
||||
# 4 used on the Kubota Titan
|
||||
# 6 checking for... messages and results
|
||||
# 5 compiler messages saved in config.log
|
||||
if test "$silent" = yes; then
|
||||
exec 6>/dev/null
|
||||
else
|
||||
exec 6>&1
|
||||
fi
|
||||
exec 5>./config.log
|
||||
|
||||
echo "\
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
" 1>&5
|
||||
|
||||
# Strip out --no-create and --no-recursion so they do not pile up.
|
||||
# Also quote any args containing shell metacharacters.
|
||||
ac_configure_args=
|
||||
for ac_arg
|
||||
do
|
||||
case "$ac_arg" in
|
||||
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
|
||||
| --no-cr | --no-c) ;;
|
||||
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
|
||||
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
|
||||
*" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
|
||||
ac_configure_args="$ac_configure_args '$ac_arg'" ;;
|
||||
*) ac_configure_args="$ac_configure_args $ac_arg" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# NLS nuisances.
|
||||
# Only set these to C if already set. These must not be set unconditionally
|
||||
# because not all systems understand e.g. LANG=C (notably SCO).
|
||||
# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
|
||||
# Non-C LC_CTYPE values break the ctype check.
|
||||
if test "${LANG+set}" = set; then LANG=C; export LANG; fi
|
||||
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
|
||||
if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
|
||||
if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
|
||||
|
||||
# confdefs.h avoids OS command line length limits that DEFS can exceed.
|
||||
rm -rf conftest* confdefs.h
|
||||
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
|
||||
echo > confdefs.h
|
||||
|
||||
# A filename unique to this package, relative to the directory that
|
||||
# configure is in, which we can look for to find out if srcdir is correct.
|
||||
ac_unique_file=a1-selftest.exp
|
||||
|
||||
# Find the source files, if location was not specified.
|
||||
if test -z "$srcdir"; then
|
||||
ac_srcdir_defaulted=yes
|
||||
# Try the directory containing this script, then its parent.
|
||||
ac_prog=$0
|
||||
ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
|
||||
test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
|
||||
srcdir=$ac_confdir
|
||||
if test ! -r $srcdir/$ac_unique_file; then
|
||||
srcdir=..
|
||||
fi
|
||||
else
|
||||
ac_srcdir_defaulted=no
|
||||
fi
|
||||
if test ! -r $srcdir/$ac_unique_file; then
|
||||
if test "$ac_srcdir_defaulted" = yes; then
|
||||
{ echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
|
||||
else
|
||||
{ echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
|
||||
fi
|
||||
fi
|
||||
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
|
||||
|
||||
# Prefer explicitly selected file to automatically selected ones.
|
||||
if test -z "$CONFIG_SITE"; then
|
||||
if test "x$prefix" != xNONE; then
|
||||
CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
|
||||
else
|
||||
CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
|
||||
fi
|
||||
fi
|
||||
for ac_site_file in $CONFIG_SITE; do
|
||||
if test -r "$ac_site_file"; then
|
||||
echo "loading site script $ac_site_file"
|
||||
. "$ac_site_file"
|
||||
fi
|
||||
done
|
||||
|
||||
if test -r "$cache_file"; then
|
||||
echo "loading cache $cache_file"
|
||||
. $cache_file
|
||||
else
|
||||
echo "creating cache $cache_file"
|
||||
> $cache_file
|
||||
fi
|
||||
|
||||
ac_ext=c
|
||||
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
|
||||
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
|
||||
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
|
||||
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
|
||||
ac_n= ac_c='
|
||||
' ac_t=' '
|
||||
else
|
||||
ac_n=-n ac_c= ac_t=
|
||||
fi
|
||||
else
|
||||
ac_n= ac_c='\c' ac_t=
|
||||
fi
|
||||
|
||||
|
||||
|
||||
CC=${CC-cc}
|
||||
|
||||
ac_aux_dir=
|
||||
for ac_dir in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../..; do
|
||||
if test -f $ac_dir/install-sh; then
|
||||
ac_aux_dir=$ac_dir
|
||||
ac_install_sh="$ac_aux_dir/install-sh -c"
|
||||
break
|
||||
elif test -f $ac_dir/install.sh; then
|
||||
ac_aux_dir=$ac_dir
|
||||
ac_install_sh="$ac_aux_dir/install.sh -c"
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$ac_aux_dir"; then
|
||||
{ echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../.." 1>&2; exit 1; }
|
||||
fi
|
||||
ac_config_guess=$ac_aux_dir/config.guess
|
||||
ac_config_sub=$ac_aux_dir/config.sub
|
||||
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
|
||||
|
||||
|
||||
# Do some error checking and defaulting for the host and target type.
|
||||
# The inputs are:
|
||||
# configure --host=HOST --target=TARGET --build=BUILD NONOPT
|
||||
#
|
||||
# The rules are:
|
||||
# 1. You are not allowed to specify --host, --target, and nonopt at the
|
||||
# same time.
|
||||
# 2. Host defaults to nonopt.
|
||||
# 3. If nonopt is not specified, then host defaults to the current host,
|
||||
# as determined by config.guess.
|
||||
# 4. Target and build default to nonopt.
|
||||
# 5. If nonopt is not specified, then target and build default to host.
|
||||
|
||||
# The aliases save the names the user supplied, while $host etc.
|
||||
# will get canonicalized.
|
||||
case $host---$target---$nonopt in
|
||||
NONE---*---* | *---NONE---* | *---*---NONE) ;;
|
||||
*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
|
||||
esac
|
||||
|
||||
|
||||
# Make sure we can run config.sub.
|
||||
if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
|
||||
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
|
||||
fi
|
||||
|
||||
echo $ac_n "checking host system type""... $ac_c" 1>&6
|
||||
echo "configure:573: checking host system type" >&5
|
||||
|
||||
host_alias=$host
|
||||
case "$host_alias" in
|
||||
NONE)
|
||||
case $nonopt in
|
||||
NONE)
|
||||
if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
|
||||
else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
|
||||
fi ;;
|
||||
*) host_alias=$nonopt ;;
|
||||
esac ;;
|
||||
esac
|
||||
|
||||
host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
|
||||
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
|
||||
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
echo "$ac_t""$host" 1>&6
|
||||
|
||||
echo $ac_n "checking target system type""... $ac_c" 1>&6
|
||||
echo "configure:594: checking target system type" >&5
|
||||
|
||||
target_alias=$target
|
||||
case "$target_alias" in
|
||||
NONE)
|
||||
case $nonopt in
|
||||
NONE) target_alias=$host_alias ;;
|
||||
*) target_alias=$nonopt ;;
|
||||
esac ;;
|
||||
esac
|
||||
|
||||
target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
|
||||
target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
|
||||
target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||
target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
echo "$ac_t""$target" 1>&6
|
||||
|
||||
echo $ac_n "checking build system type""... $ac_c" 1>&6
|
||||
echo "configure:612: checking build system type" >&5
|
||||
|
||||
build_alias=$build
|
||||
case "$build_alias" in
|
||||
NONE)
|
||||
case $nonopt in
|
||||
NONE) build_alias=$host_alias ;;
|
||||
*) build_alias=$nonopt ;;
|
||||
esac ;;
|
||||
esac
|
||||
|
||||
build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
|
||||
build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
|
||||
build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||
build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
echo "$ac_t""$build" 1>&6
|
||||
|
||||
test "$host_alias" != "$target_alias" &&
|
||||
test "$program_prefix$program_suffix$program_transform_name" = \
|
||||
NONENONEs,x,x, &&
|
||||
program_prefix=${target_alias}-
|
||||
|
||||
|
||||
trap '' 1 2 15
|
||||
cat > confcache <<\EOF
|
||||
# This file is a shell script that caches the results of configure
|
||||
# tests run on this system so they can be shared between configure
|
||||
# scripts and configure runs. It is not useful on other systems.
|
||||
# If it contains results you don't want to keep, you may remove or edit it.
|
||||
#
|
||||
# By default, configure uses ./config.cache as the cache file,
|
||||
# creating it if it does not exist already. You can give configure
|
||||
# the --cache-file=FILE option to use a different cache file; that is
|
||||
# what configure does when it calls configure scripts in
|
||||
# subdirectories, so they share the cache.
|
||||
# Giving --cache-file=/dev/null disables caching, for debugging configure.
|
||||
# config.status only pays attention to the cache file if you give it the
|
||||
# --recheck option to rerun configure.
|
||||
#
|
||||
EOF
|
||||
# The following way of writing the cache mishandles newlines in values,
|
||||
# but we know of no workaround that is simple, portable, and efficient.
|
||||
# So, don't put newlines in cache variables' values.
|
||||
# Ultrix sh set writes to stderr and can't be redirected directly,
|
||||
# and sets the high bit in the cache file unless we assign to the vars.
|
||||
(set) 2>&1 |
|
||||
case `(ac_space=' '; set) 2>&1 | grep ac_space` in
|
||||
*ac_space=\ *)
|
||||
# `set' does not quote correctly, so add quotes (double-quote substitution
|
||||
# turns \\\\ into \\, and sed turns \\ into \).
|
||||
sed -n \
|
||||
-e "s/'/'\\\\''/g" \
|
||||
-e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
|
||||
;;
|
||||
*)
|
||||
# `set' quotes correctly as required by POSIX, so do not add quotes.
|
||||
sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
|
||||
;;
|
||||
esac >> confcache
|
||||
if cmp -s $cache_file confcache; then
|
||||
:
|
||||
else
|
||||
if test -w $cache_file; then
|
||||
echo "updating cache $cache_file"
|
||||
cat confcache > $cache_file
|
||||
else
|
||||
echo "not updating unwritable cache $cache_file"
|
||||
fi
|
||||
fi
|
||||
rm -f confcache
|
||||
|
||||
trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
|
||||
|
||||
test "x$prefix" = xNONE && prefix=$ac_default_prefix
|
||||
# Let make expand exec_prefix.
|
||||
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
|
||||
|
||||
# Any assignment to VPATH causes Sun make to only execute
|
||||
# the first set of double-colon rules, so remove it if not needed.
|
||||
# If there is a colon in the path, we need to keep it.
|
||||
if test "x$srcdir" = x.; then
|
||||
ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
|
||||
fi
|
||||
|
||||
trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
|
||||
|
||||
# Transform confdefs.h into DEFS.
|
||||
# Protect against shell expansion while executing Makefile rules.
|
||||
# Protect against Makefile macro expansion.
|
||||
cat > conftest.defs <<\EOF
|
||||
s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
|
||||
s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
|
||||
s%\[%\\&%g
|
||||
s%\]%\\&%g
|
||||
s%\$%$$%g
|
||||
EOF
|
||||
DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
|
||||
rm -f conftest.defs
|
||||
|
||||
|
||||
# Without the "./", some shells look in PATH for config.status.
|
||||
: ${CONFIG_STATUS=./config.status}
|
||||
|
||||
echo creating $CONFIG_STATUS
|
||||
rm -f $CONFIG_STATUS
|
||||
cat > $CONFIG_STATUS <<EOF
|
||||
#! /bin/sh
|
||||
# Generated automatically by configure.
|
||||
# Run this file to recreate the current configuration.
|
||||
# This directory was configured as follows,
|
||||
# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
|
||||
#
|
||||
# $0 $ac_configure_args
|
||||
#
|
||||
# Compiler output produced by configure, useful for debugging
|
||||
# configure, is in ./config.log if it exists.
|
||||
|
||||
ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
|
||||
for ac_option
|
||||
do
|
||||
case "\$ac_option" in
|
||||
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
|
||||
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
|
||||
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
|
||||
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
|
||||
echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
|
||||
exit 0 ;;
|
||||
-help | --help | --hel | --he | --h)
|
||||
echo "\$ac_cs_usage"; exit 0 ;;
|
||||
*) echo "\$ac_cs_usage"; exit 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
ac_given_srcdir=$srcdir
|
||||
|
||||
trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
|
||||
EOF
|
||||
cat >> $CONFIG_STATUS <<EOF
|
||||
|
||||
# Protect against being on the right side of a sed subst in config.status.
|
||||
sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
|
||||
s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
|
||||
$ac_vpsub
|
||||
$extrasub
|
||||
s%@SHELL@%$SHELL%g
|
||||
s%@CFLAGS@%$CFLAGS%g
|
||||
s%@CPPFLAGS@%$CPPFLAGS%g
|
||||
s%@CXXFLAGS@%$CXXFLAGS%g
|
||||
s%@DEFS@%$DEFS%g
|
||||
s%@LDFLAGS@%$LDFLAGS%g
|
||||
s%@LIBS@%$LIBS%g
|
||||
s%@exec_prefix@%$exec_prefix%g
|
||||
s%@prefix@%$prefix%g
|
||||
s%@program_transform_name@%$program_transform_name%g
|
||||
s%@bindir@%$bindir%g
|
||||
s%@sbindir@%$sbindir%g
|
||||
s%@libexecdir@%$libexecdir%g
|
||||
s%@datadir@%$datadir%g
|
||||
s%@sysconfdir@%$sysconfdir%g
|
||||
s%@sharedstatedir@%$sharedstatedir%g
|
||||
s%@localstatedir@%$localstatedir%g
|
||||
s%@libdir@%$libdir%g
|
||||
s%@includedir@%$includedir%g
|
||||
s%@oldincludedir@%$oldincludedir%g
|
||||
s%@infodir@%$infodir%g
|
||||
s%@mandir@%$mandir%g
|
||||
s%@CC@%$CC%g
|
||||
s%@host@%$host%g
|
||||
s%@host_alias@%$host_alias%g
|
||||
s%@host_cpu@%$host_cpu%g
|
||||
s%@host_vendor@%$host_vendor%g
|
||||
s%@host_os@%$host_os%g
|
||||
s%@target@%$target%g
|
||||
s%@target_alias@%$target_alias%g
|
||||
s%@target_cpu@%$target_cpu%g
|
||||
s%@target_vendor@%$target_vendor%g
|
||||
s%@target_os@%$target_os%g
|
||||
s%@build@%$build%g
|
||||
s%@build_alias@%$build_alias%g
|
||||
s%@build_cpu@%$build_cpu%g
|
||||
s%@build_vendor@%$build_vendor%g
|
||||
s%@build_os@%$build_os%g
|
||||
|
||||
CEOF
|
||||
EOF
|
||||
|
||||
cat >> $CONFIG_STATUS <<\EOF
|
||||
|
||||
# Split the substitutions into bite-sized pieces for seds with
|
||||
# small command number limits, like on Digital OSF/1 and HP-UX.
|
||||
ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
|
||||
ac_file=1 # Number of current file.
|
||||
ac_beg=1 # First line for current file.
|
||||
ac_end=$ac_max_sed_cmds # Line after last line for current file.
|
||||
ac_more_lines=:
|
||||
ac_sed_cmds=""
|
||||
while $ac_more_lines; do
|
||||
if test $ac_beg -gt 1; then
|
||||
sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
|
||||
else
|
||||
sed "${ac_end}q" conftest.subs > conftest.s$ac_file
|
||||
fi
|
||||
if test ! -s conftest.s$ac_file; then
|
||||
ac_more_lines=false
|
||||
rm -f conftest.s$ac_file
|
||||
else
|
||||
if test -z "$ac_sed_cmds"; then
|
||||
ac_sed_cmds="sed -f conftest.s$ac_file"
|
||||
else
|
||||
ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
|
||||
fi
|
||||
ac_file=`expr $ac_file + 1`
|
||||
ac_beg=$ac_end
|
||||
ac_end=`expr $ac_end + $ac_max_sed_cmds`
|
||||
fi
|
||||
done
|
||||
if test -z "$ac_sed_cmds"; then
|
||||
ac_sed_cmds=cat
|
||||
fi
|
||||
EOF
|
||||
|
||||
cat >> $CONFIG_STATUS <<EOF
|
||||
|
||||
CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
|
||||
EOF
|
||||
cat >> $CONFIG_STATUS <<\EOF
|
||||
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
|
||||
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
|
||||
case "$ac_file" in
|
||||
*:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
|
||||
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
|
||||
*) ac_file_in="${ac_file}.in" ;;
|
||||
esac
|
||||
|
||||
# Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
|
||||
|
||||
# Remove last slash and all that follows it. Not all systems have dirname.
|
||||
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
|
||||
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
|
||||
# The file is in a subdirectory.
|
||||
test ! -d "$ac_dir" && mkdir "$ac_dir"
|
||||
ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
|
||||
# A "../" for each directory in $ac_dir_suffix.
|
||||
ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
|
||||
else
|
||||
ac_dir_suffix= ac_dots=
|
||||
fi
|
||||
|
||||
case "$ac_given_srcdir" in
|
||||
.) srcdir=.
|
||||
if test -z "$ac_dots"; then top_srcdir=.
|
||||
else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
|
||||
/*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
|
||||
*) # Relative path.
|
||||
srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
|
||||
top_srcdir="$ac_dots$ac_given_srcdir" ;;
|
||||
esac
|
||||
|
||||
|
||||
echo creating "$ac_file"
|
||||
rm -f "$ac_file"
|
||||
configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
|
||||
case "$ac_file" in
|
||||
*Makefile*) ac_comsub="1i\\
|
||||
# $configure_input" ;;
|
||||
*) ac_comsub= ;;
|
||||
esac
|
||||
|
||||
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
|
||||
sed -e "$ac_comsub
|
||||
s%@configure_input@%$configure_input%g
|
||||
s%@srcdir@%$srcdir%g
|
||||
s%@top_srcdir@%$top_srcdir%g
|
||||
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
|
||||
fi; done
|
||||
rm -f conftest.s*
|
||||
|
||||
EOF
|
||||
cat >> $CONFIG_STATUS <<EOF
|
||||
|
||||
EOF
|
||||
cat >> $CONFIG_STATUS <<\EOF
|
||||
|
||||
exit 0
|
||||
EOF
|
||||
chmod +x $CONFIG_STATUS
|
||||
rm -fr confdefs* $ac_clean_files
|
||||
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
|
||||
|
||||
15
gdb/testsuite/gdb.base/configure.in
Normal file
15
gdb/testsuite/gdb.base/configure.in
Normal file
@@ -0,0 +1,15 @@
|
||||
dnl Process this file file with autoconf to produce a configure script.
|
||||
dnl This file is a shell script fragment that supplies the information
|
||||
dnl necessary to tailor a template configure script into the configure
|
||||
dnl script appropriate for this directory. For more information, check
|
||||
dnl any existing configure script.
|
||||
|
||||
AC_PREREQ(2.5)
|
||||
AC_INIT(a1-selftest.exp)
|
||||
|
||||
CC=${CC-cc}
|
||||
AC_SUBST(CC)
|
||||
AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../..)
|
||||
AC_CANONICAL_SYSTEM
|
||||
|
||||
AC_OUTPUT(Makefile)
|
||||
183
gdb/testsuite/gdb.base/constvars.c
Normal file
183
gdb/testsuite/gdb.base/constvars.c
Normal file
@@ -0,0 +1,183 @@
|
||||
void marker1 (void)
|
||||
{
|
||||
}
|
||||
|
||||
/* misc. function params */
|
||||
|
||||
int
|
||||
qux1 (const char cc, const char /*&*/ccr, const char *ccp, char *const cpc)
|
||||
{
|
||||
return 33;
|
||||
}
|
||||
|
||||
int
|
||||
qux2 (volatile unsigned char vuc, const volatile int cvi,
|
||||
volatile short /*&*/vsr, volatile long *vlp, float *volatile fpv,
|
||||
const volatile signed char *const volatile cvscpcv)
|
||||
{
|
||||
return 400;
|
||||
}
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
char lave = 'B';
|
||||
unsigned char lavish = 10;
|
||||
short lax = 20;
|
||||
unsigned short lecherous = 30;
|
||||
long lechery = 40;
|
||||
unsigned long lectern = 50;
|
||||
float leeway = 60;
|
||||
double legacy = 70;
|
||||
signed char lemonade = 35;
|
||||
|
||||
const char laconic = 'A';
|
||||
const unsigned char laggard = 1;
|
||||
const short lagoon = 2;
|
||||
const unsigned short laity = 3;
|
||||
const long lambent = 4;
|
||||
const unsigned long laminated = 5;
|
||||
const float lampoon = 6;
|
||||
const double languid = 7;
|
||||
|
||||
/* pointers to constant variables */
|
||||
|
||||
const char *legend = &lave;
|
||||
const unsigned char *legerdemain = &lavish;
|
||||
const short *leniency = &lax;
|
||||
const unsigned short *leonine = &lecherous;
|
||||
const long *lesion = &lechery;
|
||||
const unsigned long *lethal = &lectern;
|
||||
const float *lethargic = &leeway;
|
||||
const double *levity = &legacy;
|
||||
|
||||
/* constant pointers to constant variables */
|
||||
|
||||
const char *const lewd = &laconic;
|
||||
const unsigned char *const lexicographer = &laggard;
|
||||
const short *const lexicon = &lagoon;
|
||||
const unsigned short *const liaison = &laity;
|
||||
const long *const libation = &lambent;
|
||||
const unsigned long *const libelous = &laminated;
|
||||
const float *const libertine = &lampoon;
|
||||
const double *const libidinous = &languid;
|
||||
|
||||
/* this is the same as const char * legend .... */
|
||||
|
||||
char const *languish = &laconic;
|
||||
unsigned char const *languor = &laggard;
|
||||
short const *lank = &lagoon;
|
||||
unsigned short const *lapidary = &laity;
|
||||
long const *larceny = &lambent;
|
||||
unsigned long const *largess = &laminated;
|
||||
float const *lascivious = &lampoon;
|
||||
double const *lassitude = &languid;
|
||||
|
||||
/* constant pointers to variable */
|
||||
|
||||
char *const lamprey = &lave;
|
||||
unsigned char *const lariat = &lavish;
|
||||
short *const laudanum = &lax;
|
||||
unsigned short *const lecithin = &lecherous;
|
||||
long *const leviathan = &lechery;
|
||||
unsigned long *const libretto = &lectern;
|
||||
float *const lissome = &leeway;
|
||||
double *const locust = &legacy;
|
||||
|
||||
/* volatile variables */
|
||||
|
||||
volatile char vox = 'X';
|
||||
volatile unsigned char victuals = 13;
|
||||
volatile short vixen = 200;
|
||||
volatile unsigned short vitriol = 300;
|
||||
volatile long vellum = 1000;
|
||||
volatile unsigned long valve = 2000;
|
||||
volatile float vacuity = 3.0;
|
||||
volatile double vertigo = 10.3;
|
||||
|
||||
/* pointers to volatile variables */
|
||||
|
||||
volatile char * vampire = &vox;
|
||||
volatile unsigned char * viper = &victuals;
|
||||
volatile short * vigour = &vixen;
|
||||
volatile unsigned short * vapour = &vitriol;
|
||||
volatile long * ventricle = &vellum;
|
||||
volatile unsigned long * vigintillion = &valve;
|
||||
volatile float * vocation = &vacuity;
|
||||
volatile double * veracity = &vertigo;
|
||||
|
||||
/* volatile pointers to volatile variables */
|
||||
|
||||
volatile char * volatile vapidity = &vox;
|
||||
volatile unsigned char * volatile velocity = &victuals;
|
||||
volatile short * volatile veneer = &vixen;
|
||||
volatile unsigned short * volatile video = &vitriol;
|
||||
volatile long * volatile vacuum = &vellum;
|
||||
volatile unsigned long * volatile veniality = &valve;
|
||||
volatile float * volatile vitality = &vacuity;
|
||||
volatile double * volatile voracity = &vertigo;
|
||||
|
||||
/* const volatile vars */
|
||||
|
||||
const volatile char victor = 'Y';
|
||||
const volatile unsigned char vicar = 11;
|
||||
|
||||
/* pointers to const volatiles */
|
||||
|
||||
const volatile char * victory = &victor;
|
||||
const volatile unsigned char * vicarage = &vicar;
|
||||
|
||||
/* const pointers to volatile vars */
|
||||
|
||||
volatile char * const vein = &vox;
|
||||
volatile unsigned char * const vogue = &victuals;
|
||||
|
||||
/* const pointers to const volatile vars */
|
||||
|
||||
const volatile char * const cavern = &victor;
|
||||
const volatile unsigned char * const coverlet = &vicar;
|
||||
|
||||
/* volatile pointers to const vars */
|
||||
|
||||
const char * volatile caveat = &laconic;
|
||||
const unsigned char * volatile covenant = &laggard;
|
||||
|
||||
/* volatile pointers to const volatile vars */
|
||||
|
||||
const volatile char * volatile vizier = &victor;
|
||||
const volatile unsigned char * volatile vanadium = &vicar;
|
||||
|
||||
/* const volatile pointers */
|
||||
|
||||
char * const volatile vane = &lave;
|
||||
unsigned char * const volatile veldt = &lavish;
|
||||
|
||||
/* const volatile pointers to const vars */
|
||||
|
||||
const char * const volatile cove = &laconic;
|
||||
const unsigned char * const volatile cavity = &laggard;
|
||||
|
||||
/* const volatile pointers to volatile vars */
|
||||
|
||||
volatile char * const volatile vagus = &vox;
|
||||
volatile unsigned char * const volatile vagrancy = &victuals;
|
||||
|
||||
/* const volatile pointers to const volatile */
|
||||
|
||||
const volatile char * const volatile vagary = &victor;
|
||||
const volatile unsigned char * const volatile vendor = &vicar;
|
||||
|
||||
/* misc. references */
|
||||
/*
|
||||
const char & radiation = laconic;
|
||||
volatile signed char & remuneration = lemonade;
|
||||
*/
|
||||
#ifdef usestubs
|
||||
set_debug_traps ();
|
||||
breakpoint ();
|
||||
#endif
|
||||
marker1 ();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
251
gdb/testsuite/gdb.base/constvars.exp
Normal file
251
gdb/testsuite/gdb.base/constvars.exp
Normal file
@@ -0,0 +1,251 @@
|
||||
# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# written by Elena Zannoni (elz@apollo.hp.com)
|
||||
#
|
||||
# This file is part of the gdb testsuite
|
||||
#
|
||||
# tests for const variables
|
||||
# const pointers to vars
|
||||
# pointers to const variables
|
||||
# const pointers to const vars
|
||||
# with mixed types
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
#
|
||||
# test running programs
|
||||
#
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile "constvars"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
# Create and source the file that provides information about the compiler
|
||||
# used to compile the test case.
|
||||
|
||||
if [get_compiler_info ${binfile}] {
|
||||
return -1;
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
|
||||
#
|
||||
# set it up at a breakpoint so we can play with the variable values
|
||||
#
|
||||
if ![runto_main] then {
|
||||
perror "couldn't run to breakpoint"
|
||||
continue
|
||||
}
|
||||
|
||||
send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
|
||||
|
||||
send_gdb "cont\n"
|
||||
gdb_expect {
|
||||
-re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
|
||||
send_gdb "up\n"
|
||||
gdb_expect {
|
||||
-re ".*$gdb_prompt $" {}
|
||||
timeout { fail "up from marker1" }
|
||||
}
|
||||
}
|
||||
-re "Break.* marker1__.* \\(\\) at .*:$decimal.*$gdb_prompt $" {
|
||||
fail "continue to marker1 (demangling)"
|
||||
send_gdb "up\n"
|
||||
gdb_expect {
|
||||
-re ".*$gdb_prompt $" {}
|
||||
timeout { fail "up from marker1" }
|
||||
}
|
||||
}
|
||||
-re "$gdb_prompt $" { fail "continue to marker1" }
|
||||
timeout { fail "(timeout) continue to marker1" }
|
||||
}
|
||||
|
||||
# test function parameters
|
||||
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
send_gdb "ptype qux1\n"
|
||||
gdb_expect {
|
||||
-re "type = int \\(const char, const char &, const char *, char * const\\).*$gdb_prompt $" {
|
||||
pass "ptype qux1"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "ptype qux1" }
|
||||
timeout { fail "(timeout) ptype qux1" }
|
||||
}
|
||||
|
||||
# test vars and pointers
|
||||
|
||||
proc do_constvar_tests {} {
|
||||
global gcc_compiled
|
||||
|
||||
gdb_test "print lave" " = 66 'B'"
|
||||
gdb_test "ptype lave" "type = char"
|
||||
gdb_test "print lavish" " = 10 '\\\\n'"
|
||||
gdb_test "ptype lavish" "type = unsigned char"
|
||||
gdb_test "print lax" " = 20"
|
||||
gdb_test "ptype lax" "type = short.*"
|
||||
gdb_test "print lecherous" " = 30"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lecherous" "type = unsigned short.*"
|
||||
gdb_test "print lechery" " = 40"
|
||||
gdb_test "ptype lechery" "type = long.*"
|
||||
gdb_test "print lectern" " = 50"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lectern" "type = unsigned long.*"
|
||||
gdb_test "print leeway" " = 60"
|
||||
gdb_test "ptype leeway" "type = float"
|
||||
gdb_test "print legacy" " = 70"
|
||||
gdb_test "ptype legacy" "type = double"
|
||||
gdb_test "print laconic" " = 65 'A'"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype laconic" "type = const char"
|
||||
gdb_test "print laggard" " = 1 '.001'"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype laggard" "type = const unsigned char"
|
||||
gdb_test "print lagoon" " = 2"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lagoon" "type = const short"
|
||||
gdb_test "print laity" " = 3"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype laity" "type = const unsigned short"
|
||||
gdb_test "print lambent" " = 4"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lambent" "type = const long"
|
||||
gdb_test "print laminated" " = 5"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype laminated" "type = const unsigned long"
|
||||
gdb_test "print lampoon" " = 6"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lampoon" "type = const float"
|
||||
gdb_test "print languid" " = 7"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype languid" "type = const double"
|
||||
gdb_test "print *legend" " = 66 'B'"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype legend" "type = const char *"
|
||||
gdb_test "print *legerdemain" " = 10 '\\\\n'"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype legerdemain" "type = const unsigned char *"
|
||||
gdb_test "print *leniency" " = 20"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype leniency" "type = const short *"
|
||||
gdb_test "print *leonine" " = 30"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype leonine" "type = const unsigned short *"
|
||||
gdb_test "print *lesion" " = 40"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lesion" "type = const long *"
|
||||
gdb_test "print *lethal" " = 50"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lethal" "type = const unsigned long *"
|
||||
gdb_test "print *lethargic" " = 60"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lethargic" "type = const float *"
|
||||
gdb_test "print *levity" " = 70"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype levity" "type = const double *"
|
||||
gdb_test "print *lewd" " = 65 'A'"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lewd" "type = const char * const"
|
||||
gdb_test "print *lexicographer" " = 1 '.001'"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lexicographer" "type = const unsigned char * const"
|
||||
gdb_test "print *lexicon" " = 2"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lexicon" "type = const short * const"
|
||||
gdb_test "print *liaison" " = 3"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype liaison" "type = const unsigned short * const"
|
||||
gdb_test "print *libation" " = 4"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype libation" "type = const long * const"
|
||||
gdb_test "print *libelous" " = 5"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype libelous" "type = const unsigned long * const"
|
||||
gdb_test "print *libertine" " = 6"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype libertine" "type = const float * const"
|
||||
gdb_test "print *libidinous" " = 7"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype libidinous" "type = const double * const"
|
||||
gdb_test "print *languish" " = 65 'A'"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype languish" "type = const char *"
|
||||
gdb_test "print *languor" " = 1 '.001'"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype languor" "type = const unsigned char *"
|
||||
gdb_test "print *lank" " = 2"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lank" "type = const short *"
|
||||
gdb_test "print *lapidary" " = 3"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lapidary" "type = const unsigned short *"
|
||||
gdb_test "print *larceny" " = 4"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype larceny" "type = const long *"
|
||||
gdb_test "print *largess" " = 5"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype largess" "type = const unsigned long *"
|
||||
gdb_test "print *lascivious" " = 6"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lascivious" "type = const float *"
|
||||
gdb_test "print *lassitude" " = 7"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lassitude" "type = const double *"
|
||||
gdb_test "print *lamprey" " = 66 'B'"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lamprey" "type = char * const"
|
||||
gdb_test "print *lariat" " = 10 '\\\\n'"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lariat" "type = unsigned char * const"
|
||||
gdb_test "print *laudanum" " = 20"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype laudanum" "type = short * const"
|
||||
gdb_test "print *lecithin" " = 30"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lecithin" "type = unsigned short * const"
|
||||
gdb_test "print *leviathan" " = 40"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype leviathan" "type = long * const"
|
||||
gdb_test "print *libretto" " = 50"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype libretto" "type = unsigned long * const"
|
||||
gdb_test "print *lissome" " = 60"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype lissome" "type = float * const"
|
||||
gdb_test "print *locust" " = 70"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype locust" "type = double * const"
|
||||
if {$gcc_compiled} then { setup_xfail "*-*-*" }
|
||||
gdb_test "ptype radiation" "type = const char &"
|
||||
}
|
||||
|
||||
do_constvar_tests
|
||||
223
gdb/testsuite/gdb.base/corefile.exp
Normal file
223
gdb/testsuite/gdb.base/corefile.exp
Normal file
@@ -0,0 +1,223 @@
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# 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
|
||||
}
|
||||
|
||||
set testfile "coremaker"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
# Create and source the file that provides information about the compiler
|
||||
# used to compile the test case.
|
||||
if [get_compiler_info ${binfile}] {
|
||||
return -1;
|
||||
}
|
||||
|
||||
# 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\""
|
||||
# remote_exec host "${binfile}"
|
||||
foreach i "${objdir}/${subdir}/core ${objdir}/${subdir}/core.coremaker.c ${binfile}.core" {
|
||||
if [remote_file build exists $i] {
|
||||
remote_exec build "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 find a core file above.
|
||||
# Oh, I should mention that any "braindamaged" non-Unix system has
|
||||
# the same problem. I like the cd bit too, it's really neat'n stuff.
|
||||
catch "system \"(cd ${objdir}/${subdir}; ${binfile}; true) >/dev/null 2>&1\""
|
||||
foreach i "${objdir}/${subdir}/core ${objdir}/${subdir}/core.coremaker.c ${binfile}.core" {
|
||||
if [remote_file build exists $i] {
|
||||
remote_exec build "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
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# 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**
|
||||
#
|
||||
# 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 {
|
||||
send_user "Spawning $GDB -nw $GDBFLAGS -core=$objdir/$subdir/corefile\n"
|
||||
}
|
||||
|
||||
set oldtimeout $timeout
|
||||
set timeout [expr "$timeout + 60"]
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
eval "spawn $GDB -nw $GDBFLAGS -core=$objdir/$subdir/corefile"
|
||||
expect {
|
||||
-re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
|
||||
pass "args: -core=corefile"
|
||||
}
|
||||
-re "Core was generated by .*\r\n\#0 .*\(\).*\r\n$gdb_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 ".*$gdb_prompt $" { fail "args: -core=corefile" }
|
||||
timeout { fail "(timeout) starting with -core" }
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Test that startup with both an executable file and -core argument.
|
||||
# See previous comments above, they are still applicable.
|
||||
#
|
||||
|
||||
close;
|
||||
|
||||
if $verbose>1 then {
|
||||
send_user "Spawning $GDB -nw $GDBFLAGS $binfile -core=$objdir/$subdir/corefile\n"
|
||||
}
|
||||
|
||||
|
||||
eval "spawn $GDB -nw $GDBFLAGS $binfile -core=$objdir/$subdir/corefile";
|
||||
expect {
|
||||
-re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
|
||||
pass "args: execfile -core=corefile"
|
||||
}
|
||||
-re "Core was generated by .*\r\n\#0 .*\(\).*\r\n$gdb_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 ".*$gdb_prompt $" { fail "args: execfile -core=corefile" }
|
||||
timeout { fail "(timeout) starting with -core" }
|
||||
}
|
||||
set timeout $oldtimeout
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
|
||||
close;
|
||||
|
||||
# Now restart normally.
|
||||
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
# Test basic corefile recognition via core-file command.
|
||||
|
||||
send_gdb "core-file $objdir/$subdir/corefile\n"
|
||||
gdb_expect {
|
||||
-re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
|
||||
pass "core-file command"
|
||||
}
|
||||
-re "Core was generated by .*\r\n\#0 .*\(\).*\r\n$gdb_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 ".*$gdb_prompt $" { fail "core-file command" }
|
||||
timeout { fail "(timeout) core-file command" }
|
||||
}
|
||||
|
||||
# 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"
|
||||
|
||||
if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
|
||||
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.
|
||||
|
||||
gdb_test "bt" "abort.*func2.*func1.*main.*" "backtrace in corefile.exp"
|
||||
|
||||
# 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_gdb "x/8bd buf2\n"
|
||||
gdb_expect {
|
||||
-re ".*:.*0.*1.*2.*3.*4.*5.*6.*7.*$gdb_prompt $" {
|
||||
pass "accessing mmapped data in core file"
|
||||
}
|
||||
-re "0x\[f\]*:.*Cannot access memory at address 0x\[f\]*.*$gdb_prompt $" {
|
||||
fail "accessing mmapped data (mapping failed at runtime)"
|
||||
}
|
||||
-re "0x.*:.*Cannot access memory at address 0x.*$gdb_prompt $" {
|
||||
fail "accessing mmapped data (mapping address not found in core file)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "accessing mmapped data (incorrect data found in core file)"
|
||||
}
|
||||
timeout {
|
||||
fail "accessing mmapped data (timeout)"
|
||||
}
|
||||
}
|
||||
|
||||
# test reinit_frame_cache
|
||||
|
||||
gdb_load ${binfile}
|
||||
setup_xfail "*-*-*"
|
||||
gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(\\)" "up in corefile.exp"
|
||||
|
||||
gdb_test "core" "No core file now."
|
||||
120
gdb/testsuite/gdb.base/coremaker.c
Normal file
120
gdb/testsuite/gdb.base/coremaker.c
Normal file
@@ -0,0 +1,120 @@
|
||||
/* Simple little program that just generates a core dump from inside some
|
||||
nested function calls. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <signal.h>
|
||||
|
||||
#ifndef __STDC__
|
||||
#define const /**/
|
||||
#endif
|
||||
|
||||
#define MAPSIZE (8 * 1024)
|
||||
|
||||
/* Don't make these automatic vars or we will have to walk back up the
|
||||
stack to access them. */
|
||||
|
||||
char *buf1;
|
||||
char *buf2;
|
||||
|
||||
int coremaker_data = 1; /* In Data section */
|
||||
int coremaker_bss; /* In BSS section */
|
||||
|
||||
const int coremaker_ro = 201; /* In Read-Only Data section */
|
||||
|
||||
/* Note that if the mapping fails for any reason, we set buf2
|
||||
to -1 and the testsuite notices this and reports it as
|
||||
a failure due to a mapping error. This way we don't have
|
||||
to test for specific errors when running the core maker. */
|
||||
|
||||
void
|
||||
mmapdata ()
|
||||
{
|
||||
int j, fd;
|
||||
extern void *malloc ();
|
||||
|
||||
/* Allocate and initialize a buffer that will be used to write
|
||||
the file that is later mapped in. */
|
||||
|
||||
buf1 = (char *) malloc (MAPSIZE);
|
||||
for (j = 0; j < MAPSIZE; ++j)
|
||||
{
|
||||
buf1[j] = j;
|
||||
}
|
||||
|
||||
/* Write the file to map in */
|
||||
|
||||
fd = open ("coremmap.data", O_CREAT | O_RDWR, 0666);
|
||||
if (fd == -1)
|
||||
{
|
||||
perror ("coremmap.data open failed");
|
||||
buf2 = (char *) -1;
|
||||
return;
|
||||
}
|
||||
write (fd, buf1, MAPSIZE);
|
||||
|
||||
/* Now map the file into our address space as buf2 */
|
||||
|
||||
buf2 = (char *) mmap (0, MAPSIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
|
||||
if (buf2 == (char *) -1)
|
||||
{
|
||||
perror ("mmap failed");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Verify that the original data and the mapped data are identical.
|
||||
If not, we'd rather fail now than when trying to access the mapped
|
||||
data from the core file. */
|
||||
|
||||
for (j = 0; j < MAPSIZE; ++j)
|
||||
{
|
||||
if (buf1[j] != buf2[j])
|
||||
{
|
||||
fprintf (stderr, "mapped data is incorrect");
|
||||
buf2 = (char *) -1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
func2 ()
|
||||
{
|
||||
int coremaker_local[5];
|
||||
int i;
|
||||
|
||||
#ifdef SA_FULLDUMP
|
||||
/* Force a corefile that includes the data section for AIX. */
|
||||
{
|
||||
struct sigaction sa;
|
||||
|
||||
sigaction (SIGABRT, (struct sigaction *)0, &sa);
|
||||
sa.sa_flags |= SA_FULLDUMP;
|
||||
sigaction (SIGABRT, &sa, (struct sigaction *)0);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Make sure that coremaker_local doesn't get optimized away. */
|
||||
for (i = 0; i < 5; i++)
|
||||
coremaker_local[i] = i;
|
||||
coremaker_bss = 0;
|
||||
for (i = 0; i < 5; i++)
|
||||
coremaker_bss += coremaker_local[i];
|
||||
coremaker_data = coremaker_ro + 1;
|
||||
abort ();
|
||||
}
|
||||
|
||||
void
|
||||
func1 ()
|
||||
{
|
||||
func2 ();
|
||||
}
|
||||
|
||||
main ()
|
||||
{
|
||||
mmapdata ();
|
||||
func1 ();
|
||||
}
|
||||
|
||||
380
gdb/testsuite/gdb.base/crossload.exp
Normal file
380
gdb/testsuite/gdb.base/crossload.exp
Normal file
@@ -0,0 +1,380 @@
|
||||
# Copyright (C) 1992, 1997 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# 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)
|
||||
# Rob Savoye changed it to use gdb_test (rob@cygnus.com)
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
# FIXME: The configure.in for this test should look for --with-targets
|
||||
# and deal accordingly. Until that has been done, skip the whole thing.
|
||||
# With a minimal bfd (the default), few if any of these tests work.
|
||||
|
||||
verbose "FIXME: all the crossload tests ignored"
|
||||
return
|
||||
|
||||
foreach i "m68k-elf m68k-aout m68k-aout2 mips-ecoff i486-elf sparc-aout i860-elf sparc-elf" {
|
||||
remote_exec build "cd ${objdir}/${subdir} ; uudecode ${srcdir}/${subdir}/$i.u "
|
||||
}
|
||||
|
||||
# FIXME: These tests don't work for the i960, because
|
||||
# bfd/config/i960-bout.mt sets SELECT_VECS. I could use setup_xfail
|
||||
# for each test, but rebooting the board between each one takes a long
|
||||
# time so I'm just punting the whole file.
|
||||
if [istarget "i960-*-*"] then {
|
||||
if $verbose>1 then {
|
||||
warning "FIXME: crossload test case doesn't run on the i960."
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
# FIXME: These tests don't work for the a29k, because SELECT_VECS is
|
||||
# used when compiling bfd. It would be nice if there were some better
|
||||
# way of detecting this case.
|
||||
if [istarget "a29k-*-*"] then {
|
||||
if $verbose>1 then {
|
||||
warning "FIXME: crossload test case doesn't run on the a29k."
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
# Test if gdb can automatically determine the bfd format of an
|
||||
# executable and read it's symbols.
|
||||
|
||||
proc bfddefault {} {
|
||||
global GDB
|
||||
global GDBFLAGS
|
||||
global gdb_prompt
|
||||
global objdir
|
||||
global subdir
|
||||
global binfile
|
||||
global bfdformat
|
||||
global file_loaded
|
||||
|
||||
gdb_unload
|
||||
set file_loaded 0
|
||||
send_gdb "file $objdir/$subdir/$binfile\n"
|
||||
gdb_expect {
|
||||
-re "A program is being debugged already. Kill it.*y or n." {
|
||||
send_gdb "y\n"
|
||||
exp_continue
|
||||
}
|
||||
-re "Reading symbols from $objdir/$subdir/$binfile\[.\]+done\..*$gdb_prompt $" {
|
||||
pass "$binfile ($bfdformat) auto format"
|
||||
}
|
||||
-re "Reading symbols from $objdir/$subdir/$binfile\[.\]+.no debugging symbols found.\[.\]+done\..*$gdb_prompt $" {
|
||||
pass "$binfile ($bfdformat) auto format (but no symbols found)"
|
||||
}
|
||||
-re "File format not recognized.*$gdb_prompt $" {
|
||||
fail "$binfile ($bfdformat) auto format (format not recognized)"
|
||||
return
|
||||
}
|
||||
-re "File format is ambiguous.*$gdb_prompt $" {
|
||||
fail "$binfile ($bfdformat) auto format (format is ambiguous)"
|
||||
return
|
||||
}
|
||||
-re "$gdb_prompt $" {
|
||||
fail "$binfile ($bfdformat) auto format"
|
||||
return
|
||||
}
|
||||
timeout {
|
||||
fail "(timeout) $binfile ($bfdformat) auto format"
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if [gdb_test "info target" ".*file type $bfdformat" ""]==0 then {
|
||||
set file_loaded 1
|
||||
} else {
|
||||
fail "$binfile ($bfdformat) wrong format found"
|
||||
}
|
||||
}
|
||||
|
||||
# Test if gdb can read symbols from an executable when the bfd format
|
||||
# is explicitly set via the environment variable GNUTARGET.
|
||||
|
||||
proc bfdexplicit {} {
|
||||
global GDB
|
||||
global GDBFLAGS
|
||||
global gdb_prompt
|
||||
global subdir
|
||||
global objdir
|
||||
global det_file
|
||||
global binfile
|
||||
global bfdformat
|
||||
global file_loaded
|
||||
|
||||
gdb_unload
|
||||
set file_loaded 0
|
||||
|
||||
# Once GDB 4.10 (the last to lack `set gnutarget') is forgotten,
|
||||
# change this to use set gnutarget.
|
||||
if [gdb_test "set env GNUTARGET=$bfdformat" "" ""]!=0 then {
|
||||
fail "setting GNUTARGET=$bfdformat in environment"
|
||||
return
|
||||
}
|
||||
|
||||
send_gdb "file $objdir/$subdir/$binfile\n"
|
||||
gdb_expect {
|
||||
-re "A program is being debugged already. Kill it.*y or n." {
|
||||
send_gdb "y\n"
|
||||
exp_continue
|
||||
}
|
||||
-re "Reading symbols from $objdir/$subdir/$binfile\[.\]+done\..*$gdb_prompt $" {
|
||||
pass "$binfile ($bfdformat) explicit format"
|
||||
}
|
||||
-re "Invalid target.*$gdb_prompt $" {
|
||||
fail "$binfile ($bfdformat) explicit format (invalid target)"
|
||||
return
|
||||
}
|
||||
-re "$gdb_prompt $" {
|
||||
fail "$binfile ($bfdformat) explicit format"
|
||||
return
|
||||
}
|
||||
timeout {
|
||||
fail "(timeout) $binfile ($bfdformat) explicit format"
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
set file_loaded 1
|
||||
}
|
||||
|
||||
proc test_ptype_functions {} {
|
||||
global gdb_prompt
|
||||
global binfile
|
||||
global bfdformat
|
||||
global det_file
|
||||
send_gdb "ptype main\n"
|
||||
gdb_expect {
|
||||
-re "type = int \[)(\]+\r\n$gdb_prompt $" {}
|
||||
timeout { fail "(timeout) $binfile ($bfdformat) function main" ; return }
|
||||
}
|
||||
|
||||
# set up a list of lists of command and patterns
|
||||
set command [list { "ptype v_char_func" "type =(\ unsigned\ |\ signed\ |\ )char \[)(\]+" }\
|
||||
{ "ptype v_short_func" "type = (short|short int) \[)(\]+" } \
|
||||
{ "ptype v_int_func" "type = int \[)(\]+" } \
|
||||
{ "ptype v_long_func" "type = (long|long int|int) \[)(\]+" } \
|
||||
{ "ptype v_float_func" "type = float \[)(\]+" } \
|
||||
{ "ptype v_double_func" "type = double \[)(\]+" } ]
|
||||
|
||||
foreach i $command {
|
||||
if [gdb_test [lindex $i 0] [lindex $i 1] ""] then {
|
||||
fail "$binfile ($bfdformat) \"[lindex $i 0]\" function types"
|
||||
return
|
||||
}
|
||||
}
|
||||
pass "$binfile ($bfdformat) ptype function types"
|
||||
}
|
||||
|
||||
# Note that plain chars can be either signed or unsigned.
|
||||
|
||||
proc test_ptype_plain_types {} {
|
||||
global gdb_prompt
|
||||
global binfile
|
||||
global bfdformat
|
||||
|
||||
# set up a list of lists of command and patterns
|
||||
set command [list { "ptype v_char" "type =(\ unsigned\ |\ signed\ |\ )char" }\
|
||||
{ "ptype v_short" "type = short" } \
|
||||
{ "ptype v_int" "type = int" } \
|
||||
{ "ptype v_long" "type = long" } \
|
||||
{ "ptype v_float" "type = float" } \
|
||||
{ "ptype v_double" "type = double" } ]
|
||||
|
||||
foreach i $command {
|
||||
if [gdb_test [lindex $i 0] [lindex $i 1] ""] then {
|
||||
fail "$binfile ($bfdformat) \"[lindex $i 0]\" plain C types"
|
||||
return
|
||||
}
|
||||
}
|
||||
pass "$binfile ($bfdformat) ptype plain C types"
|
||||
}
|
||||
|
||||
# Note that if compiled with pre-ANSI compilers, the "signed" keywords are
|
||||
# defined away and the variables default to plain types. So accept either.
|
||||
|
||||
proc test_ptype_signed_types {} {
|
||||
global gdb_prompt
|
||||
global binfile
|
||||
global bfdformat
|
||||
global det_file
|
||||
|
||||
# set up a list of lists of command and patterns
|
||||
set command [list { "ptype v_signed_char" "type =(\ signed\ |\ )char" }\
|
||||
{ "ptype v_signed_short" "type =(\ signed\ |\ )short" } \
|
||||
{ "ptype v_signed_int" "type =(\ signed\ |\ )int" } \
|
||||
{ "ptype v_signed_long" "type =(\ signed\ |\ )long" } ]
|
||||
|
||||
foreach i $command {
|
||||
if [gdb_test [lindex $i 0] [lindex $i 1] ""] then {
|
||||
if [expr [string match "ecoff-bigmips" $bfdformat]+[string match "ptype v_signed_char" [lindex $i 0]]]==2 then {
|
||||
setup_xfail "*-*-*"
|
||||
}
|
||||
fail "$binfile ($bfdformat) \"[lindex $i 0]\" signed C types"
|
||||
return
|
||||
}
|
||||
}
|
||||
pass "$binfile ($bfdformat) ptype signed C types"
|
||||
}
|
||||
|
||||
proc test_ptype_unsigned_types {} {
|
||||
global gdb_prompt
|
||||
global binfile
|
||||
global bfdformat
|
||||
global det_file
|
||||
|
||||
# set up a list of lists of command and patterns
|
||||
set command [list { "ptype v_unsigned_char" "type = unsigned char" }\
|
||||
{ "ptype v_unsigned_short" \
|
||||
"type = (unsigned short|short unsigned int)" } \
|
||||
{ "ptype v_unsigned_int" "type = unsigned int" } \
|
||||
{ "ptype v_unsigned_long" \
|
||||
"type = (unsigned long|long unsigned int)" } ]
|
||||
|
||||
foreach i $command {
|
||||
if [gdb_test [lindex $i 0] [lindex $i 1] ""] then {
|
||||
fail "$binfile ($bfdformat) \"[lindex $i 0]\" unsigned C types"
|
||||
return
|
||||
}
|
||||
}
|
||||
pass "$binfile ($bfdformat) ptype unsigned C types"
|
||||
}
|
||||
|
||||
# Note that plain chars can be either signed or unsigned.
|
||||
|
||||
proc test_ptype_array_types {} {
|
||||
global gdb_prompt
|
||||
global binfile
|
||||
global bfdformat
|
||||
global det_file
|
||||
|
||||
# set up a list of lists of command and patterns
|
||||
set command [list { "ptype v_char_array" "type =(\ unsigned\ |\ signed\ |\ )char \\\[2\\\]" }\
|
||||
{ "ptype v_short_array" \
|
||||
"type = (short|short int) \\\[2\\\]" } \
|
||||
{ "ptype v_int_array" "type = int \\\[2\\\]" } \
|
||||
{ "ptype v_long_array" "type = (long|long int) \\\[2\\\]" } \
|
||||
{ "ptype v_float_array" "type = float \\\[2\\\]" } \
|
||||
{ "ptype v_double_array" "type = double \\\[2\\\]" } ]
|
||||
|
||||
foreach i $command {
|
||||
if [gdb_test [lindex $i 0] [lindex $i 1] ""] then {
|
||||
fail "$binfile ($bfdformat) \"[lindex $i 0]\" C array types"
|
||||
return
|
||||
}
|
||||
}
|
||||
pass "$binfile ($bfdformat) ptype C array types"
|
||||
}
|
||||
|
||||
proc test_ptype_pointer_types {} {
|
||||
global gdb_prompt
|
||||
global binfile
|
||||
global bfdformat
|
||||
global det_file
|
||||
|
||||
# set up a list of lists of command and patterns
|
||||
set command [list { "ptype v_char_pointer" "type =(\ unsigned\ |\ signed\ |\ )char \*" }\
|
||||
{ "ptype v_short_pointer" "type = (short|short int) \*" } \
|
||||
{ "ptype v_int_pointer" "type = int \*" } \
|
||||
{ "ptype v_long_pointer" "type = (long|long int) \*" } \
|
||||
{ "ptype v_float_pointer" "type = float \*" } \
|
||||
{ "ptype v_double_pointer" "type = double \*" } ]
|
||||
|
||||
foreach i $command {
|
||||
if [gdb_test [lindex $i 0] [lindex $i 1] ""] then {
|
||||
fail "$binfile ($bfdformat) \"[lindex $i 0]\" C pointer types"
|
||||
return
|
||||
}
|
||||
}
|
||||
pass "$binfile ($bfdformat) ptype C pointer types"
|
||||
}
|
||||
|
||||
proc loadandtest { args } {
|
||||
global verbose
|
||||
global GDB
|
||||
global GDBFLAGS
|
||||
global gdb_prompt
|
||||
global subdir
|
||||
global objdir
|
||||
global binfile
|
||||
global bfdformat
|
||||
global file_loaded
|
||||
|
||||
set binfile [ lindex $args 0 ]
|
||||
set bfdformat [ lindex $args 1 ]
|
||||
set fixme [ lindex $args 2 ]
|
||||
|
||||
if ![file exists $objdir/$subdir/$binfile] then {
|
||||
perror "$objdir/$subdir/$binfile does not exist"
|
||||
return 0
|
||||
}
|
||||
gdb_exit
|
||||
gdb_start
|
||||
if $fixme then { setup_xfail "*-*-*" }
|
||||
bfddefault
|
||||
if $fixme then { setup_xfail "*-*-*" }
|
||||
if [string match $bfdformat "elf-big"] then {
|
||||
if [string match $binfile "i860-elf"] then {
|
||||
setup_xfail "*-*-*"
|
||||
}
|
||||
}
|
||||
bfdexplicit
|
||||
if $file_loaded==1 then {
|
||||
test_ptype_functions
|
||||
if $fixme then { setup_xfail "*-*-*" }
|
||||
test_ptype_plain_types
|
||||
if $fixme then { setup_xfail "*-*-*" }
|
||||
test_ptype_signed_types
|
||||
if $fixme then { setup_xfail "*-*-*" }
|
||||
test_ptype_unsigned_types
|
||||
if $fixme then { setup_xfail "*-*-*" }
|
||||
test_ptype_array_types
|
||||
if $fixme then { setup_xfail "*-*-*" }
|
||||
test_ptype_pointer_types
|
||||
}
|
||||
}
|
||||
|
||||
# Run tests for each of the test executables.
|
||||
# If the third argument is 1, the tests will be expected to fail.
|
||||
# We should extract the information about available tests and bfd formats
|
||||
# from the makefile or some other control file (FIXME).
|
||||
|
||||
loadandtest m68k-elf "elf32-m68k" 0
|
||||
|
||||
# I'm getting an XPASS for explicit format on this one
|
||||
loadandtest m68k-aout "a.out-newsos3" 1
|
||||
|
||||
loadandtest m68k-aout2 "a.out-sunos-big" 0
|
||||
loadandtest mips-ecoff "ecoff-bigmips" 0
|
||||
loadandtest i486-elf "elf32-i386" 0
|
||||
loadandtest sparc-aout "a.out-sunos-big" 0
|
||||
loadandtest sparc-elf "elf32-sparc" 0
|
||||
|
||||
#FIXME: i860 support is unlikely to be working in the near future
|
||||
# so suppress this test until it is working. -fnf
|
||||
#loadandtest i860-elf "elf32-i860" 0
|
||||
|
||||
gdb_test "set gnutarget auto" ""
|
||||
155
gdb/testsuite/gdb.base/d10v.ld
Normal file
155
gdb/testsuite/gdb.base/d10v.ld
Normal file
@@ -0,0 +1,155 @@
|
||||
OUTPUT_FORMAT("elf32-d10v", "elf32-d10v",
|
||||
"elf32-d10v")
|
||||
OUTPUT_ARCH(d10v)
|
||||
ENTRY(_start)
|
||||
SEARCH_DIR(/usr/cygnus/d10v-961230/H-sparc-sun-sunos4.1//lib);
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
SECTIONS
|
||||
{
|
||||
/* Overlay sections: */
|
||||
.ovly0 0x01010000 : AT (0x12010000) { foo.o(.text) }
|
||||
.ovly1 0x01010000 : AT (0x12011000) { bar.o(.text) }
|
||||
.ovly2 0x01011000 : AT (0x12012000) { baz.o(.text) }
|
||||
.ovly3 0x01011000 : AT (0x12013000) { grbx.o(.text) }
|
||||
.data00 0x00001000 : AT (0x12014000) { foo.o(.data) }
|
||||
.data01 0x00001000 : AT (0x12015000) { bar.o(.data) }
|
||||
.data02 0x00002000 : AT (0x12016000) { baz.o(.data) }
|
||||
.data03 0x00002000 : AT (0x12017000) { grbx.o(.data) }
|
||||
/* Read-only sections, merged into data segment: */
|
||||
. = 0x00000004;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.rel.text : { *(.rel.text) }
|
||||
.rela.text : { *(.rela.text) }
|
||||
.rel.data : { *(.rel.data) }
|
||||
.rela.data : { *(.rela.data) }
|
||||
.rel.rodata : { *(.rel.rodata) }
|
||||
.rela.rodata : { *(.rela.rodata) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.init : { *(.rel.init) }
|
||||
.rela.init : { *(.rela.init) }
|
||||
.rel.fini : { *(.rel.fini) }
|
||||
.rela.fini : { *(.rela.fini) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.plt : { *(.plt) }
|
||||
.rodata : { *(.rodata) *(.gnu.linkonce.r*) }
|
||||
.rodata1 : { *(.rodata1) }
|
||||
/* Adjust the address for the data segment. */
|
||||
. = ALIGN(4);
|
||||
.data :
|
||||
{
|
||||
*(.data)
|
||||
*(.gnu.linkonce.d*)
|
||||
_ovly_table = .;
|
||||
LONG(ABSOLUTE(ADDR(.ovly0)));
|
||||
LONG(SIZEOF(.ovly0));
|
||||
LONG(LOADADDR(.ovly0));
|
||||
LONG(0);
|
||||
LONG(ABSOLUTE(ADDR(.ovly1)));
|
||||
LONG(SIZEOF(.ovly1));
|
||||
LONG(LOADADDR(.ovly1));
|
||||
LONG(0);
|
||||
LONG(ABSOLUTE(ADDR(.ovly2)));
|
||||
LONG(SIZEOF(.ovly2));
|
||||
LONG(LOADADDR(.ovly2));
|
||||
LONG(0);
|
||||
LONG(ABSOLUTE(ADDR(.ovly3)));
|
||||
LONG(SIZEOF(.ovly3));
|
||||
LONG(LOADADDR(.ovly3));
|
||||
LONG(0);
|
||||
LONG(ABSOLUTE(ADDR(.data00)));
|
||||
LONG(SIZEOF(.data00));
|
||||
LONG(LOADADDR(.data00));
|
||||
LONG(0);
|
||||
LONG(ABSOLUTE(ADDR(.data01)));
|
||||
LONG(SIZEOF(.data01));
|
||||
LONG(LOADADDR(.data01));
|
||||
LONG(0);
|
||||
LONG(ABSOLUTE(ADDR(.data02)));
|
||||
LONG(SIZEOF(.data02));
|
||||
LONG(LOADADDR(.data02));
|
||||
LONG(0);
|
||||
LONG(ABSOLUTE(ADDR(.data03)));
|
||||
LONG(SIZEOF(.data03));
|
||||
LONG(LOADADDR(.data03));
|
||||
LONG(0);
|
||||
_novlys = .;
|
||||
LONG((_novlys - _ovly_table) / 16);
|
||||
CONSTRUCTORS
|
||||
}
|
||||
.data1 : { *(.data1) }
|
||||
.ctors :
|
||||
{
|
||||
*(.ctors)
|
||||
}
|
||||
.dtors :
|
||||
{
|
||||
*(.dtors)
|
||||
}
|
||||
.got : { *(.got.plt) *(.got) }
|
||||
.dynamic : { *(.dynamic) }
|
||||
/* We want the small data sections together, so single-instruction offsets
|
||||
can access them all, and initialized data all before uninitialized, so
|
||||
we can shorten the on-disk segment size. */
|
||||
.sdata : { *(.sdata) }
|
||||
_edata = .;
|
||||
PROVIDE (edata = .);
|
||||
__bss_start = .;
|
||||
.sbss : { *(.sbss) *(.scommon) }
|
||||
.bss :
|
||||
{
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
}
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
/* Stabs debugging sections. */
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
.stab.excl 0 : { *(.stab.excl) }
|
||||
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||
.stab.index 0 : { *(.stab.index) }
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||
.comment 0 : { *(.comment) }
|
||||
/* DWARF debug sections.
|
||||
Symbols in the .debug DWARF section are relative to the beginning of the
|
||||
section so we begin .debug at 0. It's not clear yet what needs to happen
|
||||
for the others. */
|
||||
.debug 0 : { *(.debug) }
|
||||
.debug_info 0 : { *(.debug_info) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_line 0 : { *(.debug_line) }
|
||||
.debug_frame 0 : { *(.debug_frame) }
|
||||
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
.debug_sfnames 0 : { *(.debug_sfnames) }
|
||||
.line 0 : { *(.line) }
|
||||
/* These must appear regardless of . */
|
||||
/* Hmmm, there's got to be a better way. This sets the stack to the
|
||||
top of the simulator memory (i.e. top of 64K data space). */
|
||||
.stack 0x00007FFE : { _stack = .; *(.stack) }
|
||||
.text 0x1000000 :
|
||||
{
|
||||
*(.init)
|
||||
*(.fini)
|
||||
*(.text)
|
||||
/* .gnu.warning sections are handled specially by elf32.em. */
|
||||
*(.gnu.warning)
|
||||
*(.gnu.linkonce.t*)
|
||||
} =0
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
}
|
||||
225
gdb/testsuite/gdb.base/d10vovly.c
Normal file
225
gdb/testsuite/gdb.base/d10vovly.c
Normal file
@@ -0,0 +1,225 @@
|
||||
|
||||
/*
|
||||
* Ovlymgr.c -- Runtime Overlay Manager for the GDB testsuite.
|
||||
*/
|
||||
|
||||
#include "ovlymgr.h"
|
||||
|
||||
/* Local functions and data: */
|
||||
|
||||
extern unsigned long _ovly_table[][4];
|
||||
extern unsigned long _novlys __attribute__ ((section (".data")));
|
||||
enum ovly_index { VMA, SIZE, LMA, MAPPED};
|
||||
|
||||
static void ovly_copy (unsigned long dst, unsigned long src, long size);
|
||||
|
||||
/* Flush the data and instruction caches at address START for SIZE bytes.
|
||||
Support for each new port must be added here. */
|
||||
/* FIXME: Might be better to have a standard libgloss function that
|
||||
ports provide that we can then use. Use libgloss instead of newlib
|
||||
since libgloss is the one intended to handle low level system issues.
|
||||
I would suggest something like _flush_cache to avoid the user's namespace
|
||||
but not be completely obscure as other things may need this facility. */
|
||||
|
||||
static void
|
||||
FlushCache (void)
|
||||
{
|
||||
#ifdef __M32R__
|
||||
volatile char *mspr = (char *) 0xfffffff7;
|
||||
*mspr = 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* OverlayLoad:
|
||||
* Copy the overlay into its runtime region,
|
||||
* and mark the overlay as "mapped".
|
||||
*/
|
||||
|
||||
bool
|
||||
OverlayLoad (unsigned long ovlyno)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
if (ovlyno < 0 || ovlyno >= _novlys)
|
||||
exit (-1); /* fail, bad ovly number */
|
||||
|
||||
if (_ovly_table[ovlyno][MAPPED])
|
||||
return TRUE; /* this overlay already mapped -- nothing to do! */
|
||||
|
||||
for (i = 0; i < _novlys; i++)
|
||||
if (i == ovlyno)
|
||||
_ovly_table[i][MAPPED] = 1; /* this one now mapped */
|
||||
else if (_ovly_table[i][VMA] == _ovly_table[ovlyno][VMA])
|
||||
_ovly_table[i][MAPPED] = 0; /* this one now un-mapped */
|
||||
|
||||
ovly_copy (_ovly_table[ovlyno][VMA],
|
||||
_ovly_table[ovlyno][LMA],
|
||||
_ovly_table[ovlyno][SIZE]);
|
||||
|
||||
FlushCache ();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* OverlayUnload:
|
||||
* Copy the overlay back into its "load" region.
|
||||
* Does NOT mark overlay as "unmapped", therefore may be called
|
||||
* more than once for the same mapped overlay.
|
||||
*/
|
||||
|
||||
bool
|
||||
OverlayUnload (unsigned long ovlyno)
|
||||
{
|
||||
if (ovlyno < 0 || ovlyno >= _novlys)
|
||||
exit (-1); /* fail, bad ovly number */
|
||||
|
||||
if (!_ovly_table[ovlyno][MAPPED])
|
||||
exit (-1); /* error, can't copy out a segment that's not "in" */
|
||||
|
||||
ovly_copy (_ovly_table[ovlyno][LMA],
|
||||
_ovly_table[ovlyno][VMA],
|
||||
_ovly_table[ovlyno][SIZE]);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef __D10V__
|
||||
#define IMAP0 (*(short *)(0xff00))
|
||||
#define IMAP1 (*(short *)(0xff02))
|
||||
#define DMAP (*(short *)(0xff04))
|
||||
|
||||
static void
|
||||
D10VTranslate (unsigned long logical,
|
||||
short *dmap,
|
||||
unsigned long **addr)
|
||||
{
|
||||
unsigned long physical;
|
||||
unsigned long seg;
|
||||
unsigned long off;
|
||||
|
||||
/* to access data, we use the following mapping
|
||||
0x00xxxxxx: Logical data address segment (DMAP translated memory)
|
||||
0x01xxxxxx: Logical instruction address segment (IMAP translated memory)
|
||||
0x10xxxxxx: Physical data memory segment (On-chip data memory)
|
||||
0x11xxxxxx: Physical instruction memory segment (On-chip insn memory)
|
||||
0x12xxxxxx: Phisical unified memory segment (Unified memory)
|
||||
*/
|
||||
|
||||
/* Addresses must be correctly aligned */
|
||||
if (logical & (sizeof (**addr) - 1))
|
||||
exit (-1);
|
||||
|
||||
/* If the address is in one of the two logical address spaces, it is
|
||||
first translated into a physical address */
|
||||
seg = (logical >> 24);
|
||||
off = (logical & 0xffffffL);
|
||||
switch (seg)
|
||||
{
|
||||
case 0x00: /* in logical data address segment */
|
||||
if (off <= 0x7fffL)
|
||||
physical = (0x10L << 24) + off;
|
||||
else
|
||||
/* Logical address out side of on-chip segment, not
|
||||
supported */
|
||||
exit (-1);
|
||||
break;
|
||||
case 0x01: /* in logical instruction address segment */
|
||||
{
|
||||
short map;
|
||||
if (off <= 0x1ffffL)
|
||||
map = IMAP0;
|
||||
else if (off <= 0x3ffffL)
|
||||
map = IMAP1;
|
||||
else
|
||||
/* Logical address outside of IMAP[01] segment, not
|
||||
supported */
|
||||
exit (-1);
|
||||
if (map & 0x1000L)
|
||||
{
|
||||
/* Instruction memory */
|
||||
physical = (0x11L << 24) | off;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Unified memory */
|
||||
physical = ((map & 0x7fL) << 17) + (off & 0x1ffffL);
|
||||
if (physical > 0xffffffL)
|
||||
/* Address outside of unified address segment */
|
||||
exit (-1);
|
||||
physical |= (0x12L << 24);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0x10:
|
||||
case 0x11:
|
||||
case 0x12:
|
||||
physical = logical;
|
||||
break;
|
||||
default:
|
||||
exit (-1); /* error */
|
||||
}
|
||||
|
||||
seg = (physical >> 24);
|
||||
off = (physical & 0xffffffL);
|
||||
switch (seg)
|
||||
{
|
||||
case 0x10: /* dst is a 15 bit offset into the on-chip memory */
|
||||
*dmap = 0;
|
||||
*addr = (long *) (0x0000 + ((short)off & 0x7fff));
|
||||
break;
|
||||
case 0x11: /* dst is an 18-bit offset into the on-chip
|
||||
instruction memory */
|
||||
*dmap = 0x1000L | ((off & 0x3ffffL) >> 14);
|
||||
*addr = (long *) (0x8000 + ((short)off & 0x3fff));
|
||||
break;
|
||||
case 0x12: /* dst is a 24-bit offset into unified memory */
|
||||
*dmap = off >> 14;
|
||||
*addr = (long *) (0x8000 + ((short)off & 0x3fff));
|
||||
break;
|
||||
default:
|
||||
exit (-1); /* error */
|
||||
}
|
||||
}
|
||||
#endif /* __D10V__ */
|
||||
|
||||
static void
|
||||
ovly_copy (unsigned long dst, unsigned long src, long size)
|
||||
{
|
||||
#ifdef __M32R__
|
||||
memcpy ((void *) dst, (void *) src, size);
|
||||
return;
|
||||
#endif /* M32R */
|
||||
|
||||
#ifdef __D10V__
|
||||
unsigned long *s, *d, tmp;
|
||||
short dmap_src, dmap_dst;
|
||||
short dmap_save;
|
||||
|
||||
/* all section sizes should by multiples of 4 bytes */
|
||||
dmap_save = DMAP;
|
||||
|
||||
D10VTranslate (src, &dmap_src, &s);
|
||||
D10VTranslate (dst, &dmap_dst, &d);
|
||||
|
||||
while (size > 0)
|
||||
{
|
||||
/* NB: Transfer 4 byte (long) quantites, problems occure
|
||||
when only two bytes are transfered */
|
||||
DMAP = dmap_src;
|
||||
tmp = *s;
|
||||
DMAP = dmap_dst;
|
||||
*d = tmp;
|
||||
d++;
|
||||
s++;
|
||||
size -= sizeof (tmp);
|
||||
src += sizeof (tmp);
|
||||
dst += sizeof (tmp);
|
||||
if ((src & 0x3fff) == 0)
|
||||
D10VTranslate (src, &dmap_src, &s);
|
||||
if ((dst & 0x3fff) == 0)
|
||||
D10VTranslate (dst, &dmap_dst, &d);
|
||||
}
|
||||
DMAP = dmap_save;
|
||||
#endif /* D10V */
|
||||
}
|
||||
|
||||
793
gdb/testsuite/gdb.base/default.exp
Normal file
793
gdb/testsuite/gdb.base/default.exp
Normal file
@@ -0,0 +1,793 @@
|
||||
# Copyright (C) 1988, 1990, 1991, 1992, 1994, 1997, 1998
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# Start with a fresh gdb
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
|
||||
set timeout 60
|
||||
|
||||
#
|
||||
# test default actions of gdb commands
|
||||
#
|
||||
|
||||
#load_lib gdb.exp
|
||||
|
||||
gdb_test "add-symbol-file" "add-symbol-file takes a file name and an address" "add-symbol-file"
|
||||
|
||||
setup_xfail "mips-idt-*"
|
||||
send_gdb "attach\n"
|
||||
gdb_expect {
|
||||
-re "Argument required .(process-id|program) to attach.*$gdb_prompt $"\
|
||||
{ pass "attach" }
|
||||
-re "You can't do that when your target is `None'.*$gdb_prompt $"\
|
||||
{ pass "attach" }
|
||||
-re "Don't know how to attach. Try \"help target\"..*$gdb_prompt $"\
|
||||
{ pass "attach" }
|
||||
-re "Kill it. .y or n." {
|
||||
send_gdb "y\n"
|
||||
exp_continue
|
||||
}
|
||||
-re "$gdb_prompt $" { fail "attach" }
|
||||
timeout { fail "(timeout) attach" }
|
||||
}
|
||||
|
||||
# FIXME: attach kills the udi connection
|
||||
if { [istarget "a29k-*-udi"] } {
|
||||
gdb_exit
|
||||
gdb_start
|
||||
}
|
||||
|
||||
if ![target_info exists use_gdb_stub] {
|
||||
gdb_test "break" "No default breakpoint address now." "break"
|
||||
foreach i "b br bre brea" {
|
||||
gdb_test $i "No default breakpoint address now." "break \"$i\" abbreviation"
|
||||
}
|
||||
|
||||
|
||||
setup_xfail "mips-idt-*" "a29k-*-udi"
|
||||
gdb_test "backtrace" "No stack."
|
||||
foreach i "bt ba bac" {
|
||||
setup_xfail "mips-idt-*" "a29k-*-udi"
|
||||
gdb_test $i "No stack." "backtrace \"$i\" abbreviation"
|
||||
}
|
||||
} else {
|
||||
warning "Skipping backtrace and break tests because of GDB stub."
|
||||
}
|
||||
|
||||
# This works on the MIPS IDT board, but confuses future tests.
|
||||
if ![istarget "mips-idt-*"] then {
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "continue" "The program is not being run." "continue"
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "c" "The program is not being run." "continue \"c\" abbreviation"
|
||||
}
|
||||
|
||||
# FIXME: continue kills the udi connection
|
||||
if [istarget "a29k-*-udi"] then {
|
||||
gdb_exit
|
||||
gdb_start
|
||||
}
|
||||
|
||||
#test call
|
||||
gdb_test "call" "The history is empty..*" "call"
|
||||
|
||||
|
||||
#test catch
|
||||
gdb_test "catch" "Catch requires an event name..*" "catch"
|
||||
|
||||
#test cd
|
||||
gdb_test "cd" "Argument required .new working directory.*" "cd"
|
||||
|
||||
#test clear
|
||||
gdb_test "clear" "No source file specified..*" "clear"
|
||||
|
||||
#test commands
|
||||
gdb_test "commands" "No breakpoint number 0..*" "commands"
|
||||
|
||||
#test condition
|
||||
gdb_test "condition" "Argument required .breakpoint number.*" "condition"
|
||||
|
||||
#test core-file
|
||||
gdb_test "core-file" "No core file now.|GDB can't read core files on this machine." "core-file"
|
||||
#test delete "d" abbreviation
|
||||
gdb_test "d" "" "delete \"d\" abbreviation"
|
||||
#test delete
|
||||
gdb_test "delete" "" "delete"
|
||||
#test define
|
||||
gdb_test "define" "Argument required \[(\]name of command to define\[)\]." "define"
|
||||
#test delete breakpoints
|
||||
gdb_test "delete breakpoints" "" "delete breakpoints"
|
||||
#test delete display
|
||||
# FIXME -- need to dump full output to detailed log
|
||||
send_gdb "delete display\n"
|
||||
gdb_expect {
|
||||
-re "Delete all auto-display expressions.*y or n. $" {
|
||||
send_gdb "y\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $" { pass "delete display prompt" }
|
||||
timeout { fail "(timeout) delete display prompt" }
|
||||
}
|
||||
}
|
||||
timeout { fail "(timeout) delete display prompt" }
|
||||
|
||||
}
|
||||
|
||||
#test detach
|
||||
gdb_test "detach" "" "detach"
|
||||
|
||||
# FIXME: continue kills the udi connection
|
||||
if [istarget "a29k-*-udi"] then {
|
||||
gdb_exit
|
||||
gdb_start
|
||||
}
|
||||
if [istarget "h8300-*-hms"] then {
|
||||
gdb_exit
|
||||
gdb_start
|
||||
}
|
||||
|
||||
#test directory
|
||||
# FIXME -- need to dump full output to detailed log
|
||||
|
||||
send_gdb "directory\n"
|
||||
gdb_expect {
|
||||
-re "Reinitialize source path to empty.*y or n. $" {
|
||||
send_gdb "y\n"
|
||||
gdb_expect {
|
||||
-re "Source directories searched: .cdir:.cwd.*$gdb_prompt $"\
|
||||
{ pass "directory prompt" }
|
||||
timeout { fail "(timeout) directory prompt" }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#test disable "dis" abbreviation
|
||||
gdb_test "dis" "" "disable \"dis\" abbreviation"
|
||||
#test disable "disa" abbreviation
|
||||
gdb_test "disa" "" "disable \"disa\" abbreviation"
|
||||
#test disable
|
||||
gdb_test "disable" "" "disable"
|
||||
#test disable breakpoints
|
||||
gdb_test "disable breakpoints" "" "disable breakpoints"
|
||||
#test disable display
|
||||
gdb_test "disable display" "" "disable display"
|
||||
#test disassemble
|
||||
gdb_test "disassemble" "No frame selected." "disassemble"
|
||||
#test display
|
||||
gdb_test "display" "" "display"
|
||||
#test do
|
||||
gdb_test "do" "No stack." "do"
|
||||
#test document
|
||||
gdb_test "document" "Argument required .name of command to define.*" "document"
|
||||
#test down
|
||||
gdb_test "down" "No stack.*" "down"
|
||||
#test down-silently
|
||||
gdb_test "down-silently" "No stack." "down-silently"
|
||||
#test echo
|
||||
gdb_test "echo" "" "echo"
|
||||
#test enable breakpoints delete
|
||||
gdb_test "enable breakpoints delete" "Argument required .one or more breakpoint numbers.*" "enable breakpoints delete"
|
||||
#test enable breakpoints once
|
||||
gdb_test "enable breakpoints once" "Argument required .one or more breakpoint numbers.*" "enable breakpoints once"
|
||||
#test enable breakpoints
|
||||
gdb_test "enable breakpoints" "" "enable breakpoints"
|
||||
#test enable delete
|
||||
gdb_test "enable delete" "Argument required .one or more breakpoint numbers.*" "enable delete"
|
||||
#test enable display
|
||||
gdb_test "enable display" "" "enable display"
|
||||
#test enable once
|
||||
gdb_test "enable once" "Argument required .one or more breakpoint numbers.*" "enable once"
|
||||
#test enable
|
||||
gdb_test "enable" "" "enable"
|
||||
#test exec-file
|
||||
send_gdb "exec-file\n"
|
||||
gdb_expect {
|
||||
-re "No executable file now..*$gdb_prompt $" {
|
||||
pass "exec-file"
|
||||
}
|
||||
-re "exec-file.*A program is being debugged already. Kill it. .y or n.*$" {
|
||||
send_gdb "n\n"
|
||||
if $verbose>1 then {
|
||||
send_user "\tDidn't kill program being debugged\n"
|
||||
}
|
||||
gdb_expect -re "$gdb_prompt $" { }
|
||||
pass "exec-file"
|
||||
}
|
||||
-re "$gdb_prompt $" { fail "exec-file" }
|
||||
timeout { fail "(timeout) exec-file" }
|
||||
}
|
||||
|
||||
#test frame "f" abbreviation
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "f" "No stack." "frame \"f\" abbreviation"
|
||||
#test frame
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "frame" "No stack." "frame"
|
||||
#test fg
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "fg" "The program is not being run." "fg"
|
||||
# FIXME: fg kills the udi connection
|
||||
#test file
|
||||
send_gdb "file\n"
|
||||
gdb_expect {
|
||||
-re "No executable file now..*$gdb_prompt $"\
|
||||
{ pass "file" }
|
||||
-re ".*A program is being debugged already. Kill it. .y or n.*$" {
|
||||
send_gdb "n\n"
|
||||
if $verbose>1 then {
|
||||
send_user "\t\tDidn't kill program being debugged\n"
|
||||
}
|
||||
gdb_expect -re "$gdb_prompt $" { }
|
||||
pass "file"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "file" }
|
||||
timeout { fail "(timeout) file" }
|
||||
}
|
||||
|
||||
#test finish
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "finish" "The program is not running." "finish"
|
||||
#test forward-search
|
||||
# The message here comes from the regexp library, not gdb, and so can
|
||||
# vary on different systems.
|
||||
gdb_test "forward-search" "No previous regular expression.*|There is no previous regular expression.*" "forward-search"
|
||||
#test help "h" abbreviation
|
||||
gdb_test "h" "List of classes of commands:.*\[\r\n\]+aliases -- Aliases of other commands.*\[\r\n\]+breakpoints -- Making program stop at certain points.*\[\r\n\]+data -- Examining data.*\[\r\n\]+files -- Specifying and examining files.*\[\r\n\]+obscure -- Obscure features.*\[\r\n\]+running -- Running the program.*\[\r\n\]+stack -- Examining the stack.*\[\r\n\]+status -- Status inquiries.*\[\r\n\]+support -- Support facilities.*\[\r\n\]+user-defined -- User-defined commands.*\[\r\n\]+Type \"help\" followed by a class name for a list of commands in that class..*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help \"h\" abbreviation"
|
||||
#test help
|
||||
gdb_test "help" "List of classes of commands:.*\[\r\n\]+aliases -- Aliases of other commands.*\[\r\n\]+breakpoints -- Making program stop at certain points.*\[\r\n\]+data -- Examining data.*\[\r\n\]+files -- Specifying and examining files.*\[\r\n\]+obscure -- Obscure features.*\[\r\n\]+running -- Running the program.*\[\r\n\]+stack -- Examining the stack.*\[\r\n\]+status -- Status inquiries.*\[\r\n\]+support -- Support facilities.*\[\r\n\]+user-defined -- User-defined commands.*\[\r\n\]+Type \"help\" followed by a class name for a list of commands in that class..*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help"
|
||||
#test handle
|
||||
gdb_test "handle" "Argument required .signal to handle.*" "handle"
|
||||
#test info "i" abbreviation
|
||||
gdb_test "i" "\"info\" must be followed by the name of an info command..*\[\r\n\]+List of info subcommands:.*\[\r\n\]+Type \"help info\" followed by info subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "info \"i\" abbreviation"
|
||||
#test info
|
||||
gdb_test "info" "\"info\" must be followed by the name of an info command..*\[\r\n\]+List of info subcommands:.*\[\r\n\]+Type \"help info\" followed by info subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "info"
|
||||
#test ignore
|
||||
gdb_test "ignore" "Argument required .a breakpoint number.*" "ignore"
|
||||
#test info address
|
||||
gdb_test "info address" "Argument required." "info address"
|
||||
#test info all-registers
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "info all-registers" "The program has no registers now." "info all-registers"
|
||||
#test info args
|
||||
gdb_test "info args" "No frame selected." "info args"
|
||||
#test info bogus-gdb-command
|
||||
gdb_test "info bogus-gdb-command" "Undefined info command: \"bogus-gdb-command\". Try \"help info\".*" "info bogus-gdb-command"
|
||||
#test info breakpoints
|
||||
gdb_test "info breakpoints" "No breakpoints or watchpoints." "info breakpoints"
|
||||
#test info catch
|
||||
gdb_test "info catch" "You can't do that without a process to debug." "info catch"
|
||||
#test info copying
|
||||
# FIXME -- doesn't work worth a shit
|
||||
#send_gdb "info copying"
|
||||
# -re "GNU GENERAL PUBLIC LICENSE.*#of preserving the free status of all derivatives of our free software and.*#of promoting the sharing and reuse of software generally."#
|
||||
gdb_test "info copying"
|
||||
# }
|
||||
#
|
||||
#
|
||||
#test info display
|
||||
gdb_test "info display" "There are no auto-display expressions now." "info display"
|
||||
#test info frame "f" abbreviation
|
||||
gdb_test "info f" "No stack.*|No selected frame.*" "info frame \"f\" abbreviation"
|
||||
#test info frame
|
||||
gdb_test "info frame" "No stack.|No selected frame." "info frame"
|
||||
#test info files
|
||||
gdb_test "info files" "" "info files"
|
||||
#test info float
|
||||
if [istarget "arm-*-*"] then {
|
||||
gdb_test "info float" "Software FPU type.*mask:.*flags:.*" "info float"
|
||||
} elseif [istarget "thumb-*-*"] then {
|
||||
gdb_test "info float" "Software FPU type.*mask:.*flags:.*" "info float"
|
||||
} else {
|
||||
gdb_test "info float" "No floating point info available for this processor." "info float"
|
||||
}
|
||||
#test info functions
|
||||
gdb_test "info functions" "All defined functions:" "info functions"
|
||||
#test info locals
|
||||
gdb_test "info locals" "No frame selected." "info locals"
|
||||
#test info program
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "info program" "The program being debugged is not being run." "info program"
|
||||
#test info registers
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "info registers" "The program has no registers now." "info registers"
|
||||
#test info stack "s" abbreviation
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "info s" "No stack." "info stack \"s\" abbreviation"
|
||||
#test info stack
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "info stack" "No stack." "info stack"
|
||||
#test info set
|
||||
# FIXME -- needs to match the entire output
|
||||
gdb_test "info set" "confirm: Whether to confirm potentially dangerous operations is o\[a-z\]*..*\[\r\n\]+history filename: The filename in which to record the command history is .*\[\r\n\]+listsize: Number of source lines gdb will list by default is 10.*" "info set"
|
||||
gdb_test "info symbol" "Argument required .address.."
|
||||
#test info source
|
||||
gdb_test "info source" "No current source file..*" "info source"
|
||||
#test info sources
|
||||
gdb_test "info sources" "No symbol table is loaded. Use the \"file\" command.*" "info sources"
|
||||
#test info target
|
||||
gdb_test "info target" "" "info target"
|
||||
#test info terminal
|
||||
gdb_test "info terminal" "No saved terminal information." "info terminal"
|
||||
#test info types
|
||||
gdb_test "info types" "All defined types:" "info types"
|
||||
#test info variables
|
||||
gdb_test "info variables" "All defined variables:" "info variables"
|
||||
#test info warranty
|
||||
gdb_test "info warranty" "NO WARRANTY.*\[\r\n\]+ *11. *BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY.*\[\r\n\]+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN.*\[\r\n\]+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES.*\[\r\n\]+PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED.*\[\r\n\]+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF.*\[\r\n\]+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS.*\[\r\n\]+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE.*\[\r\n\]+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,.*\[\r\n\]+REPAIR OR CORRECTION..*\[\r\n\]+ *12. *IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING.*\[\r\n\]+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR.*\[\r\n\]+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,.*\[\r\n\]+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING.*\[\r\n\]+OUT OF THE USE OR INABILITY TO USE THE PROGRAM .INCLUDING BUT NOT LIMITED.*\[\r\n\]+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY.*\[\r\n\]+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER.*\[\r\n\]+PROGRAMS., EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE.*\[\r\n\]+POSSIBILITY OF SUCH DAMAGES.*" "info warranty"
|
||||
#test info watchpoints
|
||||
gdb_test "info watchpoints" "No breakpoints or watchpoints." "info watchpoints"
|
||||
#test inspect
|
||||
gdb_test "inspect" "The history is empty." "inspect"
|
||||
#test jump
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "jump" "The program is not being run." "jump"
|
||||
#test kill
|
||||
gdb_test "kill" "The program is not being run." "kill"
|
||||
#test list "l" abbreviation
|
||||
gdb_test "l" "No symbol table is loaded. Use the \"file\" command.*" "list \"l\" abbreviation"
|
||||
#test list
|
||||
gdb_test "list" "No symbol table is loaded. Use the \"file\" command.*" "list"
|
||||
#test load
|
||||
# The ``takes a file name'' case is for vxgdb.
|
||||
# The ``Use the "file" command'' case is for newer GDB versions which try
|
||||
# to deduce the filename from the exec file.
|
||||
gdb_test "load" "You can't do that when your target is `None'.*|The load command takes a file name.*|Must specify at least a file name with the load command.*|.*Use the .file. or .exec-file. command.*" "load"
|
||||
#test next "n" abbreviation
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "n" "The program is not being run." "next \"n\" abbreviation"
|
||||
#test next
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "next" "The program is not being run." "next"
|
||||
#test nexti "ni" abbreviation
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "ni" "The program is not being run." "nexti \"ni\" abbreviation"
|
||||
#test nexti
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "nexti" "The program is not being run." "nexti"
|
||||
#test output
|
||||
gdb_test "output" "Argument required .expression to compute.*" "output"
|
||||
|
||||
#test overlay
|
||||
gdb_test "overlay" "\"overlay\" must be followed by the name of .*"
|
||||
#test a non-existant overlay subcommand
|
||||
gdb_test "overlay on" "Undefined overlay command.* Try \"help overlay\"."
|
||||
gdb_test "overlay manual" "" "overlay manual #1"
|
||||
gdb_test "overlay auto" ""
|
||||
gdb_test "overlay off" ""
|
||||
gdb_test "overlay list" "No sections are mapped."
|
||||
gdb_test "overlay map" "Overlay debugging not enabled.*" "overlay map #1"
|
||||
gdb_test "overlay unmap" "Overlay debugging not enabled.*" "overlay unmap #2"
|
||||
gdb_test "overlay manual" "" "overlay manual #2"
|
||||
gdb_test "overlay map" "Argument required: name of an overlay section." "overlay map #2"
|
||||
gdb_test "overlay unmap" "Argument required: name of an overlay section." "overlay unmap #2"
|
||||
|
||||
#test print "p" abbreviation
|
||||
gdb_test "p" "The history is empty." "print \"p\" abbreviation"
|
||||
#test print
|
||||
gdb_test "print" "The history is empty." "print"
|
||||
#test printf
|
||||
gdb_test "printf" "Argument required .format-control string and values to print.*" "printf"
|
||||
#test ptype
|
||||
gdb_test "ptype" "The history is empty." "ptype"
|
||||
#test pwd
|
||||
gdb_test "pwd" "Working directory .*" "pwd"
|
||||
|
||||
#test run "r" abbreviation
|
||||
if [istarget "*-*-vxworks*"] then {
|
||||
gdb_test "set args" "" ""
|
||||
|
||||
gdb_test "r" "Starting program: .*
|
||||
You must specify a function name to run, and arguments if any"\
|
||||
"run \"r\" abbreviation"
|
||||
gdb_test "set args main" "" ""
|
||||
|
||||
} else {
|
||||
send_gdb "r\n"
|
||||
gdb_expect {
|
||||
-re "Starting program: .*
|
||||
You can't do that when your target is `None'.*$gdb_prompt $"\
|
||||
{ pass "run \"r\" abbreviation" }
|
||||
-re "Starting program: .*
|
||||
No executable file specified.*
|
||||
Use the \"file\" or \"exec-file\" command.*$gdb_prompt $"\
|
||||
{ pass "run \"r\" abbreviation" }
|
||||
-re "Starting program: .*
|
||||
No image loaded into target.*$gdb_prompt $"\
|
||||
{ pass "run \"r\" abbreviation" }
|
||||
-re "Starting program: .*
|
||||
No program loaded.*$gdb_prompt $"\
|
||||
{ pass "run \"r\" abbreviation" }
|
||||
-re "Don't know how to run. Try \"help target\"..*$gdb_prompt $"\
|
||||
{ pass "run \"r\" abbreviation" }
|
||||
-re ".*$gdb_prompt $" { fail "run \"r\" abbreviation" }
|
||||
timeout { fail "(timeout) run \"r\" abbreviation" }
|
||||
}
|
||||
}
|
||||
|
||||
#test run
|
||||
if [istarget "*-*-vxworks*"] then {
|
||||
gdb_test "set args" "" ""
|
||||
|
||||
gdb_test "run" "Starting program: .*
|
||||
You must specify a function name to run, and arguments if any"
|
||||
gdb_test "set args main" "" ""
|
||||
|
||||
} else {
|
||||
send_gdb "run\n"
|
||||
gdb_expect {
|
||||
-re "Starting program:.*You can't do that when your target is `None'.*$gdb_prompt $" { pass "run" }
|
||||
-re "Starting program: .*
|
||||
No executable file specified.*
|
||||
Use the \"file\" or \"exec-file\" command.*$gdb_prompt $"\
|
||||
{ pass "run" }
|
||||
-re "Starting program: .*
|
||||
No image loaded into target.*$gdb_prompt $"\
|
||||
{ pass "run" }
|
||||
-re "Starting program: .*
|
||||
No program loaded.*$gdb_prompt $"\
|
||||
{ pass "run \"r\" abbreviation" }
|
||||
-re "Don't know how to run. Try \"help target\"..*$gdb_prompt $"\
|
||||
{ pass "run" }
|
||||
-re ".*$gdb_prompt $" { fail "run" }
|
||||
timeout { fail "(timeout) run" }
|
||||
}
|
||||
}
|
||||
|
||||
#test rbreak
|
||||
gdb_test "rbreak" "" "rbreak"
|
||||
|
||||
#test return
|
||||
# The middle case accommodates the a29k, where doing the "ni" above causes
|
||||
# an initial stack to be created.
|
||||
gdb_test "return" "No selected frame..*" "return" "Make .* return now.*y or n. $" "y"
|
||||
|
||||
|
||||
#test reverse-search
|
||||
gdb_test "reverse-search" "No previous regular expression.*|There is no previous regular expression.*" "reverse-search"
|
||||
#test step "s" abbreviation
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "s" "The program is not being run." "step \"s\" abbreviation #1"
|
||||
#test step
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "step" "The program is not being run." "step #1"
|
||||
#test search
|
||||
gdb_test "search" "No previous regular expression.*|There is no previous regular expression.*" "search"
|
||||
#test section
|
||||
gdb_test "section" "Must specify section name and its virtual address.*" "section"
|
||||
#test set annotate
|
||||
gdb_test "set annotate" "Argument required .integer to set it to.*" "set annotate"
|
||||
#test set args
|
||||
gdb_test "set args" "" "set args"
|
||||
#test set check "c" abbreviation
|
||||
gdb_test "set c" "\"set check\" must be followed by the name of a check subcommand..*\[\r\n\]+List of set check subcommands:.*\[\r\n\]+set check range -- Set range checking.*\[\r\n\]+set check type -- Set type checking.*\[\r\n\]+Type \"help set check\" followed by set check subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "set check \"c\" abbreviation"
|
||||
#test set check "ch" abbreviation
|
||||
gdb_test "set ch" "\"set check\" must be followed by the name of a check subcommand..*\[\r\n\]+List of set check subcommands:.*\[\r\n\]+set check range -- Set range checking.*\[\r\n\]+set check type -- Set type checking.*\[\r\n\]+Type \"help set check\" followed by set check subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "set check \"ch\" abbreviation"
|
||||
#test set check
|
||||
gdb_test "set check" "\"set check\" must be followed by the name of a check subcommand..*\[\r\n\]+List of set check subcommands:.*\[\r\n\]+set check range -- Set range checking.*\[\r\n\]+set check type -- Set type checking.*\[\r\n\]+Type \"help set check\" followed by set check subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "set check"
|
||||
#test set check range
|
||||
gdb_test "set check range" "" "set check range"
|
||||
#test set check type
|
||||
gdb_test "set check type" "" "set check type"
|
||||
#test set complaints
|
||||
gdb_test "set complaints" "Argument required .integer to set it to.*" "set complaints"
|
||||
#test set confirm
|
||||
gdb_test "set confirm" "" "set confirm"
|
||||
# Don't test set editing. What if we're talking to a gdb that
|
||||
# won't do editing correctly while we're talking to it?
|
||||
# gdb_test "set editing" "" "set editing"
|
||||
|
||||
#test set environment
|
||||
gdb_test "set environment" "Argument required .environment variable and value.*" "set environment"
|
||||
#test set height
|
||||
gdb_test "set height" "Argument required .integer to set it to.*" "set height"
|
||||
#test set history expansion
|
||||
gdb_test "set history expansion" "" "set history expansion"
|
||||
#test set history filename
|
||||
gdb_test "set history filename" "Argument required .filename to set it to.*" "set history filename"
|
||||
#test set history save
|
||||
gdb_test "set history save" "" "set history save"
|
||||
#test set history size
|
||||
gdb_test "set history size" "Argument required .integer to set it to.*" "set history size"
|
||||
#test set history
|
||||
gdb_test "set history" "\"set history\" must be followed by the name of a history subcommand..*\[\r\n\]+List of set history subcommands:.*\[\r\n\]+set history expansion -- Set history expansion on command input.*\[\r\n\]+set history filename -- Set the filename in which to record the command history.*\[\r\n\]+set history save -- Set saving of the history record on exit.*\[\r\n\]+set history size -- Set the size of the command history.*\[\r\n\]+Type \"help set history\" followed by set history subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "set history"
|
||||
#test set language
|
||||
gdb_test "set language" "The currently understood settings are:.*\[\r\n\]+local or auto *Automatic setting based on source file.*\[\r\n\]+c *Use the C language.*\[\r\n\]+c\[+\]+ *Use the C\[+\]+ language.*\[\r\n\]+modula-2 *Use the Modula-2 language.*" "set language"
|
||||
#test set listsize
|
||||
gdb_test "set listsize" "Argument required .integer to set it to.*" "set listsize"
|
||||
#test set print "p" abbreviation
|
||||
gdb_test "set p" "\"set print\" must be followed by the name of a print subcommand..*\[\r\n\]+List of set print subcommands:.*\[\r\n\]+Type \"help set print\" followed by set print subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "set print \"p\" abbreviation"
|
||||
#test set print "pr" abbreviation
|
||||
gdb_test "set pr" "\"set print\" must be followed by the name of a print subcommand..*\[\r\n\]+List of set print subcommands:.*\[\r\n\]+Type \"help set print\" followed by set print subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "set print \"pr\" abbreviation"
|
||||
#test set print
|
||||
gdb_test "set print" "\"set print\" must be followed by the name of a print subcommand..*\[\r\n\]+List of set print subcommands:.*\[\r\n\]+Type \"help set print\" followed by set print subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "set print"
|
||||
#test set print address
|
||||
gdb_test "set print address" "" "set print address"
|
||||
#test set print array
|
||||
gdb_test "set print array" "" "set print array"
|
||||
#test set print asm-demangle
|
||||
gdb_test "set print asm-demangle" "" "set print asm-demangle"
|
||||
#test set print demangle
|
||||
gdb_test "set print demangle" "" "set print demangle"
|
||||
#test set print elements
|
||||
gdb_test "set print elements" "Argument required .integer to set it to.*" "set print elements"
|
||||
#test set print object
|
||||
gdb_test "set print object" "" "set print object"
|
||||
#test set print pretty
|
||||
gdb_test "set print pretty" "" "set print pretty"
|
||||
#test set print sevenbit-strings
|
||||
gdb_test "set print sevenbit-strings" "" "set print sevenbit-strings"
|
||||
#test set print union
|
||||
gdb_test "set print union" "" "set print union"
|
||||
#test set print vtbl
|
||||
gdb_test "set print vtbl" "" "set print vtbl"
|
||||
# FIXME -- need a test for "set prompt"
|
||||
#test set radix
|
||||
gdb_test "set radix" "Input and output radices now set to decimal 10, hex a, octal 12.*" "set radix"
|
||||
#test set symbol-reloading
|
||||
gdb_test "set symbol-reloading" "" "set symbol-reloading"
|
||||
#test set variable
|
||||
gdb_test "set variable" "Argument required .expression to compute.*" "set variable"
|
||||
#test set verbose
|
||||
gdb_test "set verbose" "" "set verbose"
|
||||
#test set width
|
||||
gdb_test "set width" "Argument required .integer to set it to.*" "set width"
|
||||
#test set write
|
||||
# This is only supported on targets which use exec.o.
|
||||
gdb_test "set write" "" "set write"
|
||||
#test set
|
||||
gdb_test "set" "Argument required .expression to compute.*" "set"
|
||||
#test shell echo Hi dad!
|
||||
gdb_test "shell echo Hi dad!" "Hi dad!" "shell echo Hi dad!"
|
||||
#test show annotate
|
||||
gdb_test "show annotate" "Annotation_level is 0." "show annotate"
|
||||
#test show args
|
||||
gdb_test "show args" "Argument list to give program being debugged when it is started is \"\"." "show args"
|
||||
#test show check "c" abbreviation
|
||||
gdb_test "show c" "range: *Range checking is \"auto; currently off\"..*\[\r\n\]+type: *Type checking is \"auto; currently off\".*" "show check \"c\" abbreviation"
|
||||
#test show check "ch" abbreviation
|
||||
gdb_test "show ch" "range: *Range checking is \"auto; currently off\"..*\[\r\n\]+type: *Type checking is \"auto; currently off\"." "show check \"ch\" abbreviation"
|
||||
#test show check
|
||||
gdb_test "show check" "range: *Range checking is \"auto; currently off\"..*\[\r\n\]+type: *Type checking is \"auto; currently off\"." "show check"
|
||||
#test show check range
|
||||
gdb_test "show check range" "Range checking is \"auto; currently off\"." "show check range"
|
||||
#test show check type
|
||||
gdb_test "show check type" "Type checking is \"auto; currently off\"." "show check type"
|
||||
#test show commands
|
||||
gdb_test "show commands" "" "show commands"
|
||||
#test show complaints
|
||||
gdb_test "show complaints" "Max number of complaints about incorrect symbols is 0." "show complaints"
|
||||
#test show confirm
|
||||
gdb_test "show confirm" "Whether to confirm potentially dangerous operations is o\[a-z\]*." "show confirm"
|
||||
#test show convenience
|
||||
gdb_test "show convenience" "No debugger convenience variables now defined..*\[\r\n\]+Convenience variables have names starting with \".\";.*\[\r\n\]+use \"set\" as in \"set .foo = 5\" to define them." "show convenience"
|
||||
#test show directories
|
||||
gdb_test "show directories" "Source directories searched: .cdir:.cwd" "show directories"
|
||||
#test show editing
|
||||
gdb_test "show editing" "Editing of command lines as they are typed is o\[a-z\]*." "show editing"
|
||||
#test show height
|
||||
gdb_test "show height" "Number of lines gdb thinks are in a page is.*" "show height"
|
||||
#test show history expansion
|
||||
gdb_test "show history expansion" "History expansion on command input is o\[a-z\]*.*" "show history expansion"
|
||||
#test show history filename
|
||||
gdb_test "show history filename" "The filename in which to record the command history is.*.gdb_history.*" "show history filename"
|
||||
#test show history save
|
||||
gdb_test "show history save" "Saving of the history record on exit is on." "show history save"
|
||||
#test show history size
|
||||
gdb_test "show history size" "The size of the command history is.*" "show history size"
|
||||
#test show history
|
||||
gdb_test "show history" "expansion: *History expansion on command input is o.*\[\r\n\]+filename: *The filename in which to record the command history is.*.gdb_history.*\[\r\n\]+save: *Saving of the history record on exit is o.*\[\r\n\]+size: * The size of the command history is.*" "show history"
|
||||
#test show language
|
||||
gdb_test "show language" "The current source language is \"auto; currently c\"." "show language"
|
||||
#test show listsize
|
||||
gdb_test "show listsize" "Number of source lines gdb will list by default is 10." "show listsize"
|
||||
#test show print "p" abbreviation
|
||||
gdb_test "show p" ".*" "show p"
|
||||
#test show print "pr" abbreviation
|
||||
gdb_test "show pr" ".*" "show pr"
|
||||
#test show print
|
||||
gdb_test "show print" "" "show print"
|
||||
#test show paths
|
||||
gdb_test "show paths" "Executable and object file path:.*" "show paths"
|
||||
#test show print address
|
||||
gdb_test "show print address" "Printing of addresses is on." "show print address"
|
||||
#test show print array
|
||||
gdb_test "show print array" "Prettyprinting of arrays is on." "show print array"
|
||||
#test show print asm-demangle
|
||||
gdb_test "show print asm-demangle" "Demangling of C\[+\]+ names in disassembly listings is on." "show print asm-demangle"
|
||||
#test show print demangle
|
||||
gdb_test "show print demangle" "Demangling of encoded C\[+\]+ names when displaying symbols is on." "show print demangle"
|
||||
#test show print elements
|
||||
gdb_test "show print elements" "Limit on string chars or array elements to print is 200." "show print elements"
|
||||
#test show print object
|
||||
gdb_test "show print object" "Printing of object's derived type based on vtable info is on." "show print object"
|
||||
#test show print pretty
|
||||
gdb_test "show print pretty" "Prettyprinting of structures is on." "show print pretty"
|
||||
#test show print sevenbit-strings
|
||||
gdb_test "show print sevenbit-strings" "Printing of 8-bit characters in strings as .nnn is on." "show print sevenbit-strings"
|
||||
#test show print union
|
||||
gdb_test "show print union" "Printing of unions interior to structures is on." "show print union"
|
||||
#test show print vtbl
|
||||
gdb_test "show print vtbl" "Printing of C\[+\]+ virtual function tables is on." "show print vtbl"
|
||||
#test show prompt
|
||||
# In the FAIL case, can't just look for $gdb_prompt because that will match
|
||||
# the output, rather than the prompt. So look for $gdb_prompt at the start
|
||||
# of a line.
|
||||
gdb_test "show prompt" "Gdb's prompt is \"$gdb_prompt \".*" "show prompt"
|
||||
#test show radix
|
||||
gdb_test "show radix" "Input and output radices set to decimal 10, hex a, octal 12." "show radix"
|
||||
#test show symbol-reloading
|
||||
gdb_test "show symbol-reloading" "Dynamic symbol table reloading multiple times in one run is on." "show symbol-reloading"
|
||||
#test show user
|
||||
gdb_test "show user" "" "show user"
|
||||
#test show values
|
||||
gdb_test "show values" "" "show values"
|
||||
#test show verbose
|
||||
gdb_test "show verbose" "Verbose printing of informational messages is o.*|Verbosity is off.*" "show verbose"
|
||||
#test show version
|
||||
|
||||
gdb_test "show version" "GNU gdb \[0-9\.\]*.*\[\r\n\]+Copyright \[0-9\]* Free Software Foundation, Inc.*\[\r\n\]+GDB is free software, covered by the GNU General Public License, and you are.*\[\r\n\]+welcome to change it and/or distribute copies of it under certain conditions.*\[\r\n\]+Type \"show copying\" to see the conditions.*\[\r\n\]+There is absolutely no warranty for GDB. Type \"show warranty\" for details.*\[\r\n\]+This GDB was configured as .*|GDB is free software and you are welcome to distribute copies of it.*\[\r\n\]+ under certain conditions; type \"show copying\" to see the conditions..*\[\r\n\]+There is absolutely no warranty for GDB; type \"show warranty\" for details..*\[\r\n\]+GDB.*Copyright \[0-9\]* Free Software Foundation, Inc.*" "show version"
|
||||
#test show width
|
||||
gdb_test "show width" "Number of characters gdb thinks are in a line is.*" "show width"
|
||||
#test show write
|
||||
# This is only supported on targets which use exec.o.
|
||||
gdb_test "show write" "Writing into executable and core files is o.*" "show write"
|
||||
#test show
|
||||
gdb_test "show" "confirm: *Whether to confirm potentially dangerous operations is on..*\[\r\n\]+history filename: *The filename in which to record the command history is .*\[\r\n\]+history save: *Saving of the history record on exit is on..*\[\r\n\]+history size: *The size of the command history is.*\[\r\n\]+listsize: *Number of source lines gdb will list by default is 10.*\[\r\n\]+print elements: *Limit on string chars or array elements to print is 200..*" "show"
|
||||
#test stepi "si" abbreviation
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "si" "The program is not being run." "stepi \"si\" abbreviation"
|
||||
#test stepi
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "stepi" "The program is not being run." "stepi"
|
||||
#test signal
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "signal" "The program is not being run." "signal"
|
||||
#test source
|
||||
gdb_test "source" "source command requires pathname of file to source..*|No such file or directory.*" "source"
|
||||
#test step "s" abbreviation
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "s" "The program is not being run." "step \"s\" abbreviation #2"
|
||||
#test step
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "step" "The program is not being run." "step #2"
|
||||
#test symbol-file
|
||||
gdb_test "symbol-file" "" "symbol-file"
|
||||
|
||||
#test target child
|
||||
gdb_test "target child" "Use the \"run\" command to start a Unix child process.*|Undefined target command: \"child\". *Try \"help target\".*" "target child"
|
||||
|
||||
#test target procfs
|
||||
gdb_test "target procfs" "Use the \"run\" command to start a Unix child process.*|Undefined target command: \"procfs\". *Try \"help target\".*" "target procfs"
|
||||
|
||||
#test target core
|
||||
send_gdb "target core\n"
|
||||
gdb_expect {
|
||||
-re "No core file specified..*$gdb_prompt $" { pass "target core" }
|
||||
-re ".*A program is being debugged already. Kill it. .y or n.*$" {
|
||||
send_gdb "n\n"
|
||||
if $verbose>1 then {
|
||||
send_user "\t\tDidn't kill program being debugged\n"
|
||||
}
|
||||
gdb_expect -re "$gdb_prompt $" { }
|
||||
pass "target core"
|
||||
}
|
||||
-re "Undefined target command: \"core\". Try \"help target\"..*$gdb_prompt $" { pass "target core" }
|
||||
-re ".*$gdb_prompt $" { fail "target core" }
|
||||
timeout { fail "(timeout) target core" }
|
||||
}
|
||||
|
||||
#test target exec
|
||||
send_gdb "target exec\n"
|
||||
gdb_expect {
|
||||
-re "No executable file now..*$gdb_prompt $"\
|
||||
{ pass "target exec" }
|
||||
-re ".*A program is being debugged already. Kill it. .y or n.*$" {
|
||||
send_gdb "n\n"
|
||||
if $verbose>1 then {
|
||||
send_user "\t\tDidn't kill program being debugged\n"
|
||||
}
|
||||
gdb_expect -re "$gdb_prompt $" { }
|
||||
pass "target exec"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "target exec" }
|
||||
timeout { fail "(timeout) target exec" }
|
||||
}
|
||||
|
||||
#test target remote
|
||||
if ![istarget "*-*-udi*"] then {
|
||||
send_gdb "target remote\n"
|
||||
gdb_expect {
|
||||
-re "To open a remote debug connection, you need to specify what.*
|
||||
serial device is attached to the remote system .e.g. /dev/ttya.*$gdb_prompt $"\
|
||||
{ pass "target remote" }
|
||||
-re ".*A program is being debugged already. Kill it. .y or n.*$" {
|
||||
send_gdb "n\n"
|
||||
if $verbose>1 then {
|
||||
send_user "\t\tDidn't kill program being debugged\n"
|
||||
}
|
||||
gdb_expect -re "$gdb_prompt $" { }
|
||||
pass "target remote"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "target remote" }
|
||||
timeout { fail "(timeout) target remote" }
|
||||
}
|
||||
}
|
||||
|
||||
#test target
|
||||
gdb_test "target" "Argument required .target name.*" "target"
|
||||
#test tbreak
|
||||
gdb_test "tbreak" "No default breakpoint address now." "tbreak"
|
||||
#test tty
|
||||
gdb_test "tty" "Argument required .terminal name for running target process.*" "tty"
|
||||
#test until "u" abbreviation
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "u" "The program is not running." "until \"u\" abbreviation"
|
||||
#test until
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "until" "The program is not running." "until"
|
||||
#test undisplay
|
||||
# FIXME -- need to dump full output to detailed log
|
||||
send_gdb "undisplay\n"
|
||||
gdb_expect {
|
||||
-re "Delete all auto-display expressions.*y or n. $" {
|
||||
send_gdb "y\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $" { pass "undisplay prompt" }
|
||||
timeout { fail "(timeout) (timeout) undisplay prompt" }
|
||||
}
|
||||
}
|
||||
timeout { fail "(timeout) (timeout) undisplay prompt" }
|
||||
}
|
||||
|
||||
#test unset environment
|
||||
send_gdb "unset environment\n"
|
||||
gdb_expect {
|
||||
-re "Delete all environment variables?.*y or n. $" {
|
||||
send_gdb "y\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $" { pass "unset environmentprompt" }
|
||||
timeout {
|
||||
fail "(timeout) (timeout) unset environment prompt"
|
||||
}
|
||||
}
|
||||
}
|
||||
timeout {
|
||||
fail "(timeout) (timeout) unset environment prompt"
|
||||
}
|
||||
}
|
||||
|
||||
#test unset
|
||||
gdb_test "unset" "\"unset\" must be followed by the name of an unset subcommand..*\[\r\n\]+List of unset subcommands:.*\[\r\n\]+unset environment -- Cancel environment variable VAR for the program.*\[\r\n\]+Type \"help unset\" followed by unset subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "unset"
|
||||
#test up
|
||||
#test up-silently
|
||||
gdb_test "up-silently" "No stack." "up-silently"
|
||||
#test watch
|
||||
gdb_test "watch" "Argument required .expression to compute.*" "watch"
|
||||
#test whatis
|
||||
gdb_test "whatis" "The history is empty." "whatis"
|
||||
#test where
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "where" "No stack." "where"
|
||||
#test x
|
||||
#The case in which it prints a number is for vxgdb.
|
||||
gdb_test "x" "0x0:.*0x\[0-9\]*|0x0:.*Cannot access memory at address 0x0." "x"
|
||||
|
||||
gdb_exit
|
||||
304
gdb/testsuite/gdb.base/define.exp
Normal file
304
gdb/testsuite/gdb.base/define.exp
Normal file
@@ -0,0 +1,304 @@
|
||||
# Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# This file was written by Elena Zannoni. (ezannoni@cygnus.com)
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
global usestubs
|
||||
|
||||
|
||||
#
|
||||
# test running programs
|
||||
#
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile "break"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
if ![runto_main] then { fail "define tests suppressed" }
|
||||
|
||||
# Verify that GDB allows a user to define their very own commands.
|
||||
#
|
||||
send_gdb "define nextwhere\n"
|
||||
gdb_expect {
|
||||
-re "Type commands for definition of \"nextwhere\".\r\nEnd with a line saying just \"end\".\r\n>$"\
|
||||
{send_gdb "next\nbt\nend\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "define user command: nextwhere"}
|
||||
timeout {fail "(timeout) define user command: nextwhere"}
|
||||
}
|
||||
}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "define user command: nextwhere"}
|
||||
timeout {fail "(timeout) define user command: nextwhere"}
|
||||
}
|
||||
|
||||
# Verify that those commands work as gdb_expected.
|
||||
#
|
||||
send_gdb "nextwhere\n"
|
||||
gdb_expect {
|
||||
-re ".*64\[ \t\]*printf.*#0\[ \t\]*main.*:64.*$gdb_prompt $"\
|
||||
{pass "use user command: nextwhere"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "use user command: nextwhere"}
|
||||
timeout {fail "(timeout) use user command: nextwhere"}
|
||||
}
|
||||
|
||||
# Verify that a user can define a command whose spelling is a
|
||||
# proper substring of another user-defined command.
|
||||
#
|
||||
send_gdb "define nextwh\n"
|
||||
gdb_expect {
|
||||
-re "Type commands for definition of \"nextwh\".\r\nEnd with a line saying just \"end\".\r\n>$"\
|
||||
{send_gdb "next 2\nbt\nend\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "define user command: nextwh"}
|
||||
timeout {fail "(timeout) define user command: nextwh"}
|
||||
}
|
||||
}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "define user command: nextwh"}
|
||||
timeout {fail "(timeout) define user command: nextwh"}
|
||||
}
|
||||
|
||||
# Verify that a user can redefine their commands. (Test both the
|
||||
# confirmed and unconfirmed cases.)
|
||||
#
|
||||
send_gdb "define nextwhere\n"
|
||||
gdb_expect {
|
||||
-re "Redefine command \"nextwhere\".*y or n. $"\
|
||||
{send_gdb "n\n"
|
||||
gdb_expect {
|
||||
-re "Command \"nextwhere\" not redefined.*$gdb_prompt $"\
|
||||
{pass "redefine user command aborted: nextwhere"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "redefine user command aborted: nextwhere"}
|
||||
timeout {fail "(timeout) redefine user command aborted: nextwhere"}
|
||||
}
|
||||
}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "redefine user command aborted: nextwhere"}
|
||||
timeout {fail "(timeout) redefine user command aborted: nextwhere"}
|
||||
}
|
||||
|
||||
send_gdb "define nextwhere\n"
|
||||
gdb_expect {
|
||||
-re "Redefine command \"nextwhere\".*y or n. $"\
|
||||
{send_gdb "y\n"
|
||||
gdb_expect {
|
||||
-re "Type commands for definition of \"nextwhere\".\r\nEnd with a line saying just \"end\".\r\n>$"\
|
||||
{send_gdb "bt\nnext\nend\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "redefine user command: nextwhere"}
|
||||
timeout {fail "(timeout) redefine user command: nextwhere"}
|
||||
}
|
||||
}
|
||||
timeout {fail "(timeout) redefine user command: nextwhere"}
|
||||
}
|
||||
}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "redefine user command: nextwhere"}
|
||||
timeout {fail "(timeout) redefine user command: nextwhere"}
|
||||
}
|
||||
|
||||
# Verify that GDB gracefully handles an attempt to redefine the
|
||||
# help text for a builtin command.
|
||||
#
|
||||
send_gdb "document step\n"
|
||||
gdb_expect {
|
||||
-re "Command \"step\" is built-in..*$gdb_prompt $"\
|
||||
{pass "redocumenting builtin command disallowed"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "redocumenting builtin command disallowed"}
|
||||
timeout {fail "(timeout) redocumenting builtin command disallowed"}
|
||||
}
|
||||
|
||||
# Verify that a user can document their own commands. (And redocument
|
||||
# them.)
|
||||
#
|
||||
send_gdb "document nextwhere\n"
|
||||
gdb_expect {
|
||||
-re "Type documentation for \"nextwhere\".\r\nEnd with a line saying just \"end\".\r\n>$"\
|
||||
{send_gdb "A next command that frist shows you where you're stepping from.\nend\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "document user command: nextwhere"}
|
||||
timeout {fail "(timeout) document user command: nextwhere"}
|
||||
}
|
||||
}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "documenting user command: nextwhere"}
|
||||
timeout {fail "(timeout) documenting user command: nextwhere"}
|
||||
}
|
||||
|
||||
send_gdb "document nextwhere\n"
|
||||
gdb_expect {
|
||||
-re "Type documentation for \"nextwhere\".\r\nEnd with a line saying just \"end\".\r\n>$"\
|
||||
{send_gdb "A next command that first shows you where you're stepping from.\nend\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "document user command: nextwhere"}
|
||||
timeout {fail "(timeout) document user command: nextwhere"}
|
||||
}
|
||||
}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "documenting user command: nextwhere"}
|
||||
timeout {fail "(timeout) documenting user command: nextwhere"}
|
||||
}
|
||||
|
||||
send_gdb "help nextwhere\n"
|
||||
gdb_expect {
|
||||
-re "A next command that first shows you where you're stepping from.\r\n$gdb_prompt $"\
|
||||
{pass "help user command: nextwhere"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "help user command: nextwhere"}
|
||||
timeout {fail "(timeout) help user command: nextwhere"}
|
||||
}
|
||||
|
||||
# Verify that the user can "hook" a builtin command. We choose to
|
||||
# hook the "stop" pseudo command, and we'll define it to use a user-
|
||||
# define command.
|
||||
#
|
||||
send_gdb "define user-bt\n"
|
||||
gdb_expect {
|
||||
-re "Type commands for definition of \"user-bt\".\r\nEnd with a line saying just \"end\".\r\n>$"\
|
||||
{send_gdb "bt\nend\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "define user command: user-bt"}
|
||||
timeout {fail "(timeout) define user command: user-bt"}
|
||||
}
|
||||
}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "define user command: user-bt"}
|
||||
timeout {fail "(timeout) define user command: user-bt"}
|
||||
}
|
||||
|
||||
send_gdb "define hook-stop\n"
|
||||
gdb_expect {
|
||||
-re "Type commands for definition of \"hook-stop\".\r\nEnd with a line saying just \"end\".\r\n>$"\
|
||||
{send_gdb "user-b\nend\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "define hook-stop command"}
|
||||
timeout {fail "(timeout) define hook-stop command"}
|
||||
}
|
||||
}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "define hook-stop command"}
|
||||
timeout {fail "(timeout) define hook-stop command"}
|
||||
}
|
||||
|
||||
send_gdb "next\n"
|
||||
gdb_expect {
|
||||
-re "#0\[ \t\]*main.*:66.*$gdb_prompt $"\
|
||||
{pass "use hook-stop command"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "use hook-stop command"}
|
||||
timeout {fail "(timeout) use hook-stop command"}
|
||||
}
|
||||
|
||||
# Verify that GDB responds gracefully to an attempt to define a "hook
|
||||
# command" which doesn't exist. (Test both the confirmed and unconfirmed
|
||||
# cases.)
|
||||
#
|
||||
send_gdb "define hook-bar\n"
|
||||
gdb_expect {
|
||||
-re "warning: Your new `hook-bar' command does not hook any existing command.\r\nProceed.*y or n. $"\
|
||||
{send_gdb "n\n"
|
||||
gdb_expect {
|
||||
-re "Not confirmed.*$gdb_prompt $"\
|
||||
{pass "define hook undefined command aborted: bar"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "define hook undefined command aborted: bar"}
|
||||
timeout {fail "(timeout) define hook undefined command aborted: bar"}
|
||||
}
|
||||
}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "define hook undefined command aborted: bar"}
|
||||
timeout {fail "(timeout) define hook undefined command aborted: bar"}
|
||||
}
|
||||
|
||||
send_gdb "define hook-bar\n"
|
||||
gdb_expect {
|
||||
-re "warning: Your new `hook-bar' command does not hook any existing command.\r\nProceed.*y or n. $"\
|
||||
{send_gdb "y\n"
|
||||
gdb_expect {
|
||||
-re "Type commands for definition of \"hook-bar\".\r\nEnd with a line saying just \"end\".\r\n>$"\
|
||||
{send_gdb "nextwhere\nend\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "define hook undefined command: bar"}
|
||||
timeout {fail "(timeout) define hook undefined command: bar"}
|
||||
}
|
||||
}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "define hook undefined command: bar"}
|
||||
timeout {fail "(timeout) define hook undefined command: bar"}
|
||||
}
|
||||
}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "define hook undefined command: bar"}
|
||||
timeout {fail "(timeout) define hook undefined command: bar"}
|
||||
}
|
||||
|
||||
# This is a quasi-define command: Verify that the user can redefine
|
||||
# GDB's gdb_prompt.
|
||||
#
|
||||
send_gdb "set prompt \\(blah\\) \n"
|
||||
gdb_expect {
|
||||
-re "\\(blah\\) $"\
|
||||
{pass "set gdb_prompt"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "set gdb_prompt"}
|
||||
timeout {fail "(timeout) set gdb_prompt"}
|
||||
}
|
||||
|
||||
send_gdb "set prompt \\(gdb\\) \n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "reset gdb_prompt"}
|
||||
timeout {fail "(timeout) reset gdb_prompt"}
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
52
gdb/testsuite/gdb.base/display.c
Normal file
52
gdb/testsuite/gdb.base/display.c
Normal file
@@ -0,0 +1,52 @@
|
||||
/* Loop and vars for tests of display commands
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#define LOOP 10
|
||||
|
||||
int sum = 0;
|
||||
|
||||
int do_loops()
|
||||
{
|
||||
int i=0;
|
||||
int k=0;
|
||||
int j=0;
|
||||
|
||||
for( i = 0; i < LOOP; i++ ) {
|
||||
for( j = 0; j < LOOP; j++ ) {
|
||||
for( k = 0; k < LOOP; k++ ) {
|
||||
sum++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
int do_vars()
|
||||
{
|
||||
int j;
|
||||
int i = 9;
|
||||
float f = 1.234;
|
||||
char c = 'Q';
|
||||
int *p_i = &i;
|
||||
float *p_f = &f;
|
||||
char *p_c = "rubarb and fries";
|
||||
|
||||
/* Need some code here to set breaks on.
|
||||
*/
|
||||
for( j = 0; j < LOOP; j++ ) {
|
||||
if( p_c[j] == c ) {
|
||||
j++;
|
||||
}
|
||||
else {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
return *p_i;
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
do_loops();
|
||||
do_vars();
|
||||
}
|
||||
147
gdb/testsuite/gdb.base/display.exp
Normal file
147
gdb/testsuite/gdb.base/display.exp
Normal file
@@ -0,0 +1,147 @@
|
||||
# Copyright (C) 1997, 1998
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# display.exp Test display commands
|
||||
# Also do some printing stuff for coverage's sake.
|
||||
#
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
set testfile display
|
||||
set srcfile ${srcdir}/${subdir}/${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
|
||||
|
||||
if { [gdb_compile "${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
if [target_info exists gdb_stub] {
|
||||
gdb_step_for_stub;
|
||||
}
|
||||
|
||||
|
||||
# use this to debug:
|
||||
#log_user 1
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
# Ok, on to real life
|
||||
#
|
||||
gdb_test "b main" ".*Breakpoint 1.*" "break main"
|
||||
gdb_test "r" ".*Breakpoint 1, main.*" "get to main"
|
||||
gdb_test "b 14" ".*Breakpoint 2.*" "break do_loops"
|
||||
gdb_test "c" ".*Breakpoint 2, do_loops.*" "get to do_loops"
|
||||
|
||||
# Create stopping points.
|
||||
#
|
||||
gdb_test "wat sum" ".*\[Ww\]atchpoint 3: sum.*" "set watch"
|
||||
gdb_test "b 19" ".*Breakpoint 4.*" "break 19"
|
||||
|
||||
# Create displays for those points
|
||||
#
|
||||
gdb_test "info disp" ".*There are no auto-display expressions now..*" "inf disp"
|
||||
gdb_test "disp i" ".*1: i = 0.*" "display i"
|
||||
gdb_test "disp/x j" ".*2: /x j = 0x0.*" "display j"
|
||||
gdb_test "disp/i &k" ".*3: x/i &k $hex:.*" "display &k"
|
||||
gdb_test "disp/f sum" ".*4: /f sum = 0.*" "display/f sum"
|
||||
gdb_test "disp/s &sum" ".*5: x/s &sum $hex.*sum.:.*" "display/s &sum"
|
||||
|
||||
# Hit the displays
|
||||
#
|
||||
gdb_test "c" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: x/s &sum.*\[1-9\]*: /f sum = 1.40129846e.45\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0\r\n\[1-9\]*: i = 0.*" "first disp"
|
||||
gdb_test "c" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: x/s &sum.*\[1-9\]*: /f sum = 2.80259693e.45\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0.*\[1-9\]*: i = 0.*" "second disp"
|
||||
|
||||
gdb_test "enab disp 6" ".*No display number 6..*" "catch err"
|
||||
gdb_test "disab disp 1" ".*" "disab"
|
||||
gdb_test "disab disp 2" ".*" ""
|
||||
gdb_test "enab disp 1" ".*" "re-enab"
|
||||
gdb_test "enab disp 1" ".*" "re-enab of enab"
|
||||
gdb_test "undisp 5" ".*" "undisp"
|
||||
gdb_test "i disp" ".*Auto-display expressions now in effect.*y /f sum.*y /1bi &k.*n /x j.*y i.*" "info disp"
|
||||
|
||||
gdb_test "c" ".*\[Ww\]atch.*4.20389539e-45.*.*i = 0.*" "next hit"
|
||||
|
||||
send_gdb "undisp\n"
|
||||
gdb_expect {
|
||||
-re ".*Delete all auto-display expressions.*y or n. $" {
|
||||
send_gdb "y\n"
|
||||
gdb_expect {
|
||||
-re "y\r\n$gdb_prompt $" {
|
||||
pass "undisp all"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "some un-helpful response"
|
||||
}
|
||||
-re ".*Delete all.*$" {
|
||||
fail "re-ask question"
|
||||
}
|
||||
timeout { fail "timeout" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "undisp all"
|
||||
}
|
||||
timeout { fail "timeout" }
|
||||
}
|
||||
|
||||
gdb_test "disab 3" ".*.*" ""
|
||||
gdb_test "c" ".*Breakpoint 4.*" "watch off"
|
||||
|
||||
# Now the printf tests
|
||||
#
|
||||
gdb_test "fin" ".*Run till exit.*Value returned is.*= 10.*" "finish"
|
||||
gdb_test "s" ".*do_vars.*.*25" ""
|
||||
gdb_test "tb 35" ".*Breakpoint 5 a.*" ""
|
||||
gdb_test "c" ".*do_vars.*35.*35.*" ""
|
||||
|
||||
# Beat on printf a bit
|
||||
#
|
||||
gdb_test "printf" ".*Argument required.*" ""
|
||||
gdb_test "printf %d" ".*Bad format string, missing.*" ""
|
||||
gdb_test "printf \"%d" ".*Bad format string, non-terminated.*" ""
|
||||
gdb_test "printf \"%d%d\",i" ".*Wrong number of arguments.*" ""
|
||||
gdb_test "printf \"\\\\!\\a\\f\\r\\t\\v\\b\"" ".*!.*" ""
|
||||
gdb_test "printf \"\"" ".*" "re-set term"
|
||||
gdb_test "printf \"\\w\"" ".*Unrecognized escape character.*" ""
|
||||
gdb_test "printf \"%d\" j" ".*Invalid argument syntax.*" ""
|
||||
|
||||
# play with "p", too
|
||||
#
|
||||
gdb_test "p/r j" ".*Undefined output format.*" ""
|
||||
#gdb_test "x/rx j" ".*Cannot access memory.*" "no error!"
|
||||
gdb_test "x/0 j" ".*" "x/0 j"
|
||||
gdb_test "p/0 j" ".*Item count other than 1 is meaningless.*" "p/0 j"
|
||||
gdb_test "p/s sum" ".*Format letter.*is meaningless.*" " no s"
|
||||
gdb_test "p/i sum" ".*Format letter.*is meaningless.*.*" "no i"
|
||||
gdb_test "p/a &sum" ".*= 0x.*<sum>.*" ""
|
||||
gdb_test "p/a main+1000" ".*= 0x.*<.*>.*" ""
|
||||
gdb_test "p/a \\\$pc" ".*= 0x.*<do_vars+.*>.*" ""
|
||||
gdb_test "p/a &j" ".*= 0x.*<.*>.*" ""
|
||||
gdb_test "p/a &&j" ".*A syntax error.*" ""
|
||||
|
||||
# Done!
|
||||
#
|
||||
gdb_exit
|
||||
return 0
|
||||
128
gdb/testsuite/gdb.base/dollar.exp
Normal file
128
gdb/testsuite/gdb.base/dollar.exp
Normal file
@@ -0,0 +1,128 @@
|
||||
# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# GDB tests for names beginning with '$'
|
||||
|
||||
# This is aimed at HP-UX systems where a lot of system
|
||||
# routines and names begin with '$' or '$$'. GDB 4.16 was
|
||||
# unable to deal with these names as they clashed with
|
||||
# convenience variables. Wildebeest should accept such
|
||||
# names in preference to convenience variables.
|
||||
|
||||
# This file was written by Satish Pai <pai@apollo.hp.com>
|
||||
# 1997-09-24
|
||||
|
||||
if ![ istarget "*-*-hpux*" ] then {
|
||||
return
|
||||
}
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
#
|
||||
# test running programs
|
||||
#
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile "exprs"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
#source ${binfile}.ci
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
#
|
||||
# set it up at a breakpoint so we can play with the variable values
|
||||
#
|
||||
|
||||
if ![runto_main] then {
|
||||
perror "couldn't run to breakpoint"
|
||||
continue
|
||||
}
|
||||
|
||||
# Test for millicode routines
|
||||
send_gdb "print \$\$dyncall\n"
|
||||
gdb_expect {
|
||||
-re "\\$\[0-9\]* = \\{<text variable, no debug info>\\} $hex <>.*$gdb_prompt $" { pass "print \$\$dyncall" }
|
||||
-re "\\$\[0-9\]* = void" { fail "print \$\$dyncall -- interpreted as convenience var" }
|
||||
-re "$gdb_prompt $" { fail "print \$\$dyncall" }
|
||||
timeout { fail "(timeout) print \$\$dyncall" }
|
||||
}
|
||||
send_gdb "print \$\$dyncall_external\n"
|
||||
gdb_expect {
|
||||
-re "\\$\[0-9\]* = \\{<text variable, no debug info>\\} $hex <>.*$gdb_prompt $" { pass "print \$\$dyncall_external" }
|
||||
-re "\\$\[0-9\]* = void" { fail "print \$\$dyncall_external -- interpreted as convenience var" }
|
||||
-re "$gdb_prompt $" { fail "print \$\$dyncall_external" }
|
||||
timeout { fail "(timeout) print \$\$dyncall_external" }
|
||||
}
|
||||
|
||||
# Set a breakpoint on a millicode routine
|
||||
send_gdb "break \$\$dyncall\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint \[0-9\]* at $hex.*$gdb_prompt $" { pass "break \$\$dyncall" }
|
||||
-re "Function.*not defined.*$gdb_prompt $" {fail "break \$\$dyncall -- no \$\$dyncall?" }
|
||||
-re "Convenience variables used in line specs must have integer values\\..*$gdb_prompt $" {
|
||||
fail "break \$\$dyncall -- treated as convenince variable"
|
||||
}
|
||||
-re "$gdb_prompt $" { fail "print break \$\$dyncall" }
|
||||
timeout { fail "(timeout) print break \$\$dyncall" }
|
||||
}
|
||||
|
||||
# Disassemble $$dyncall
|
||||
send_gdb "disassemble \$\$dyncall\n"
|
||||
gdb_expect {
|
||||
-re "Dump of assembler code for function.*$gdb_prompt $" { pass "disas \$\$dyncall" }
|
||||
-re "$gdb_prompt $" { fail "disas \$\$dyncall" }
|
||||
timeout { fail "(timeout) disas \$\$dyncall" }
|
||||
}
|
||||
|
||||
# Try to set $$dyncall like a convenience var.
|
||||
send_gdb "set \$\$dyncall = 77\n"
|
||||
gdb_expect {
|
||||
-re "Invalid cast.*$gdb_prompt $" { pass "set \$\$dyncall = 77" }
|
||||
-re "$gdb_prompt $" { fail "set \$\$dyncall = 77" }
|
||||
timeout { fail "(timeout) set \$\$dyncall = 77" }
|
||||
}
|
||||
|
||||
# Try out some other $ name, not millicode
|
||||
send_gdb "print \$ARGV\n"
|
||||
gdb_expect {
|
||||
-re "\\$\[0-9\]* = \[0-9\]*.*$gdb_prompt $" { pass "print \$ARGV" }
|
||||
-re "\\$\[0-9\]* = void.*$gdb_prompt $" { fail "print \$ARGV (interpreted as convenience var)" }
|
||||
-re "$gdb_prompt $" { fail "print \$ARGV" }
|
||||
timeout { fail "(timeout) print \$ARGV" }
|
||||
}
|
||||
send_gdb "ptype \$ARGV\n"
|
||||
gdb_expect {
|
||||
-re "type = <data variable, no debug info>.*$gdb_prompt $" { pass "ptype \$ARGV" }
|
||||
-re "type = void.*$gdb_prompt $" { fail "ptype \$ARGV (interpreted as convenience var)" }
|
||||
-re "$gdb_prompt $" { fail "ptype \$ARGV" }
|
||||
timeout { fail "(timeout) ptype \$ARGV" }
|
||||
}
|
||||
|
||||
44
gdb/testsuite/gdb.base/echo.exp
Normal file
44
gdb/testsuite/gdb.base/echo.exp
Normal file
@@ -0,0 +1,44 @@
|
||||
# Copyright (C) 1988, 1990, 1991, 1992, 1997 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# 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)
|
||||
|
||||
# Crank up gdb.
|
||||
gdb_start
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
#
|
||||
# test the echo command
|
||||
#
|
||||
|
||||
# this sets the prms id number. This is the number that will appear
|
||||
# on all the output logs.
|
||||
# ex: set prms_id 643
|
||||
set prms_id 0
|
||||
|
||||
# this sets the bug id id. This is the number that will appear
|
||||
# on all the output logs. This is optional and if it is not set
|
||||
# it will appear on all output logs as a 0.
|
||||
# ex: set bug_id 12
|
||||
set bug_id 0
|
||||
|
||||
gdb_test "echo Hello world!\\n" "Hello world!" "Echo test"
|
||||
525
gdb/testsuite/gdb.base/ena-dis-br.exp
Normal file
525
gdb/testsuite/gdb.base/ena-dis-br.exp
Normal file
@@ -0,0 +1,525 @@
|
||||
# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
global usestubs
|
||||
|
||||
#
|
||||
# test running programs
|
||||
#
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile "break"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
if ![runto_main] then { fail "enable/disable break tests suppressed" }
|
||||
|
||||
# Verify that we can set a breakpoint (the location is irrelevant),
|
||||
# then enable it (yes, it's already enabled by default), then hit it.
|
||||
#
|
||||
send_gdb "break marker1\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 41.*$gdb_prompt $"\
|
||||
{pass "break marker1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "break marker1"}
|
||||
timeout {fail "(timeout) break marker1"}
|
||||
}
|
||||
|
||||
send_gdb "enable $expect_out(1,string)\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "enable break marker1"}
|
||||
timeout {fail "(timeout) enable break marker1"}
|
||||
}
|
||||
|
||||
send_gdb "info break $expect_out(1,string)\n"
|
||||
gdb_expect {
|
||||
-re "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y.*$gdb_prompt $"\
|
||||
{pass "info break marker1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "info break marker1"}
|
||||
timeout {fail "(timeout) info break marker1"}
|
||||
}
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint \[0-9\]*, marker1.*$gdb_prompt $"\
|
||||
{pass "continue to break marker1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "continue to break marker1"}
|
||||
timeout {fail "(timeout) continue to break marker1"}
|
||||
}
|
||||
|
||||
send_gdb "delete $expect_out(1,string)\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "delete break marker1"}
|
||||
timeout {fail "(timeout) delete break marker1"}
|
||||
}
|
||||
|
||||
# Verify that we can set a breakpoint to be self-disabling after
|
||||
# the first time it triggers.
|
||||
#
|
||||
send_gdb "break marker2\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 42.*$gdb_prompt $"\
|
||||
{pass "break marker2"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "break marker2"}
|
||||
timeout {fail "(timeout) break marker2"}
|
||||
}
|
||||
|
||||
send_gdb "enable once $expect_out(1,string)\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "enable once break marker2"}
|
||||
timeout {fail "(timeout) enable once break marker2"}
|
||||
}
|
||||
|
||||
send_gdb "info break $expect_out(1,string)\n"
|
||||
gdb_expect {
|
||||
-re "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+dis\[ \t\]+y.*$gdb_prompt $"\
|
||||
{pass "info auto-disabled break marker2"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "info auto-disabled break marker2"}
|
||||
timeout {fail "(timeout) info auto-disabled break marker2"}
|
||||
}
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint \[0-9\]*, marker2.*$gdb_prompt $"\
|
||||
{pass "continue to auto-disabled break marker2"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "continue to auto-disabled break marker2"}
|
||||
timeout {fail "(timeout) continue to auto-disabled break marker2"}
|
||||
}
|
||||
|
||||
send_gdb "info break $expect_out(1,string)\n"
|
||||
gdb_expect {
|
||||
-re "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+dis\[ \t\]+n.*$gdb_prompt $"\
|
||||
{pass "info auto-disabled break marker2"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "info auto-disabled break marker2"}
|
||||
timeout {fail "(timeout) info auto-disabled break marker2"}
|
||||
}
|
||||
|
||||
# Verify that we don't stop at a disabled breakpoint.
|
||||
#
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re ".*Program exited normally.*$gdb_prompt $"\
|
||||
{pass "no stop"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "no stop"}
|
||||
timeout {fail "(timeout) no stop"}
|
||||
}
|
||||
|
||||
send_gdb "run\n"
|
||||
gdb_expect {
|
||||
-re "Starting program.*$gdb_prompt $"\
|
||||
{pass "rerun to main"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "rerun to main"}
|
||||
timeout {fail "(timeout) rerun to main"}
|
||||
}
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re ".*Program exited normally.*$gdb_prompt $"\
|
||||
{pass "no stop at auto-disabled break marker2"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "no stop at auto-disabled break marker2"}
|
||||
timeout {fail "(timeout) no stop at auto-disabled break marker2"}
|
||||
}
|
||||
|
||||
# Verify that we can set a breakpoint to be self-deleting after
|
||||
# the first time it triggers.
|
||||
#
|
||||
if ![runto_main] then { fail "enable/disable break tests suppressed" }
|
||||
|
||||
send_gdb "break marker3\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 43.*$gdb_prompt $"\
|
||||
{pass "break marker3"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "break marker3"}
|
||||
timeout {fail "(timeout) break marker3"}
|
||||
}
|
||||
|
||||
send_gdb "enable del $expect_out(1,string)\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "enable del break marker3"}
|
||||
timeout {fail "(timeout) enable del break marker3"}
|
||||
}
|
||||
|
||||
send_gdb "info break $expect_out(1,string)\n"
|
||||
gdb_expect {
|
||||
-re "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+del\[ \t\]+y.*$gdb_prompt $"\
|
||||
{pass "info auto-deleted break marker2"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "info auto-deleted break marker2"}
|
||||
timeout {fail "(timeout) info auto-deleted break marker2"}
|
||||
}
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re ".*marker3 .*:43.*$gdb_prompt $"\
|
||||
{pass "continue to auto-deleted break marker3"}
|
||||
-re "Breakpoint \[0-9\]*, marker3.*$gdb_prompt $"\
|
||||
{fail "continue to auto-deleted break marker3"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "continue to auto-deleted break marker3"}
|
||||
timeout {fail "(timeout) continue to break marker3"}
|
||||
}
|
||||
|
||||
send_gdb "info break $expect_out(1,string)\n"
|
||||
gdb_expect {
|
||||
-re ".*No breakpoint or watchpoint number.*$gdb_prompt $"\
|
||||
{pass "info auto-deleted break marker3"}
|
||||
-re "\[0-9\]*\[ \t\]+breakpoint\[ \t\].*$gdb_prompt $"\
|
||||
{fail "info auto-deleted break marker3"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "info auto-deleted break marker3"}
|
||||
timeout {fail "(timeout) info auto-deleted break marker3"}
|
||||
}
|
||||
|
||||
# Verify that we can set a breakpoint and manually disable it (we've
|
||||
# already proven that disabled bp's don't trigger).
|
||||
#
|
||||
send_gdb "break marker4\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 44.*$gdb_prompt $"\
|
||||
{pass "break marker4"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "break marker4"}
|
||||
timeout {fail "(timeout) break marker4"}
|
||||
}
|
||||
|
||||
send_gdb "disable $expect_out(1,string)\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "disable break marker4"}
|
||||
timeout {fail "(timeout) disable break marker4"}
|
||||
}
|
||||
|
||||
send_gdb "info break $expect_out(1,string)\n"
|
||||
gdb_expect {
|
||||
-re "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+n.*$gdb_prompt $"\
|
||||
{pass "info break marker4"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "info break marker4"}
|
||||
timeout {fail "(timeout) info break marker4"}
|
||||
}
|
||||
|
||||
# Verify that we can set a breakpoint with an ignore count N, which
|
||||
# should cause the next N triggers of the bp to be ignored. (This is
|
||||
# a flavor of enablement/disablement, after all.)
|
||||
#
|
||||
if ![runto_main] then { fail "enable/disable break tests suppressed" }
|
||||
|
||||
send_gdb "break marker1\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 41.*$gdb_prompt $"\
|
||||
{pass "break marker1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "break marker1"}
|
||||
timeout {fail "(timeout) break marker1"}
|
||||
}
|
||||
|
||||
# Verify that an ignore of a non-existent breakpoint is gracefully
|
||||
# handled.
|
||||
#
|
||||
send_gdb "ignore 999 2\n"
|
||||
gdb_expect {
|
||||
-re "No breakpoint number 999..*$gdb_prompt $"\
|
||||
{pass "ignore non-existent break"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "ignore non-existent break"}
|
||||
timeout {fail "(timeout) ignore non-existent break"}
|
||||
}
|
||||
|
||||
# Verify that a missing ignore count is gracefully handled.
|
||||
#
|
||||
send_gdb "ignore $expect_out(1,string) \n"
|
||||
gdb_expect {
|
||||
-re "Second argument .specified ignore-count. is missing..*$gdb_prompt $"\
|
||||
{pass "ignore break with missing ignore count"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "ignore break with missing ignore count"}
|
||||
timeout {fail "(timeout) ignore break with missing ignore count"}
|
||||
}
|
||||
|
||||
# Verify that a negative or zero ignore count is handled gracefully
|
||||
# (they both are treated the same).
|
||||
#
|
||||
send_gdb "ignore $expect_out(1,string) -1\n"
|
||||
gdb_expect {
|
||||
-re "Will stop next time breakpoint \[0-9\]* is reached..*$gdb_prompt $"\
|
||||
{pass "ignore break marker1 -1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "ignore break marker1 -1"}
|
||||
timeout {fail "(timeout) ignore break marker1 -1"}
|
||||
}
|
||||
|
||||
send_gdb "ignore $expect_out(1,string) 0\n"
|
||||
gdb_expect {
|
||||
-re "Will stop next time breakpoint \[0-9\]* is reached..*$gdb_prompt $"\
|
||||
{pass "ignore break marker1 0"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "ignore break marker1 0"}
|
||||
timeout {fail "(timeout) ignore break marker1 0"}
|
||||
}
|
||||
|
||||
send_gdb "ignore $expect_out(1,string) 1\n"
|
||||
gdb_expect {
|
||||
-re "Will ignore next crossing of breakpoint \[0-9\]*.*$gdb_prompt $"\
|
||||
{pass "ignore break marker1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "ignore break marker1"}
|
||||
timeout {fail "(timeout) ignore break marker1"}
|
||||
}
|
||||
|
||||
send_gdb "info break $expect_out(1,string)\n"
|
||||
gdb_expect {
|
||||
-re "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y.*ignore next 1 hits.*$gdb_prompt $"\
|
||||
{pass "info ignored break marker1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "info ignored break marker1"}
|
||||
timeout {fail "(timeout) info ignored break marker1"}
|
||||
}
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re ".*Program exited normally.*$gdb_prompt $"\
|
||||
{pass "no stop at ignored break marker1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "no stop at ignored break marker1"}
|
||||
timeout {fail "(timeout) no stop at ignored break marker1"}
|
||||
}
|
||||
|
||||
send_gdb "run\n"
|
||||
gdb_expect {
|
||||
-re "Starting program.*$gdb_prompt $"\
|
||||
{pass "rerun to main"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "rerun to main"}
|
||||
timeout {fail "(timeout) rerun to main"}
|
||||
}
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint \[0-9\]*, marker1.*$gdb_prompt $"\
|
||||
{pass "continue to break marker1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "continue to break marker1"}
|
||||
timeout {fail "(timeout) continue to break marker1"}
|
||||
}
|
||||
|
||||
# Verify that we can specify both an ignore count and an auto-delete.
|
||||
#
|
||||
if ![runto_main] then { fail "enable/disable break tests suppressed" }
|
||||
|
||||
send_gdb "break marker1\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 41.*$gdb_prompt $"\
|
||||
{pass "break marker1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "break marker1"}
|
||||
timeout {fail "(timeout) break marker1"}
|
||||
}
|
||||
|
||||
send_gdb "ignore $expect_out(1,string) 1\n"
|
||||
gdb_expect {
|
||||
-re "Will ignore next crossing of breakpoint \[0-9\]*.*$gdb_prompt $"\
|
||||
{pass "ignore break marker1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "ignore break marker1"}
|
||||
timeout {fail "(timeout) ignore break marker1"}
|
||||
}
|
||||
|
||||
send_gdb "enable del $expect_out(1,string)\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "enable del break marker1"}
|
||||
timeout {fail "(timeout) enable del break marker1"}
|
||||
}
|
||||
|
||||
send_gdb "info break $expect_out(1,string)\n"
|
||||
gdb_expect {
|
||||
-re "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+del\[ \t\]+y.*ignore next 1 hits.*$gdb_prompt $"\
|
||||
{pass "info break marker1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "info break marker1"}
|
||||
timeout {fail "(timeout) info break marker2"}
|
||||
}
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re ".*Program exited normally.*$gdb_prompt $"\
|
||||
{pass "no stop at ignored & auto-deleted break marker1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "no stop at ignored & auto-deleted break marker1"}
|
||||
timeout {fail "(timeout) no stop at ignored & auto-deleted break marker1"}
|
||||
}
|
||||
|
||||
send_gdb "run\n"
|
||||
gdb_expect {
|
||||
-re "Starting program.*$gdb_prompt $"\
|
||||
{pass "rerun to main"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "rerun to main"}
|
||||
timeout {fail "(timeout) rerun to main"}
|
||||
}
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re ".*marker1 .*:41.*$gdb_prompt $"\
|
||||
{pass "continue to ignored & auto-deleted break marker1"}
|
||||
-re "Breakpoint \[0-9\]*, marker1.*$gdb_prompt $"\
|
||||
{fail "continue to ignored & auto-deleted break marker1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "continue to ignored & auto-deleted break marker1"}
|
||||
timeout {fail "(timeout) continue to ignored & auto-deleted break marker1"}
|
||||
}
|
||||
|
||||
# Verify that a disabled breakpoint's ignore count isn't updated when
|
||||
# the bp is encountered.
|
||||
#
|
||||
if ![runto_main] then { fail "enable/disable break tests suppressed" }
|
||||
|
||||
send_gdb "break marker1\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint (\[0-9\]*) at .*, line 41.*$gdb_prompt $"\
|
||||
{pass "break marker1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "break marker1"}
|
||||
timeout {fail "(timeout) break marker1"}
|
||||
}
|
||||
|
||||
send_gdb "ignore $expect_out(1,string) 10\n"
|
||||
gdb_expect {
|
||||
-re "Will ignore next 10 crossings of breakpoint \[0-9\]*.*$gdb_prompt $"\
|
||||
{pass "ignore break marker1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "ignore break marker1"}
|
||||
timeout {fail "(timeout) ignore break marker1"}
|
||||
}
|
||||
|
||||
send_gdb "disable $expect_out(1,string)\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "disable break marker1"}
|
||||
timeout {fail "(timeout) disable break marker1"}
|
||||
}
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re ".*Program exited normally.*$gdb_prompt $"\
|
||||
{pass "no stop at ignored & disabled break marker1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "no stop at ignored & disabled break marker1"}
|
||||
timeout {fail "(timeout) no stop at ignored & disabled break marker1"}
|
||||
}
|
||||
|
||||
send_gdb "run\n"
|
||||
gdb_expect {
|
||||
-re "Starting program.*$gdb_prompt $"\
|
||||
{pass "rerun to main"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "rerun to main"}
|
||||
timeout {fail "(timeout) rerun to main"}
|
||||
}
|
||||
|
||||
send_gdb "info break $expect_out(1,string)\n"
|
||||
gdb_expect {
|
||||
-re "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+n.*ignore next 10 hits.*$gdb_prompt $"\
|
||||
{pass "info ignored & disabled break marker1"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "info ignored & disabled break marker1"}
|
||||
timeout {fail "(timeout) info ignored & disabled break marker1"}
|
||||
}
|
||||
|
||||
# Verify that GDB correctly handles the "continue" command with an argument,
|
||||
# which is an ignore count to set on the currently stopped-at breakpoint.
|
||||
# (Also verify that GDB gracefully handles the case where the inferior
|
||||
# isn't stopped at a breakpoint.)
|
||||
#
|
||||
if ![runto_main] then { fail "enable/disable break tests suppressed" }
|
||||
|
||||
send_gdb "break 64\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint \[0-9\]*.*, line 64.*$gdb_prompt $"\
|
||||
{pass "prepare to continue with ignore count"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "prepare to continue with ignore count"}
|
||||
timeout {fail "(timeout) prepare to continue with ignore count"}
|
||||
}
|
||||
send_gdb "continue 2\n"
|
||||
gdb_expect {
|
||||
-re "Will ignore next crossing of breakpoint \[0-9\]*. Continuing..*$gdb_prompt $"\
|
||||
{pass "continue with ignore count"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "continue with ignore count"}
|
||||
timeout {fail "(timeout) continue with ignore count"}
|
||||
}
|
||||
|
||||
send_gdb "next\n"
|
||||
gdb_expect {
|
||||
-re ".*66\[ \t\]*marker1.*$gdb_prompt $"\
|
||||
{pass "step after continue with ignore count"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "step after continue with ignore count"}
|
||||
timeout {fail "(timeout) step after continue with ignore count"}
|
||||
}
|
||||
|
||||
# ??rehrauer: Huh. This appears to be an actual bug. (No big
|
||||
# surprise, since this feature hasn't been tested...) Looks like
|
||||
# GDB is currently trying to set the ignore count of bp # -1!
|
||||
#
|
||||
setup_xfail hppa_*_*
|
||||
send_gdb "continue 2\n"
|
||||
gdb_expect {
|
||||
-re "Not stopped at any breakpoint; argument ignored..*$gdb_prompt $"\
|
||||
{pass "continue with ignore count, not stopped at bpt"}
|
||||
-re "No breakpoint number -1.*$gdb_prompt $"\
|
||||
{xfail "(DTS'd) continue with ignore count, not stopped at bpt"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "continue with ignore count, not stopped at bpt"}
|
||||
timeout {fail "(timeout) step after continue with ignore count, not stopped at bpt"}
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
return 0
|
||||
27
gdb/testsuite/gdb.base/ending-run.c
Normal file
27
gdb/testsuite/gdb.base/ending-run.c
Normal file
@@ -0,0 +1,27 @@
|
||||
/* Test program for <next-at-end> and
|
||||
* <leaves-core-file-on-quit> bugs.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
|
||||
int callee( x )
|
||||
int x;
|
||||
{
|
||||
int y = x * x;
|
||||
return (y - 2);
|
||||
}
|
||||
|
||||
main()
|
||||
{
|
||||
|
||||
int *p;
|
||||
int i;
|
||||
|
||||
p = (int *) malloc( 4 );
|
||||
|
||||
for (i = 1; i < 10; i++)
|
||||
{
|
||||
printf( "%d ", callee( i ));
|
||||
|
||||
}
|
||||
printf( " Goodbye!\n" );
|
||||
}
|
||||
176
gdb/testsuite/gdb.base/ending-run.exp
Normal file
176
gdb/testsuite/gdb.base/ending-run.exp
Normal file
@@ -0,0 +1,176 @@
|
||||
# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# use this to debug:
|
||||
#
|
||||
#log_user 1
|
||||
|
||||
# ending-run.exp -- Expect script to test ending a test run in gdb
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
set testfile ending-run
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
remote_exec build "rm -f ${binfile}"
|
||||
remote_exec build "rm -f core"
|
||||
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
# CHFts23469: Test that you can "clear" a bp set at
|
||||
# a line _before_ the routine (which will default to the
|
||||
# first line in the routine, which turns out to correspond
|
||||
# to the prolog--that's another bug...)
|
||||
#
|
||||
gdb_test "b 1" ".*Breakpoint.*line 1.*" "bpt at line before routine"
|
||||
gdb_test "b 8" ".*Note.*also.*Breakpoint.*2.*" ""
|
||||
|
||||
# Set up to go to the next-to-last line of the program
|
||||
#
|
||||
gdb_test "b 26" ".*Breakpoint.*3.*" ""
|
||||
|
||||
# Expect to hit the bp at line "1", but symbolize this
|
||||
# as line "8". Then try to clear it--this should work.
|
||||
#
|
||||
gdb_test "r" ".*Breakpoint.*1.*callee.*8.*" ""
|
||||
gdb_test "cle" ".*Deleted breakpoints 2 1.*" "clear worked"
|
||||
send_gdb "i b\n"
|
||||
gdb_expect {
|
||||
-re ".*breakpoint.*breakpoint.*$gdb_prompt $" { fail "clear bp" }
|
||||
-re ".*3.*main.*26.*$gdb_prompt $" { pass "cleared bp at line before routine" }
|
||||
-re ".*$gdb_prompt $" { fail "info b" }
|
||||
}
|
||||
|
||||
# Test some other "clear" combinations
|
||||
#
|
||||
gdb_test "b 1" ".*Breakpoint.*4.*" ""
|
||||
gdb_test "b 8" ".*Note.*also.*Breakpoint.*5.*" ""
|
||||
gdb_test "cle 8" ".*Deleted breakpoint 5.*" "Only cleared 1 by line"
|
||||
|
||||
send_gdb "inf line 8\n"
|
||||
gdb_expect {
|
||||
-re ".*address (0x\[0-9a-fA-F]*).*$gdb_prompt $" {
|
||||
set line_eight $expect_out(1,string)
|
||||
gdb_test "b 8" ".*Breakpoint.*6.*" ""
|
||||
gdb_test "cle *$line_eight" ".*Deleted breakpoints 6 4.*" "Clear 2 by address"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "need to fix test for new compile outcome"
|
||||
}
|
||||
}
|
||||
|
||||
send_gdb "inf line 9\n"
|
||||
gdb_expect {
|
||||
-re ".*address (0x\[0-9a-fA-F]*).*$gdb_prompt $" {
|
||||
set line_nine $expect_out(1,string)
|
||||
gdb_test "b 9" ".*Breakpoint.*7.*" ""
|
||||
gdb_test "b *$line_nine" ".*Note.*also.*Breakpoint.*8.*" ""
|
||||
gdb_test "c" ".*Breakpoint.*7.*callee.*9.*" ""
|
||||
gdb_test "cle" ".*Deleted breakpoints 8 7.*" "Clear 2 by default"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "need to fix test for new compile outcome"
|
||||
}
|
||||
}
|
||||
|
||||
send_gdb "i b\n"
|
||||
gdb_expect {
|
||||
-re ".*breakpoint.*breakpoint.*$gdb_prompt $" {
|
||||
fail "didn't clear bps"
|
||||
}
|
||||
-re ".*3.*main.*26.*$gdb_prompt $" {
|
||||
pass "all set to continue"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "missing bp at end"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# See if we can step out with control. The "1 2 3" stuff
|
||||
# is output from the program.
|
||||
#
|
||||
gdb_test "cont" ".*Breakpoint.*26.*" ""
|
||||
gdb_test "next" ".*1 2 7 14 23 34 47 62 79 Goodbye!.*27.*" "Step to return"
|
||||
|
||||
set old_timeout $timeout
|
||||
set timeout 50
|
||||
send_gdb "next\n"
|
||||
gdb_expect {
|
||||
-re "27.*$gdb_prompt $" {
|
||||
# sometimes we stop at the closing brace, if so, do another next
|
||||
send_gdb "next\n"
|
||||
gdb_expect {
|
||||
-re ".*Unable to find return pc for this frame.*$gdb_prompt $" {
|
||||
fail "Old bug came back!"
|
||||
gdb_test "n" ".*" ""
|
||||
}
|
||||
-re ".*in.*start.*$gdb_prompt $" {
|
||||
pass "step out of main"
|
||||
}
|
||||
timeout { fail "hang or timeout on step at end 2" }
|
||||
}
|
||||
}
|
||||
-re ".*Unable to find return pc for this frame.*$gdb_prompt $" {
|
||||
fail "Old bug came back!"
|
||||
gdb_test "n" ".*" ""
|
||||
}
|
||||
-re ".*in.*start.*$gdb_prompt $" {
|
||||
pass "step out of main"
|
||||
}
|
||||
timeout { fail "hang or timeout on step at end 1" }
|
||||
}
|
||||
|
||||
gdb_test "n" ".*Single.*Program exited.*" "step to end of run"
|
||||
set timeout $old_timeout
|
||||
|
||||
gdb_test "n" ".*The program is not being run.*" "don't step after run"
|
||||
|
||||
set exec_output [remote_exec host "ls core"]
|
||||
|
||||
if [ regexp "core not found" $exec_output] {
|
||||
pass "No core dumped on quit"
|
||||
} else {
|
||||
if [ regexp "No such file or directory" $exec_output] {
|
||||
pass "ls: core: No core dumped on quit"
|
||||
} else {
|
||||
remote_exec build "rm -f core"
|
||||
fail "Core dumped on quit"
|
||||
}
|
||||
}
|
||||
|
||||
#remote_exec build "rm -f ${binfile}"
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
|
||||
329
gdb/testsuite/gdb.base/environ.exp
Normal file
329
gdb/testsuite/gdb.base/environ.exp
Normal file
@@ -0,0 +1,329 @@
|
||||
# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
global usestubs
|
||||
|
||||
#
|
||||
# test running programs
|
||||
#
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
# This test exists solely to exercise the "environment" commands for
|
||||
# code-coverage on HP-UX.
|
||||
#
|
||||
if ![istarget "hppa*-*-hpux*"] then {
|
||||
return
|
||||
}
|
||||
|
||||
set testfile "break"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
if ![runto_main] then { fail "environment command tests suppressed" }
|
||||
|
||||
# (No, this is not really related to the environment commands. But it's
|
||||
# a convenient place to verify that this command works.)
|
||||
#
|
||||
send_gdb "info program\n"
|
||||
gdb_expect {
|
||||
-re ".*Using the running image of child process \[0-9\]*.\r\nProgram stopped at 0x\[0-9a-fA-F\]*.\r\nIt stopped at breakpoint 1..*$gdb_prompt $"\
|
||||
{pass "info program"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "info program"}
|
||||
timeout {fail "(timeout) info program"}
|
||||
}
|
||||
|
||||
# We don't really care where this step lands, so long as it gets
|
||||
# the inferior pushed off the breakpoint it's currently on...
|
||||
#
|
||||
send_gdb "next\n"
|
||||
gdb_expect {
|
||||
-re ".*$gdb_prompt $"\
|
||||
{pass "step before info program"}
|
||||
timeout {fail "(timeout) step before info program"}
|
||||
}
|
||||
send_gdb "info program\n"
|
||||
gdb_expect {
|
||||
-re ".*Using the running image of child process \[0-9\]*.\r\nProgram stopped at 0x\[0-9a-fA-F\]*.\r\nIt stopped after being stepped..*$gdb_prompt $"\
|
||||
{pass "info program after step"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "info program after step"}
|
||||
timeout {fail "(timeout) info program after step"}
|
||||
}
|
||||
|
||||
if ![runto_main] then { fail "environment command tests suppressed" }
|
||||
|
||||
send_gdb "delete\n"
|
||||
gdb_expect {
|
||||
-re ".*y or n. $"\
|
||||
{send_gdb "y\n"
|
||||
gdb_expect {
|
||||
-re ".*$gdb_prompt $"\
|
||||
{pass "delete breakpoint before info program"}
|
||||
timeout {fail "(timeout) delete breakpoint before info program"}
|
||||
}
|
||||
}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "delete breakpoint before info program"}
|
||||
timeout {fail "(timeout) delete breakpoint before info program"}
|
||||
}
|
||||
send_gdb "info program\n"
|
||||
gdb_expect {
|
||||
-re ".*Using the running image of child process \[0-9\]*.\r\nProgram stopped at 0x\[0-9a-fA-F\]*.\r\nIt stopped at a breakpoint that has since been deleted..*$gdb_prompt $"\
|
||||
{pass "info program after deleted breakpoint"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "info program after deleted breakpoint"}
|
||||
timeout {fail "(timeout) info program after deleted breakpoint"}
|
||||
}
|
||||
|
||||
# Verify that we can show all currently-set environment variables.
|
||||
# (It's a bit hacky, but nonetheless probably safe to check for at
|
||||
# least the SHELL variable.)
|
||||
#
|
||||
# need to increase timeout because of very long output
|
||||
set oldtimeout $timeout
|
||||
set timeout [expr "$timeout + 300"]
|
||||
|
||||
send_gdb "show environment\n"
|
||||
gdb_expect {
|
||||
-re ".*SHELL=(\[a-zA-Z0-9\]*).*$gdb_prompt $"\
|
||||
{pass "show environment"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "show environment"}
|
||||
timeout {fail "(timeout) show environment"}
|
||||
}
|
||||
set timeout $oldtimeout
|
||||
|
||||
# Verify that we can unset a specific environment variable.
|
||||
#
|
||||
send_gdb "unset environment EDITOR\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "issue unset environment"}
|
||||
timeout {fail "(timeout) issue unset environment"}
|
||||
}
|
||||
send_gdb "show environment EDITOR\n"
|
||||
gdb_expect {
|
||||
-re "Environment variable \"EDITOR\" not defined.\r\n$gdb_prompt $"\
|
||||
{pass "unset environment"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "unset environment"}
|
||||
timeout {fail "(timeout) unset environment"}
|
||||
}
|
||||
|
||||
# Verify that we can unset all environment variables.
|
||||
#
|
||||
send_gdb "unset environment\n"
|
||||
gdb_expect {
|
||||
-re "Delete all environment variables.*y or n. $"\
|
||||
{send_gdb "y\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "unset entire environment"}
|
||||
timeout {fail "(timeout) unset entire environment"}
|
||||
}
|
||||
}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "unset entire environment"}
|
||||
timeout {fail "(timeout) unset entire environment"}
|
||||
}
|
||||
|
||||
# Verify that we can set a specific environment variable.
|
||||
#
|
||||
send_gdb "set environment EDITOR emacs\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "issue set environment"}
|
||||
timeout {fail "(timeout) issue set environment"}
|
||||
}
|
||||
send_gdb "show environment EDITOR\n"
|
||||
gdb_expect {
|
||||
-re "EDITOR = emacs\r\n$gdb_prompt $"\
|
||||
{pass "set environment"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "set environment"}
|
||||
timeout {fail "(timeout) set environment"}
|
||||
}
|
||||
|
||||
# Verify that GDB responds gracefully to a request to set environment,
|
||||
# with no variable name.
|
||||
#
|
||||
send_gdb "set environment\n"
|
||||
gdb_expect {
|
||||
-re "Argument required .environment variable and value..*$gdb_prompt $"\
|
||||
{pass "set environment without variable disallowed"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "set environment without variable disallowed"}
|
||||
timeout {fail "(timeout) set environment without variable disallowed"}
|
||||
}
|
||||
|
||||
# I'm not sure just what GDB has in mind in explicitly checking
|
||||
# for this variant, but since GDB handles it, test it.
|
||||
#
|
||||
send_gdb "set environment =\n"
|
||||
gdb_expect {
|
||||
-re "Argument required .environment variable to set..*$gdb_prompt $"\
|
||||
{pass "set environment equals without variable disallowed"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "set environment equals without variable disallowed"}
|
||||
timeout {fail "(timeout) set environment equals without variable disallowed"}
|
||||
}
|
||||
|
||||
# Setting an environment variable without a value sets it to a NULL
|
||||
# value.
|
||||
#
|
||||
send_gdb "set environment EDITOR\n"
|
||||
gdb_expect {
|
||||
-re "Setting environment variable \"EDITOR\" to null value..*$gdb_prompt $"\
|
||||
{pass "issue set environment without variable value"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "issue set environment without variable value"}
|
||||
timeout {fail "(timeout) issue set environment without variable value"}
|
||||
}
|
||||
send_gdb "show environment EDITOR\n"
|
||||
gdb_expect {
|
||||
-re "EDITOR = \r\n$gdb_prompt $"\
|
||||
{pass "set environment without variable value"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "set environment without variable value"}
|
||||
timeout {fail "(timeout) set environment without variable value"}
|
||||
}
|
||||
|
||||
# Verify that GDB responds gracefully to an attempt to show a
|
||||
# non-existent environment variable. (We hope this variable is
|
||||
# undefined!)
|
||||
#
|
||||
send_gdb "show environment FOOBARBAZGRUNGESPAZBALL\n"
|
||||
gdb_expect {
|
||||
-re "Environment variable \"FOOBARBAZGRUNGESPAZBALL\" not defined..*$gdb_prompt $"\
|
||||
{pass "show non-existent environment variable disallowed"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "show non-existent environment variable disallowed"}
|
||||
timeout {fail "(timeout) show non-existent environment variable disallowed"}
|
||||
}
|
||||
|
||||
# Verify that GDB can set an environment variable hitherto undefined.
|
||||
#
|
||||
send_gdb "set environment FOOBARBAZGRUNGESPAZBALL t\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "issue set environment for previously undefined variable"}
|
||||
timeout {fail "(timeout) issue set environment for previously undefined variable"}
|
||||
}
|
||||
send_gdb "show environment FOOBARBAZGRUNGESPAZBALL\n"
|
||||
gdb_expect {
|
||||
-re "FOOBARBAZGRUNGESPAZBALL = t\r\n$gdb_prompt $"\
|
||||
{pass "set environment for previously undefined variable"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "set environment for previously undefined variable"}
|
||||
timeout {fail "(timeout) set environment for previously undefined variable"}
|
||||
}
|
||||
|
||||
# Verify that GDB can also set an environment variable using the "="
|
||||
# syntax.
|
||||
#
|
||||
send_gdb "set environment FOOBARBAZGRUNGESPAZBALL = t\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "issue set environment with equals"}
|
||||
timeout {fail "(timeout) issue set environment with equals"}
|
||||
}
|
||||
send_gdb "show environment FOOBARBAZGRUNGESPAZBALL\n"
|
||||
gdb_expect {
|
||||
-re "FOOBARBAZGRUNGESPAZBALL = t\r\n$gdb_prompt $"\
|
||||
{pass "set environment with equals"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "set environment with equals"}
|
||||
timeout {fail "(timeout) set environment with equals"}
|
||||
}
|
||||
|
||||
# Verify that GDB can set an environment variable to a value that has
|
||||
# an embedded (trailing, in this case) equals.
|
||||
#
|
||||
send_gdb "set environment FOOBARBAZGRUNGESPAZBALL t=\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "issue set environment with trailing equals"}
|
||||
timeout {fail "(timeout) issue set environment with trailing equals"}
|
||||
}
|
||||
send_gdb "show environment FOOBARBAZGRUNGESPAZBALL\n"
|
||||
gdb_expect {
|
||||
-re "FOOBARBAZGRUNGESPAZBALL = t=\r\n$gdb_prompt $"\
|
||||
{pass "set environment with trailing equals"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "set environment with trailing equals"}
|
||||
timeout {fail "(timeout) set environment with trailing equals"}
|
||||
}
|
||||
|
||||
# Verify that GDB can set an environment variable to a value preceded
|
||||
# by whitespace, and that such whitespace is ignored (not included
|
||||
# in the set value).
|
||||
#
|
||||
send_gdb "set environment FOOBARBAZGRUNGESPAZBALL = foo\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "issue set environment with preceding whitespace"}
|
||||
timeout {fail "(timeout) issue set environment with preceding whitespace"}
|
||||
}
|
||||
send_gdb "show environment FOOBARBAZGRUNGESPAZBALL\n"
|
||||
gdb_expect {
|
||||
-re "FOOBARBAZGRUNGESPAZBALL = foo\r\n$gdb_prompt $"\
|
||||
{pass "set environment with preceding whitespace"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "set environment with preceding whitespace"}
|
||||
timeout {fail "(timeout) set environment with preceding whitespace"}
|
||||
}
|
||||
|
||||
# Verify that GDB can manipulate the distinguished PATH variable.
|
||||
#
|
||||
send_gdb "path /tmp/FOOBARBAZGRUNGESPAZBALL\n"
|
||||
gdb_expect {
|
||||
-re ".*Executable and object file path: /tmp/FOOBARBAZGRUNGESPAZBALL.*$gdb_prompt $"\
|
||||
{pass "issue path"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "issue path"}
|
||||
timeout {fail "(timeout) issue path"}
|
||||
}
|
||||
send_gdb "show paths\n"
|
||||
gdb_expect {
|
||||
-re "Executable and object file path: /tmp/FOOBARBAZGRUNGESPAZBALL.*$gdb_prompt $"\
|
||||
{pass "show paths"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "show paths"}
|
||||
timeout {fail "(timeout) show paths"}
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
return 0
|
||||
352
gdb/testsuite/gdb.base/eval-skip.exp
Normal file
352
gdb/testsuite/gdb.base/eval-skip.exp
Normal file
@@ -0,0 +1,352 @@
|
||||
# Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# This file was written by Elena Zannoni (ezannoni@cygnus.com)
|
||||
|
||||
# This file is part of the gdb testsuite
|
||||
|
||||
#
|
||||
# tests to cover evaluate_subexp_standard with the EVAL_SKIP flag set.
|
||||
# this happens for instance when there is short circuit evaluation in the && and ||
|
||||
# operators, or in the non returned part of a (x ? y: z) expression.
|
||||
# the part that is not evaluated is parsed and evaluated anyway, but with
|
||||
# the EVAL_SKIP flag set
|
||||
#
|
||||
# source file "int-type.c"
|
||||
#
|
||||
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
# Check to see if we have an executable to test. If not, then either we
|
||||
# haven't tried to compile one, or the compilation failed for some reason.
|
||||
# In either case, just notify the user and skip the tests in this file.
|
||||
|
||||
set testfile "int-type"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
|
||||
if ![runto_main] then {
|
||||
perror "couldn't run to breakpoint"
|
||||
continue
|
||||
}
|
||||
|
||||
gdb_test "set variable x=14" "" "set variable x=14"
|
||||
gdb_test "set variable y=2" "" "set variable y=2"
|
||||
gdb_test "set variable z=2" "" "set variable z=2"
|
||||
gdb_test "set variable w=3" "" "set variable w=3"
|
||||
|
||||
|
||||
send_gdb "print (0 && (x+y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x+y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x+y))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x+y))" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print (0 && (x-y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x-y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x-y))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x-y))" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print (0 && (x*y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x*y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x*y))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x*y))" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
send_gdb "print (0 && (x/y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x/y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x/y))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x/y))" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print (0 && (x%y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x%y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x%y))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x%y))" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print (0 && (x&&y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x&&y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x&&y))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x&&y))" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
send_gdb "print (0 && (x||y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x||y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x||y))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x||y))" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
send_gdb "print (0 && (x&y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x&y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x&y))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x&y))" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print (0 && (x|y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x|y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x|y))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x|y))" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print (0 && (x^y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x^y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x^y))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x^y))" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
send_gdb "print (0 && (x < y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x < y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x < y))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x < y))" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print (0 && (x <= y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x <= y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x <= y))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x <= y))" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
send_gdb "print (0 && (x>y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x>y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x>y))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x>y))" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print (0 && (x>=y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x>=y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x>=y))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x>=y))" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
send_gdb "print (0 && (x==y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x==y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x==y))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x==y))" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print (0 && (x!=y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x!=y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x!=y))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x!=y))" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print (0 && (x<<31))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x<<31))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x<<31))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x<<31))" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print (0 && (x>>31))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x>>31))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x>>31))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x>>31))" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
send_gdb "print (0 && (!x))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (!x))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (!x))" }
|
||||
timeout { fail "(timeout) print value of (0 && (!x))" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print (0 && (~x))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (~x))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (~x))" }
|
||||
timeout { fail "(timeout) print value of (0 && (~x))" }
|
||||
}
|
||||
|
||||
send_gdb "print (0 && (-x))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (-x))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (-x))" }
|
||||
timeout { fail "(timeout) print value of (0 && (-x))" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print (0 && (x++))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x++))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x++))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x++))" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print (0 && (++x))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (++x))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (++x))" }
|
||||
timeout { fail "(timeout) print value of (0 && (++x))" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print (0 && (x--))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x--))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x--))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x--))" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print (0 && (--x))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (--x))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (--x))" }
|
||||
timeout { fail "(timeout) print value of (0 && (--x))" }
|
||||
}
|
||||
|
||||
send_gdb "print (0 && (x+=7))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x+=7))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x+=7))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x+=7))" }
|
||||
}
|
||||
|
||||
send_gdb "print (0 && (x=y))\n"
|
||||
gdb_expect {
|
||||
-re ".$decimal = 0\r\n$gdb_prompt $" {
|
||||
pass "print value of (0 && (x=y))"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of (0 && (x=y))" }
|
||||
timeout { fail "(timeout) print value of (0 && (x=y))" }
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
253
gdb/testsuite/gdb.base/exprs.c
Normal file
253
gdb/testsuite/gdb.base/exprs.c
Normal file
@@ -0,0 +1,253 @@
|
||||
main (argc, argv, envp)
|
||||
int argc;
|
||||
char **argv;
|
||||
char **envp;
|
||||
{
|
||||
extern void dummy();
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
breakpoint();
|
||||
#endif
|
||||
dummy();
|
||||
}
|
||||
|
||||
/* We put main() right up front so its line number doesn't keep changing. */
|
||||
|
||||
/*
|
||||
* Test file with lots of different types, for testing the
|
||||
* "whatis" command.
|
||||
*/
|
||||
|
||||
/*
|
||||
* First the basic C types.
|
||||
*/
|
||||
|
||||
#if !defined (__STDC__) && !defined (_AIX)
|
||||
#define signed /**/
|
||||
#endif
|
||||
|
||||
char v_char;
|
||||
signed char v_signed_char;
|
||||
unsigned char v_unsigned_char;
|
||||
|
||||
short v_short;
|
||||
signed short v_signed_short;
|
||||
unsigned short v_unsigned_short;
|
||||
|
||||
int v_int;
|
||||
signed int v_signed_int;
|
||||
unsigned int v_unsigned_int;
|
||||
|
||||
long v_long;
|
||||
signed long v_signed_long;
|
||||
unsigned long v_unsigned_long;
|
||||
|
||||
float v_float;
|
||||
double v_double;
|
||||
|
||||
/*
|
||||
* Now some derived types, which are arrays, functions-returning,
|
||||
* pointers, structures, unions, and enumerations.
|
||||
*/
|
||||
|
||||
/**** arrays *******/
|
||||
|
||||
char v_char_array[2];
|
||||
signed char v_signed_char_array[2];
|
||||
unsigned char v_unsigned_char_array[2];
|
||||
|
||||
short v_short_array[2];
|
||||
signed short v_signed_short_array[2];
|
||||
unsigned short v_unsigned_short_array[2];
|
||||
|
||||
int v_int_array[2];
|
||||
signed int v_signed_int_array[2];
|
||||
unsigned int v_unsigned_int_array[2];
|
||||
|
||||
long v_long_array[2];
|
||||
signed long v_signed_long_array[2];
|
||||
unsigned long v_unsigned_long_array[2];
|
||||
|
||||
float v_float_array[2];
|
||||
double v_double_array[2];
|
||||
|
||||
/**** pointers *******/
|
||||
|
||||
char *v_char_pointer;
|
||||
signed char *v_signed_char_pointer;
|
||||
unsigned char *v_unsigned_char_pointer;
|
||||
|
||||
short *v_short_pointer;
|
||||
signed short *v_signed_short_pointer;
|
||||
unsigned short *v_unsigned_short_pointer;
|
||||
|
||||
int *v_int_pointer;
|
||||
signed int *v_signed_int_pointer;
|
||||
unsigned int *v_unsigned_int_pointer;
|
||||
|
||||
long *v_long_pointer;
|
||||
signed long *v_signed_long_pointer;
|
||||
unsigned long *v_unsigned_long_pointer;
|
||||
|
||||
float *v_float_pointer;
|
||||
double *v_double_pointer;
|
||||
|
||||
/**** structs *******/
|
||||
|
||||
struct t_struct {
|
||||
char v_char_member;
|
||||
short v_short_member;
|
||||
int v_int_member;
|
||||
long v_long_member;
|
||||
float v_float_member;
|
||||
double v_double_member;
|
||||
} v_struct1;
|
||||
|
||||
struct {
|
||||
char v_char_member;
|
||||
short v_short_member;
|
||||
int v_int_member;
|
||||
long v_long_member;
|
||||
float v_float_member;
|
||||
double v_double_member;
|
||||
} v_struct2;
|
||||
|
||||
/**** unions *******/
|
||||
|
||||
union t_union {
|
||||
char v_char_member;
|
||||
short v_short_member;
|
||||
int v_int_member;
|
||||
long v_long_member;
|
||||
float v_float_member;
|
||||
double v_double_member;
|
||||
} v_union;
|
||||
|
||||
union {
|
||||
char v_char_member;
|
||||
short v_short_member;
|
||||
int v_int_member;
|
||||
long v_long_member;
|
||||
float v_float_member;
|
||||
double v_double_member;
|
||||
} v_union2;
|
||||
|
||||
/*** Functions returning type ********/
|
||||
|
||||
char v_char_func () { return(0); }
|
||||
signed char v_signed_char_func () { return (0); }
|
||||
unsigned char v_unsigned_char_func () { return (0); }
|
||||
|
||||
short v_short_func () { return (0); }
|
||||
signed short v_signed_short_func () { return (0); }
|
||||
unsigned short v_unsigned_short_func () { return (0); }
|
||||
|
||||
int v_int_func () { return (0); }
|
||||
signed int v_signed_int_func () { return (0); }
|
||||
unsigned int v_unsigned_int_func () { return (0); }
|
||||
|
||||
long v_long_func () { return (0); }
|
||||
signed long v_signed_long_func () { return (0); }
|
||||
unsigned long v_unsigned_long_func () { return (0); }
|
||||
|
||||
float v_float_func () { return (0.0); }
|
||||
double v_double_func () { return (0.0); }
|
||||
|
||||
/**** Some misc more complicated things *******/
|
||||
|
||||
struct link {
|
||||
struct link *next;
|
||||
#ifdef __STDC__
|
||||
struct link *(*linkfunc) (struct link *this, int flags);
|
||||
#else
|
||||
struct link *(*linkfunc) ();
|
||||
#endif
|
||||
struct t_struct stuff[1][2][3];
|
||||
} *s_link;
|
||||
|
||||
union tu_link {
|
||||
struct link *next;
|
||||
#ifdef __STDC__
|
||||
struct link *(*linkfunc) (struct link *this, int flags);
|
||||
#else
|
||||
struct link *(*linkfunc) ();
|
||||
#endif
|
||||
struct t_struct stuff[1][2][3];
|
||||
} u_link;
|
||||
|
||||
/**** Enumerations *******/
|
||||
|
||||
enum colors {red, green, blue} color;
|
||||
enum cars {chevy, ford, porsche} clunker;
|
||||
|
||||
|
||||
void dummy()
|
||||
{
|
||||
/* Some linkers (e.g. on AIX) remove unreferenced variables,
|
||||
so make sure to reference them. */
|
||||
v_char = 0;
|
||||
v_signed_char = 1;
|
||||
v_unsigned_char = 2;
|
||||
|
||||
v_short = 3;
|
||||
v_signed_short = 4;
|
||||
v_unsigned_short = 5;
|
||||
|
||||
v_int = 6;
|
||||
v_signed_int = 7;
|
||||
v_unsigned_int = 8;
|
||||
|
||||
v_long = 9;
|
||||
v_signed_long = 10;
|
||||
v_unsigned_long = 11;
|
||||
|
||||
v_float = 100.0;
|
||||
v_double = 200.0;
|
||||
|
||||
|
||||
v_char_array[0] = v_char;
|
||||
v_signed_char_array[0] = v_signed_char;
|
||||
v_unsigned_char_array[0] = v_unsigned_char;
|
||||
|
||||
v_short_array[0] = v_short;
|
||||
v_signed_short_array[0] = v_signed_short;
|
||||
v_unsigned_short_array[0] = v_unsigned_short;
|
||||
|
||||
v_int_array[0] = v_int;
|
||||
v_signed_int_array[0] = v_signed_int;
|
||||
v_unsigned_int_array[0] = v_unsigned_int;
|
||||
|
||||
v_long_array[0] = v_long;
|
||||
v_signed_long_array[0] = v_signed_long;
|
||||
v_unsigned_long_array[0] = v_unsigned_long;
|
||||
|
||||
v_float_array[0] = v_float;
|
||||
v_double_array[0] = v_double;
|
||||
|
||||
v_char_pointer = &v_char;
|
||||
v_signed_char_pointer = &v_signed_char;
|
||||
v_unsigned_char_pointer = &v_unsigned_char;
|
||||
|
||||
v_short_pointer = &v_short;
|
||||
v_signed_short_pointer = &v_signed_short;
|
||||
v_unsigned_short_pointer = &v_unsigned_short;
|
||||
|
||||
v_int_pointer = &v_int;
|
||||
v_signed_int_pointer = &v_signed_int;
|
||||
v_unsigned_int_pointer = &v_unsigned_int;
|
||||
|
||||
v_long_pointer = &v_long;
|
||||
v_signed_long_pointer = &v_signed_long;
|
||||
v_unsigned_long_pointer = &v_unsigned_long;
|
||||
|
||||
v_float_pointer = &v_float;
|
||||
v_double_pointer = &v_double;
|
||||
|
||||
color = red;
|
||||
clunker = porsche;
|
||||
|
||||
u_link.next = s_link;
|
||||
|
||||
v_struct2.v_int_member = v_struct1.v_int_member;
|
||||
v_union2.v_short_member = v_union.v_short_member;
|
||||
}
|
||||
222
gdb/testsuite/gdb.base/exprs.exp
Normal file
222
gdb/testsuite/gdb.base/exprs.exp
Normal file
@@ -0,0 +1,222 @@
|
||||
# Copyright (C) 1988, 1990, 1991, 1992, 1994, 1997 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# 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 {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
#
|
||||
# test running programs
|
||||
#
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile "exprs"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
if [get_compiler_info ${binfile}] {
|
||||
return -1;
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
#
|
||||
# set it up at a breakpoint so we can play with the variable values
|
||||
#
|
||||
|
||||
if ![runto_main] then {
|
||||
perror "couldn't run to breakpoint"
|
||||
continue
|
||||
}
|
||||
|
||||
proc test_expr { args } {
|
||||
if { [llength $args] % 2 } {
|
||||
warning "an even # of arguments should be passed to test_expr"
|
||||
}
|
||||
set last_ent [expr [llength $args] - 1];
|
||||
set testname [lindex $args $last_ent];
|
||||
if [gdb_test [lindex $args 0] "" "$testname (setup)"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
for {set x 1} {$x < $last_ent} {set x [expr $x + 2]} {
|
||||
if [gdb_test [lindex $args $x] [lindex $args [expr $x + 1]] "$testname ([lindex $args $x])"] {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
}
|
||||
gdb_stop_suppressing_tests;
|
||||
}
|
||||
#
|
||||
# test expressions with "char" types
|
||||
#
|
||||
test_expr "set variable v_char=127" "print v_char == 0" "\\$\[0-9\]* = 0" "print v_char == 127" "\\$\[0-9\]* = 1" "print char =="
|
||||
test_expr "set variable v_char=127" "print v_char != 0" "\\$\[0-9\]* = 1" "print v_char != 127" "\\$\[0-9\]* = 0" "print char !="
|
||||
test_expr "set variable v_char=127" "print v_char < 0" "\\$\[0-9\]* = 0" "print v_char < 127" "\\$\[0-9\]* = 0" "print char <"
|
||||
test_expr "set variable v_char=127" "print v_char > 0" "\\$\[0-9\]* = 1" "print v_char > 127" "\\$\[0-9\]* = 0" "print char >"
|
||||
#
|
||||
# test expressions with "signed char" types
|
||||
#
|
||||
test_expr "set variable v_signed_char=127" "print v_signed_char == 0" "\\$\[0-9\]* = 0" "print v_signed_char == 127" "\\$\[0-9\]* = 1" "print signed char =="
|
||||
test_expr "set variable v_signed_char=127" "print v_signed_char != 0" "\\$\[0-9\]* = 1" "print v_signed_char != 127" "\\$\[0-9\]* = 0" "print signed char !="
|
||||
test_expr "set variable v_signed_char=127" "print v_signed_char < 0" "\\$\[0-9\]* = 0" "print v_signed_char < 127" "\\$\[0-9\]* = 0" "print signed char <"
|
||||
test_expr "set variable v_signed_char=127" "print v_signed_char > 0" "\\$\[0-9\]* = 1" "print v_signed_char > 127" "\\$\[0-9\]* = 0" "print signed char >"
|
||||
# make char a minus
|
||||
test_expr "set variable v_signed_char=-1" "print v_signed_char == 0" "\\$\[0-9\]* = 0" "print v_signed_char == -1" "\\$\[0-9\]* = 1" "print signed char == (minus)"
|
||||
test_expr "set variable v_signed_char=-1" "print v_signed_char != 0" "\\$\[0-9\]* = 1" "print v_signed_char != -1" "\\$\[0-9\]* = 0" "print signed char != (minus)"
|
||||
test_expr "set variable v_signed_char=-1" "print v_signed_char < 0" "\\$\[0-9\]* = 1" "print v_signed_char < 127" "\\$\[0-9\]* = 1" "print signed char < (minus)"
|
||||
test_expr "set variable v_signed_char=-1" "print v_signed_char > 0" "\\$\[0-9\]* = 0" "print v_signed_char > 127" "\\$\[0-9\]* = 0" "print signed char > (minus)"
|
||||
#
|
||||
# test expressions with "unsigned char" types
|
||||
#
|
||||
test_expr "set variable v_unsigned_char=127" "print v_unsigned_char == 0" "\\$\[0-9\]* = 0" "print v_unsigned_char == 127" "\\$\[0-9\]* = 1" "print unsigned char =="
|
||||
test_expr "set variable v_unsigned_char=127" "print v_unsigned_char != 0" "\\$\[0-9\]* = 1" "print v_unsigned_char != 127" "\\$\[0-9\]* = 0" "print unsigned char !="
|
||||
test_expr "set variable v_unsigned_char=127" "print v_unsigned_char < 0" "\\$\[0-9\]* = 0" "print v_unsigned_char < 127" "\\$\[0-9\]* = 0" "print unsigned char <"
|
||||
test_expr "set variable v_unsigned_char=127" "print v_unsigned_char > 0" "\\$\[0-9\]* = 1" "print v_unsigned_char > 127" "\\$\[0-9\]* = 0" "print unsigned char >"
|
||||
# make char a minus
|
||||
# FIXME: gdb mishandles the cast (unsigned char) on the i960, so I've
|
||||
# set up an expected failure for this case.
|
||||
setup_xfail "i960-*-*" 1821
|
||||
test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char == 0" "\\$\[0-9\]* = 0" "print v_unsigned_char == ~0" "\\$\[0-9\]* = 0" "print v_unsigned_char == (unsigned char)~0" "\\$\[0-9\]* = 1" "print unsigned char == (~0)"
|
||||
# FIXME: gdb mishandles the cast (unsigned char) on the i960, so I've
|
||||
# set up an expected failure for this case.
|
||||
setup_xfail "i960-*-*" 1821
|
||||
test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char != 0" "\\$\[0-9\]* = 1" "print v_unsigned_char != (unsigned char)~0" "\\$\[0-9\]* = 0" "print unsigned char != (~0)"
|
||||
test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char < 0" "\\$\[0-9\]* = 0" "print v_unsigned_char < 127" "\\$\[0-9\]* = 0" "print unsigned char < (~0)"
|
||||
test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char > 0" "\\$\[0-9\]* = 1" "print v_unsigned_char > 127" "\\$\[0-9\]* = 1" "print unsigned char > (~0)"
|
||||
#
|
||||
# test expressions with "short" types
|
||||
#
|
||||
test_expr "set variable v_short=0x7FFF" "print v_short == 0" "\\$\[0-9\]* = 0" "print v_short == 0x7FFF" "\\$\[0-9\]* = 1" "print signed short =="
|
||||
test_expr "set variable v_short=0x7FFF" "print v_short != 0" "\\$\[0-9\]* = 1" "print v_short != 0x7FFF" "\\$\[0-9\]* = 0" "print signed short !="
|
||||
test_expr "set variable v_short=0x7FFF" "print v_short < 0" "\\$\[0-9\]* = 0" "print v_short < 0x7FFF" "\\$\[0-9\]* = 0" "print signed short <"
|
||||
test_expr "set variable v_short=0x7FFF" "print v_short > 0" "\\$\[0-9\]* = 1" "print v_short > 0x7FFF" "\\$\[0-9\]* = 0" "print signed short >"
|
||||
# make short a minus
|
||||
test_expr "set variable v_short=-1" "print v_short == 0" "\\$\[0-9\]* = 0" "print v_short == -1" "\\$\[0-9\]* = 1" "print signed short == (minus)"
|
||||
test_expr "set variable v_short=-1" "print v_short != 0" "\\$\[0-9\]* = 1" "print v_short != -1" "\\$\[0-9\]* = 0" "print signed short != (minus)"
|
||||
test_expr "set variable v_short=-1" "print v_short < 0" "\\$\[0-9\]* = 1" "print v_short < 0x7FFF" "\\$\[0-9\]* = 1" "print signed short < (minus)"
|
||||
test_expr "set variable v_short=-1" "print v_short > 0" "\\$\[0-9\]* = 0" "print v_short > 0x7FFF" "\\$\[0-9\]* = 0" "print signed short > (minus)"
|
||||
#
|
||||
# test expressions with "signed short" types
|
||||
#
|
||||
test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short == 0" "\\$\[0-9\]* = 0" "print v_signed_short == 0x7FFF" "\\$\[0-9\]* = 1" "print signed signed short =="
|
||||
test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short != 0" "\\$\[0-9\]* = 1" "print v_signed_short != 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed short !="
|
||||
test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short < 0" "\\$\[0-9\]* = 0" "print v_signed_short < 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed short <"
|
||||
test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short > 0" "\\$\[0-9\]* = 1" "print v_signed_short > 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed short >"
|
||||
# make short a minus
|
||||
test_expr "set variable v_signed_short=-1" "print v_signed_short == 0" "\\$\[0-9\]* = 0" "print v_signed_short == -1" "\\$\[0-9\]* = 1" "print signed signed short == (minus)"
|
||||
test_expr "set variable v_signed_short=-1" "print v_signed_short != 0" "\\$\[0-9\]* = 1" "print v_signed_short != -1" "\\$\[0-9\]* = 0" "print signed signed short != (minus)"
|
||||
test_expr "set variable v_signed_short=-1" "print v_signed_short < 0" "\\$\[0-9\]* = 1" "print v_signed_short < 0x7FFF" "\\$\[0-9\]* = 1" "print signed signed short < (minus)"
|
||||
test_expr "set variable v_signed_short=-1" "print v_signed_short > 0" "\\$\[0-9\]* = 0" "print v_signed_short > 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed short > (minus)"
|
||||
#
|
||||
# test expressions with "unsigned short" types
|
||||
#
|
||||
test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short == 0" "\\$\[0-9\]* = 0" "print v_unsigned_short == 0x7FFF" "\\$\[0-9\]* = 1" "print unsigned short =="
|
||||
test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short != 0" "\\$\[0-9\]* = 1" "print v_unsigned_short != 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned short !="
|
||||
test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short < 0" "\\$\[0-9\]* = 0" "print v_unsigned_short < 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned short <"
|
||||
test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short > 0" "\\$\[0-9\]* = 1" "print v_unsigned_short > 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned short >"
|
||||
# make short a minus
|
||||
# note that (unsigned short) ~0 == ~0 iff sizeof(short) == sizeof(int),
|
||||
# so we can't test v_unsigned_short != ~0
|
||||
test_expr "set variable v_unsigned_short=~0" \
|
||||
"print v_unsigned_short == 0" "\\$\[0-9\]* = 0" \
|
||||
"print v_unsigned_short == (unsigned short)~0" "\\$\[0-9\]* = 1" \
|
||||
"print unsigned short == (~0)"
|
||||
test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short != 0" "\\$\[0-9\]* = 1" "print v_unsigned_short != (unsigned short)~0" "\\$\[0-9\]* = 0" "print unsigned short != (~0)"
|
||||
test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short < 0" "\\$\[0-9\]* = 0" "print v_unsigned_short < 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned short < (~0)"
|
||||
test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short > 0" "\\$\[0-9\]* = 1" "print v_unsigned_short > 0x7FFF" "\\$\[0-9\]* = 1" "print unsigned short > (~0)"
|
||||
#
|
||||
# test expressions with "int" types
|
||||
#
|
||||
test_expr "set variable v_int=0x7FFF" "print v_int == 0" "\\$\[0-9\]* = 0" "print v_int == 0x7FFF" "\\$\[0-9\]* = 1" "print signed int =="
|
||||
test_expr "set variable v_int=0x7FFF" "print v_int != 0" "\\$\[0-9\]* = 1" "print v_int != 0x7FFF" "\\$\[0-9\]* = 0" "print signed int !="
|
||||
test_expr "set variable v_int=0x7FFF" "print v_int < 0" "\\$\[0-9\]* = 0" "print v_int < 0x7FFF" "\\$\[0-9\]* = 0" "print signed int <"
|
||||
test_expr "set variable v_int=0x7FFF" "print v_int > 0" "\\$\[0-9\]* = 1" "print v_int > 0x7FFF" "\\$\[0-9\]* = 0" "print signed int >"
|
||||
# make int a minus
|
||||
test_expr "set variable v_int=-1" "print v_int == 0" "\\$\[0-9\]* = 0" "print v_int == -1" "\\$\[0-9\]* = 1" "print signed int == (minus)"
|
||||
test_expr "set variable v_int=-1" "print v_int != 0" "\\$\[0-9\]* = 1" "print v_int != -1" "\\$\[0-9\]* = 0" "print signed int != (minus)"
|
||||
test_expr "set variable v_int=-1" "print v_int < 0" "\\$\[0-9\]* = 1" "print v_int < 0x7FFF" "\\$\[0-9\]* = 1" "print signed int < (minus)"
|
||||
test_expr "set variable v_int=-1" "print v_int > 0" "\\$\[0-9\]* = 0" "print v_int > 0x7FFF" "\\$\[0-9\]* = 0" "print signed int > (minus)"
|
||||
#
|
||||
# test expressions with "signed int" types
|
||||
#
|
||||
test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int == 0" "\\$\[0-9\]* = 0" "print v_signed_int == 0x7FFF" "\\$\[0-9\]* = 1" "print signed signed int =="
|
||||
test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int != 0" "\\$\[0-9\]* = 1" "print v_signed_int != 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed int !="
|
||||
test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int < 0" "\\$\[0-9\]* = 0" "print v_signed_int < 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed int <"
|
||||
test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int > 0" "\\$\[0-9\]* = 1" "print v_signed_int > 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed int >"
|
||||
# make int a minus
|
||||
test_expr "set variable v_signed_int=-1" "print v_signed_int == 0" "\\$\[0-9\]* = 0" "print v_signed_int == -1" "\\$\[0-9\]* = 1" "print signed signed int == (minus)"
|
||||
test_expr "set variable v_signed_int=-1" "print v_signed_int != 0" "\\$\[0-9\]* = 1" "print v_signed_int != -1" "\\$\[0-9\]* = 0" "print signed signed int != (minus)"
|
||||
test_expr "set variable v_signed_int=-1" "print v_signed_int < 0" "\\$\[0-9\]* = 1" "print v_signed_int < 0x7FFF" "\\$\[0-9\]* = 1" "print signed signed int < (minus)"
|
||||
test_expr "set variable v_signed_int=-1" "print v_signed_int > 0" "\\$\[0-9\]* = 0" "print v_signed_int > 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed int > (minus)"
|
||||
#
|
||||
# test expressions with "unsigned int" types
|
||||
#
|
||||
test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int == 0" "\\$\[0-9\]* = 0" "print v_unsigned_int == 0x7FFF" "\\$\[0-9\]* = 1" "print unsigned int =="
|
||||
test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int != 0" "\\$\[0-9\]* = 1" "print v_unsigned_int != 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned int !="
|
||||
test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int < 0" "\\$\[0-9\]* = 0" "print v_unsigned_int < 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned int <"
|
||||
test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int > 0" "\\$\[0-9\]* = 1" "print v_unsigned_int > 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned int >"
|
||||
# make int a minus
|
||||
test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int == 0" "\\$\[0-9\]* = 0" "print v_unsigned_int == ~0" "\\$\[0-9\]* = 1" "print v_unsigned_int == (unsigned int)~0" "\\$\[0-9\]* = 1" "print unsigned int == (~0)"
|
||||
test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int != 0" "\\$\[0-9\]* = 1" "print v_unsigned_int != (unsigned int)~0" "\\$\[0-9\]* = 0" "print unsigned int != (~0)"
|
||||
test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int < 0" "\\$\[0-9\]* = 0" "print v_unsigned_int < 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned int < (~0)"
|
||||
test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int > 0" "\\$\[0-9\]* = 1" "print v_unsigned_int > 0x7FFF" "\\$\[0-9\]* = 1" "print unsigned int > (~0)"
|
||||
#
|
||||
# test expressions with "long" types
|
||||
#
|
||||
test_expr "set variable v_long=0x7FFF" "print v_long == 0" "\\$\[0-9\]* = 0" "print v_long == 0x7FFF" "\\$\[0-9\]* = 1" "print signed long =="
|
||||
test_expr "set variable v_long=0x7FFF" "print v_long != 0" "\\$\[0-9\]* = 1" "print v_long != 0x7FFF" "\\$\[0-9\]* = 0" "print signed long !="
|
||||
test_expr "set variable v_long=0x7FFF" "print v_long < 0" "\\$\[0-9\]* = 0" "print v_long < 0x7FFF" "\\$\[0-9\]* = 0" "print signed long <"
|
||||
test_expr "set variable v_long=0x7FFF" "print v_long > 0" "\\$\[0-9\]* = 1" "print v_long > 0x7FFF" "\\$\[0-9\]* = 0" "print signed long >"
|
||||
# make long a minus
|
||||
test_expr "set variable v_long=-1" "print v_long == 0" "\\$\[0-9\]* = 0" "print v_long == -1" "\\$\[0-9\]* = 1" "print signed long == (minus)"
|
||||
test_expr "set variable v_long=-1" "print v_long != 0" "\\$\[0-9\]* = 1" "print v_long != -1" "\\$\[0-9\]* = 0" "print signed long != (minus)"
|
||||
test_expr "set variable v_long=-1" "print v_long < 0" "\\$\[0-9\]* = 1" "print v_long < 0x7FFF" "\\$\[0-9\]* = 1" "print signed long < (minus)"
|
||||
test_expr "set variable v_long=-1" "print v_long > 0" "\\$\[0-9\]* = 0" "print v_long > 0x7FFF" "\\$\[0-9\]* = 0" "print signed long > (minus)"
|
||||
#
|
||||
# test expressions with "signed long" types
|
||||
#
|
||||
test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long == 0" "\\$\[0-9\]* = 0" "print v_signed_long == 0x7FFF" "\\$\[0-9\]* = 1" "print signed signed long =="
|
||||
test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long != 0" "\\$\[0-9\]* = 1" "print v_signed_long != 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed long !="
|
||||
test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long < 0" "\\$\[0-9\]* = 0" "print v_signed_long < 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed long <"
|
||||
test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long > 0" "\\$\[0-9\]* = 1" "print v_signed_long > 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed long >"
|
||||
# make long a minus
|
||||
test_expr "set variable v_signed_long=-1" "print v_signed_long == 0" "\\$\[0-9\]* = 0" "print v_signed_long == -1" "\\$\[0-9\]* = 1" "print signed signed long == (minus)"
|
||||
test_expr "set variable v_signed_long=-1" "print v_signed_long != 0" "\\$\[0-9\]* = 1" "print v_signed_long != -1" "\\$\[0-9\]* = 0" "print signed signed long != (minus)"
|
||||
test_expr "set variable v_signed_long=-1" "print v_signed_long < 0" "\\$\[0-9\]* = 1" "print v_signed_long < 0x7FFF" "\\$\[0-9\]* = 1" "print signed signed long < (minus)"
|
||||
test_expr "set variable v_signed_long=-1" "print v_signed_long > 0" "\\$\[0-9\]* = 0" "print v_signed_long > 0x7FFF" "\\$\[0-9\]* = 0" "print signed signed long > (minus)"
|
||||
#
|
||||
# test expressions with "unsigned long" types
|
||||
#
|
||||
test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long == 0" "\\$\[0-9\]* = 0" "print v_unsigned_long == 0x7FFF" "\\$\[0-9\]* = 1" "print unsigned long =="
|
||||
test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long != 0" "\\$\[0-9\]* = 1" "print v_unsigned_long != 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned long !="
|
||||
test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long < 0" "\\$\[0-9\]* = 0" "print v_unsigned_long < 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned long <"
|
||||
test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long > 0" "\\$\[0-9\]* = 1" "print v_unsigned_long > 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned long >"
|
||||
# make long a minus
|
||||
test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long == 0" "\\$\[0-9\]* = 0" "print v_unsigned_long == ~0" "\\$\[0-9\]* = 1" "print v_unsigned_long == (unsigned long)~0" "\\$\[0-9\]* = 1" "print unsigned long == (~0)"
|
||||
test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long != 0" "\\$\[0-9\]* = 1" "print v_unsigned_long != (unsigned long)~0" "\\$\[0-9\]* = 0" "print unsigned long != (~0)"
|
||||
test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long < 0" "\\$\[0-9\]* = 0" "print v_unsigned_long < 0x7FFF" "\\$\[0-9\]* = 0" "print unsigned long < (~0)"
|
||||
test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long > 0" "\\$\[0-9\]* = 1" "print v_unsigned_long > 0x7FFF" "\\$\[0-9\]* = 1" "print unsigned long > (~0)"
|
||||
9
gdb/testsuite/gdb.base/foo.c
Normal file
9
gdb/testsuite/gdb.base/foo.c
Normal file
@@ -0,0 +1,9 @@
|
||||
static int foox __attribute__ ((section (".data00"))) = 'f' + 'o' + 'o';
|
||||
|
||||
int foo (int x)
|
||||
{
|
||||
if (x)
|
||||
return foox;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
582
gdb/testsuite/gdb.base/funcargs.c
Normal file
582
gdb/testsuite/gdb.base/funcargs.c
Normal file
@@ -0,0 +1,582 @@
|
||||
/* Test passing of arguments to functions. Use various sorts of arguments,
|
||||
including basic types, pointers to those types, structures, lots of
|
||||
args, etc, in various combinations. */
|
||||
|
||||
/* AIX requires this to be the first thing in the file. */
|
||||
#ifdef __GNUC__
|
||||
# define alloca __builtin_alloca
|
||||
# define HAVE_STACK_ALLOCA 1
|
||||
#else /* not __GNUC__ */
|
||||
# ifdef _AIX
|
||||
#pragma alloca
|
||||
# define HAVE_STACK_ALLOCA 1
|
||||
# else /* Not AIX */
|
||||
# ifdef sparc
|
||||
# include <alloca.h>
|
||||
# define HAVE_STACK_ALLOCA 1
|
||||
# ifdef __STDC__
|
||||
void *alloca ();
|
||||
# else
|
||||
char *alloca ();
|
||||
# endif /* __STDC__ */
|
||||
# endif /* sparc */
|
||||
# endif /* Not AIX */
|
||||
#endif /* not __GNUC__ */
|
||||
|
||||
char c = 'a';
|
||||
char *cp = &c;
|
||||
|
||||
unsigned char uc = 'b';
|
||||
unsigned char *ucp = &uc;
|
||||
|
||||
short s = 1;
|
||||
short *sp = &s;
|
||||
|
||||
unsigned short us = 6;
|
||||
unsigned short *usp = &us;
|
||||
|
||||
int i = 2;
|
||||
int *ip = &i;
|
||||
|
||||
unsigned int ui = 7;
|
||||
unsigned int *uip = &ui;
|
||||
|
||||
long l = 3;
|
||||
long *lp = &l;
|
||||
|
||||
unsigned long ul = 8;
|
||||
unsigned long *ulp = &ul;
|
||||
|
||||
float f = 4.0;
|
||||
float *fp = &f;
|
||||
|
||||
double d = 5.0;
|
||||
double *dp = &d;
|
||||
|
||||
struct stag {
|
||||
int s1;
|
||||
int s2;
|
||||
} st = { 101, 102 };
|
||||
struct stag *stp = &st;
|
||||
|
||||
union utag {
|
||||
int u1;
|
||||
long u2;
|
||||
} un;
|
||||
union utag *unp = &un;
|
||||
|
||||
char carray[] = {'a', 'n', ' ', 'a', 'r', 'r', 'a', 'y', '\0'};
|
||||
|
||||
|
||||
/* Test various permutations and interleaving of integral arguments */
|
||||
|
||||
|
||||
call0a (c, s, i, l)
|
||||
char c; short s; int i; long l;
|
||||
{
|
||||
c = 'a';
|
||||
s = 5;
|
||||
i = 6;
|
||||
l = 7;
|
||||
}
|
||||
|
||||
call0b (s, i, l, c)
|
||||
short s; int i; long l; char c;
|
||||
{
|
||||
s = 6; i = 7; l = 8; c = 'j';
|
||||
}
|
||||
|
||||
call0c (i, l, c, s)
|
||||
int i; long l; char c; short s;
|
||||
{
|
||||
i = 3; l = 4; c = 'k'; s = 5;
|
||||
}
|
||||
|
||||
call0d (l, c, s, i)
|
||||
long l; char c; short s; int i;
|
||||
{
|
||||
l = 7; c = 'z'; s = 8; i = 9;
|
||||
}
|
||||
|
||||
call0e (c1, l, c2, i, c3, s, c4, c5)
|
||||
char c1; long l; char c2; int i; char c3; short s; char c4; char c5;
|
||||
{
|
||||
c1 = 'a'; l = 5; c2 = 'b'; i = 7; c3 = 'c'; s = 7; c4 = 'f'; c5 = 'g';
|
||||
}
|
||||
|
||||
|
||||
/* Test various permutations and interleaving of unsigned integral arguments */
|
||||
|
||||
|
||||
call1a (uc, us, ui, ul)
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
{
|
||||
uc = 5; us = 6; ui = 7; ul = 8;
|
||||
}
|
||||
|
||||
call1b (us, ui, ul, uc)
|
||||
unsigned short us; unsigned int ui; unsigned long ul; unsigned char uc;
|
||||
{
|
||||
uc = 5; us = 6; ui = 7; ul = 8;
|
||||
}
|
||||
|
||||
call1c (ui, ul, uc, us)
|
||||
unsigned int ui; unsigned long ul; unsigned char uc; unsigned short us;
|
||||
{
|
||||
uc = 5; us = 6; ui = 7; ul = 8;
|
||||
}
|
||||
|
||||
call1d (ul, uc, us, ui)
|
||||
unsigned long ul; unsigned char uc; unsigned short us; unsigned int ui;
|
||||
{
|
||||
uc = 5; us = 6; ui = 7; ul = 8;
|
||||
}
|
||||
|
||||
call1e (uc1, ul, uc2, ui, uc3, us, uc4, uc5)
|
||||
unsigned char uc1; unsigned long ul; unsigned char uc2; unsigned int ui;
|
||||
unsigned char uc3; unsigned short us; unsigned char uc4; unsigned char uc5;
|
||||
{
|
||||
uc1 = 5; ul = 7; uc2 = 8; ui = 9; uc3 = 10; us = 11; uc4 = 12; uc5 = 55;
|
||||
}
|
||||
|
||||
/* Test various permutations and interleaving of integral arguments with
|
||||
floating point arguments. */
|
||||
|
||||
|
||||
call2a (c, f1, s, d1, i, f2, l, d2)
|
||||
char c; float f1; short s; double d1; int i; float f2; long l; double d2;
|
||||
{
|
||||
c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
|
||||
}
|
||||
|
||||
call2b (f1, s, d1, i, f2, l, d2, c)
|
||||
float f1; short s; double d1; int i; float f2; long l; double d2; char c;
|
||||
{
|
||||
c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
|
||||
}
|
||||
|
||||
call2c (s, d1, i, f2, l, d2, c, f1)
|
||||
short s; double d1; int i; float f2; long l; double d2; char c; float f1;
|
||||
{
|
||||
c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
|
||||
}
|
||||
|
||||
call2d (d1, i, f2, l, d2, c, f1, s)
|
||||
double d1; int i; float f2; long l; double d2; char c; float f1; short s;
|
||||
{
|
||||
c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
|
||||
}
|
||||
|
||||
call2e (i, f2, l, d2, c, f1, s, d1)
|
||||
int i; float f2; long l; double d2; char c; float f1; short s; double d1;
|
||||
{
|
||||
c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
|
||||
}
|
||||
|
||||
call2f (f2, l, d2, c, f1, s, d1, i)
|
||||
float f2; long l; double d2; char c; float f1; short s; double d1; int i;
|
||||
{
|
||||
c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
|
||||
}
|
||||
|
||||
call2g (l, d2, c, f1, s, d1, i, f2)
|
||||
long l; double d2; char c; float f1; short s; double d1; int i; float f2;
|
||||
{
|
||||
c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
|
||||
}
|
||||
|
||||
call2h (d2, c, f1, s, d1, i, f2, l)
|
||||
double d2; char c; float f1; short s; double d1; int i; float f2; long l;
|
||||
{
|
||||
c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
|
||||
}
|
||||
|
||||
call2i (c1, f1, c2, c3, d1, c4, c5, c6, f2, s, c7, d2)
|
||||
char c1; float f1; char c2; char c3; double d1; char c4; char c5; char c6;
|
||||
float f2; short s; char c7; double d2;
|
||||
{
|
||||
c1 = 'a'; f1 = 0.0; c2 = 5; d1 = 0.0; c3 = 6; f2 = 0.1; c4 = 7; d2 = 0.2;
|
||||
c5 = 's'; c6 = 'f'; c7 = 'z'; s = 77;
|
||||
}
|
||||
|
||||
|
||||
/* Test pointers to various integral and floating types. */
|
||||
|
||||
|
||||
call3a (cp, sp, ip, lp)
|
||||
char *cp; short *sp; int *ip; long *lp;
|
||||
{
|
||||
cp = 0; sp = 0; ip = 0; lp = 0;
|
||||
}
|
||||
|
||||
call3b (ucp, usp, uip, ulp)
|
||||
unsigned char *ucp; unsigned short *usp; unsigned int *uip;
|
||||
unsigned long *ulp;
|
||||
{
|
||||
ucp = 0; usp = 0; uip = 0; ulp = 0;
|
||||
}
|
||||
|
||||
call3c (fp, dp)
|
||||
float *fp; double *dp;
|
||||
{
|
||||
fp = 0; dp = 0;
|
||||
}
|
||||
|
||||
|
||||
/* Test passing structures and unions by reference. */
|
||||
|
||||
|
||||
call4a (stp)
|
||||
struct stag *stp; {
|
||||
stp = 0;}
|
||||
|
||||
call4b (unp)
|
||||
union utag *unp;
|
||||
{
|
||||
unp = 0;
|
||||
}
|
||||
|
||||
|
||||
/* Test passing structures and unions by value. */
|
||||
|
||||
|
||||
call5a (st)
|
||||
struct stag st; {st.s1 = 5;}
|
||||
|
||||
call5b (un)
|
||||
union utag un; {un.u1 = 7;}
|
||||
|
||||
|
||||
/* Test shuffling of args */
|
||||
|
||||
|
||||
call6a (c, s, i, l, f, d, uc, us, ui, ul)
|
||||
char c; short s; int i; long l; float f; double d;
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
{
|
||||
c = c;
|
||||
call6b (s, i, l, f, d, uc, us, ui, ul);
|
||||
}
|
||||
|
||||
call6b (s, i, l, f, d, uc, us, ui, ul)
|
||||
short s; int i; long l; float f; double d;
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
{
|
||||
s = s;
|
||||
call6c (i, l, f, d, uc, us, ui, ul);
|
||||
}
|
||||
|
||||
call6c (i, l, f, d, uc, us, ui, ul)
|
||||
int i; long l; float f; double d;
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
{
|
||||
i = i;
|
||||
call6d (l, f, d, uc, us, ui, ul);
|
||||
}
|
||||
|
||||
call6d (l, f, d, uc, us, ui, ul)
|
||||
long l; float f; double d;
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
{
|
||||
l = l;
|
||||
call6e (f, d, uc, us, ui, ul);
|
||||
}
|
||||
|
||||
call6e (f, d, uc, us, ui, ul)
|
||||
float f; double d;
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
{
|
||||
f = f;
|
||||
call6f (d, uc, us, ui, ul);
|
||||
}
|
||||
|
||||
call6f (d, uc, us, ui, ul)
|
||||
double d;
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
{
|
||||
d = d;
|
||||
call6g (uc, us, ui, ul);
|
||||
}
|
||||
|
||||
call6g (uc, us, ui, ul)
|
||||
unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
|
||||
{
|
||||
uc = uc;
|
||||
call6h (us, ui, ul);
|
||||
}
|
||||
|
||||
call6h (us, ui, ul)
|
||||
unsigned short us; unsigned int ui; unsigned long ul;
|
||||
{
|
||||
us = us;
|
||||
call6i (ui, ul);
|
||||
}
|
||||
|
||||
call6i (ui, ul)
|
||||
unsigned int ui; unsigned long ul;
|
||||
{
|
||||
ui = ui;
|
||||
call6j (ul);
|
||||
}
|
||||
|
||||
call6j (ul)
|
||||
unsigned long ul;
|
||||
{
|
||||
ul = ul;
|
||||
call6k ();
|
||||
}
|
||||
|
||||
call6k ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/* Test shuffling of args, round robin */
|
||||
|
||||
|
||||
call7a (c, i, s, l, f, uc, d, us, ul, ui)
|
||||
char c; int i; short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui;
|
||||
{
|
||||
call7b (i, s, l, f, uc, d, us, ul, ui, c);
|
||||
}
|
||||
|
||||
call7b (i, s, l, f, uc, d, us, ul, ui, c)
|
||||
int i; short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c;
|
||||
{
|
||||
call7c (s, l, f, uc, d, us, ul, ui, c, i);
|
||||
}
|
||||
|
||||
call7c (s, l, f, uc, d, us, ul, ui, c, i)
|
||||
short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i;
|
||||
{
|
||||
call7d (l, f, uc, d, us, ul, ui, c, i, s);
|
||||
}
|
||||
|
||||
call7d (l, f, uc, d, us, ul, ui, c, i, s)
|
||||
long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s;
|
||||
{
|
||||
call7e (f, uc, d, us, ul, ui, c, i, s, l);
|
||||
}
|
||||
|
||||
call7e (f, uc, d, us, ul, ui, c, i, s, l)
|
||||
float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s; long l;
|
||||
{
|
||||
call7f (uc, d, us, ul, ui, c, i, s, l, f);
|
||||
}
|
||||
|
||||
call7f (uc, d, us, ul, ui, c, i, s, l, f)
|
||||
unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s; long l; float f;
|
||||
{
|
||||
call7g (d, us, ul, ui, c, i, s, l, f, uc);
|
||||
}
|
||||
|
||||
call7g (d, us, ul, ui, c, i, s, l, f, uc)
|
||||
double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s; long l; float f; unsigned char uc;
|
||||
{
|
||||
call7h (us, ul, ui, c, i, s, l, f, uc, d);
|
||||
}
|
||||
|
||||
call7h (us, ul, ui, c, i, s, l, f, uc, d)
|
||||
unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s; long l; float f; unsigned char uc; double d;
|
||||
{
|
||||
call7i (ul, ui, c, i, s, l, f, uc, d, us);
|
||||
}
|
||||
|
||||
call7i (ul, ui, c, i, s, l, f, uc, d, us)
|
||||
unsigned long ul; unsigned int ui; char c; int i; short s; long l; float f; unsigned char uc; double d; unsigned short us;
|
||||
{
|
||||
call7j (ui, c, i, s, l, f, uc, d, us, ul);
|
||||
}
|
||||
|
||||
call7j (ui, c, i, s, l, f, uc, d, us, ul)
|
||||
unsigned int ui; char c; int i; short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul;
|
||||
{
|
||||
call7k (c, i, s, l, f, uc, d, us, ul, ui);
|
||||
}
|
||||
|
||||
call7k (c, i, s, l, f, uc, d, us, ul, ui)
|
||||
char c; int i; short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui;
|
||||
{
|
||||
c = 'a'; i = 7; s = 8; l = 7; f = 0.3; uc = 44; d = 0.44; us = 77;
|
||||
ul = 43; ui = 33;
|
||||
}
|
||||
|
||||
|
||||
/* Test printing of structures passed as arguments to recursive functions. */
|
||||
|
||||
|
||||
typedef struct s
|
||||
{
|
||||
short s;
|
||||
int i;
|
||||
long l;
|
||||
} SVAL;
|
||||
|
||||
hitbottom ()
|
||||
{
|
||||
}
|
||||
|
||||
void recurse (a, depth)
|
||||
SVAL a;
|
||||
int depth;
|
||||
{
|
||||
a.s = a.i = a.l = --depth;
|
||||
if (depth == 0)
|
||||
hitbottom ();
|
||||
else
|
||||
recurse (a, depth);
|
||||
}
|
||||
|
||||
test_struct_args ()
|
||||
{
|
||||
SVAL s; s.s = 5; s.i = 5; s.l = 5;
|
||||
|
||||
recurse (s, 5);
|
||||
}
|
||||
|
||||
/* On various machines (pa, 29k, and rs/6000, at least), a function which
|
||||
calls alloca may do things differently with respect to frames. So give
|
||||
it a try. */
|
||||
|
||||
int
|
||||
localvars_after_alloca (c, s, i, l)
|
||||
char c;
|
||||
short s;
|
||||
int i;
|
||||
long l;
|
||||
{
|
||||
#ifdef HAVE_STACK_ALLOCA
|
||||
/* No need to use the alloca.c alloca-on-top-of-malloc; it doesn't
|
||||
test what we are looking for, so if we don't have an alloca which
|
||||
allocates on the stack, just don't bother to call alloca at all. */
|
||||
|
||||
char *z = alloca (s + 50);
|
||||
#endif
|
||||
c = 'a';
|
||||
s = 5;
|
||||
i = 6;
|
||||
l = 7;
|
||||
}
|
||||
|
||||
void
|
||||
call_after_alloca_subr (c, s, i, l, uc, us, ui, ul)
|
||||
char c; int i; short s; long l; unsigned char uc; unsigned short us; unsigned long ul; unsigned int ui;
|
||||
{
|
||||
c = 'a';
|
||||
i = 7; s = 8; l = 7; uc = 44; us = 77;
|
||||
ul = 43; ui = 33;
|
||||
}
|
||||
|
||||
int
|
||||
call_after_alloca (c, s, i, l)
|
||||
char c;
|
||||
short s;
|
||||
int i;
|
||||
long l;
|
||||
{
|
||||
#ifdef HAVE_STACK_ALLOCA
|
||||
/* No need to use the alloca.c alloca-on-top-of-malloc; it doesn't
|
||||
test what we are looking for, so if we don't have an alloca which
|
||||
allocates on the stack, just don't bother to call alloca at all. */
|
||||
|
||||
char *z = alloca (s + 50);
|
||||
#endif
|
||||
call_after_alloca_subr (c, s, i, l, 'b', 11, 12, (unsigned long)13);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* The point behind this test is the PA will call this indirectly
|
||||
through dyncall. Unlike the indirect calls to call0a, this test
|
||||
will require a trampoline between dyncall and this function on the
|
||||
call path, then another trampoline on between this function and main
|
||||
on the return path. */
|
||||
double
|
||||
call_with_trampolines (d1)
|
||||
double d1;
|
||||
{
|
||||
return d1;
|
||||
} /* End of call_with_trampolines, this comment is needed by funcargs.exp */
|
||||
|
||||
/* Dummy functions which the testsuite can use to run to, etc. */
|
||||
|
||||
void
|
||||
marker_indirect_call () {}
|
||||
|
||||
void
|
||||
marker_call_with_trampolines () {}
|
||||
|
||||
main ()
|
||||
{
|
||||
int (*pointer_to_call0a) () = call0a;
|
||||
double (*pointer_to_call_with_trampolines) () = call_with_trampolines;
|
||||
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
breakpoint();
|
||||
#endif
|
||||
/* Test calling with basic integer types */
|
||||
call0a (c, s, i, l);
|
||||
call0b (s, i, l, c);
|
||||
call0c (i, l, c, s);
|
||||
call0d (l, c, s, i);
|
||||
call0e (c, l, c, i, c, s, c, c);
|
||||
|
||||
/* Test calling with unsigned integer types */
|
||||
call1a (uc, us, ui, ul);
|
||||
call1b (us, ui, ul, uc);
|
||||
call1c (ui, ul, uc, us);
|
||||
call1d (ul, uc, us, ui);
|
||||
call1e (uc, ul, uc, ui, uc, us, uc, uc);
|
||||
|
||||
/* Test calling with integral types mixed with floating point types */
|
||||
call2a (c, f, s, d, i, f, l, d);
|
||||
call2b (f, s, d, i, f, l, d, c);
|
||||
call2c (s, d, i, f, l, d, c, f);
|
||||
call2d (d, i, f, l, d, c, f, s);
|
||||
call2e (i, f, l, d, c, f, s, d);
|
||||
call2f (f, l, d, c, f, s, d, i);
|
||||
call2g (l, d, c, f, s, d, i, f);
|
||||
call2h (d, c, f, s, d, i, f, l);
|
||||
call2i (c, f, c, c, d, c, c, c, f, s, c, d);;
|
||||
|
||||
/* Test dereferencing pointers to various integral and floating types */
|
||||
|
||||
call3a (cp, sp, ip, lp);
|
||||
call3b (ucp, usp, uip, ulp);
|
||||
call3c (fp, dp);
|
||||
|
||||
/* Test dereferencing pointers to structs and unions */
|
||||
|
||||
call4a (stp);
|
||||
un.u1 = 1;
|
||||
call4b (unp);
|
||||
|
||||
/* Test calling with structures and unions. */
|
||||
|
||||
call5a (st);
|
||||
un.u1 = 2;
|
||||
call5b (un);
|
||||
|
||||
/* Test shuffling of args */
|
||||
|
||||
call6a (c, s, i, l, f, d, uc, us, ui, ul);
|
||||
call7a (c, i, s, l, f, uc, d, us, ul, ui);
|
||||
|
||||
/* Test passing structures recursively. */
|
||||
|
||||
test_struct_args ();
|
||||
|
||||
localvars_after_alloca (c, s, i, l);
|
||||
|
||||
call_after_alloca (c, s, i, l);
|
||||
|
||||
/* This is for localvars_in_indirect_call. */
|
||||
marker_indirect_call ();
|
||||
/* The comment on the following two lines is used by funcargs.exp,
|
||||
don't change it. */
|
||||
(*pointer_to_call0a) (c, s, i, l); /* First step into call0a. */
|
||||
(*pointer_to_call0a) (c, s, i, l); /* Second step into call0a. */
|
||||
marker_call_with_trampolines ();
|
||||
(*pointer_to_call_with_trampolines) (d); /* Test multiple trampolines. */
|
||||
}
|
||||
1017
gdb/testsuite/gdb.base/funcargs.exp
Normal file
1017
gdb/testsuite/gdb.base/funcargs.exp
Normal file
File diff suppressed because it is too large
Load Diff
117
gdb/testsuite/gdb.base/gdbvars.exp
Normal file
117
gdb/testsuite/gdb.base/gdbvars.exp
Normal file
@@ -0,0 +1,117 @@
|
||||
# Copyright (C) 1992, 1997 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# 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
|
||||
|
||||
proc test_convenience_variables {} {
|
||||
global gdb_prompt
|
||||
|
||||
gdb_test "set \$foo = 101" "" \
|
||||
"Set a new convenience variable"
|
||||
|
||||
gdb_test "print \$foo" " = 101" \
|
||||
"Print contents of new convenience variable"
|
||||
|
||||
gdb_test "set \$foo = 301" "" \
|
||||
"Set convenience variable to a new value"
|
||||
|
||||
gdb_test "print \$foo" " = 301" \
|
||||
"Print new contents of convenience variable"
|
||||
|
||||
gdb_test "set \$_ = 11" "" \
|
||||
"Set convenience variable \$_"
|
||||
|
||||
gdb_test "print \$_" " = 11" \
|
||||
"Print contents of convenience variable \$_"
|
||||
|
||||
gdb_test "print \$foo + 10" " = 311" \
|
||||
"Use convenience variable in arithmetic expression"
|
||||
|
||||
gdb_test "print (\$foo = 32) + 4" " = 36" \
|
||||
"Use convenience variable assignment in arithmetic expression"
|
||||
|
||||
gdb_test "print \$bar" " = void" \
|
||||
"Print contents of uninitialized convenience variable"
|
||||
}
|
||||
|
||||
proc test_value_history {} {
|
||||
global gdb_prompt
|
||||
|
||||
gdb_test "print 101" "\\\$1 = 101" \
|
||||
"Set value-history\[1\] using \$1"
|
||||
|
||||
gdb_test "print 102" "\\\$2 = 102" \
|
||||
"Set value-history\[2\] using \$2"
|
||||
|
||||
gdb_test "print 103" "\\\$3 = 103" \
|
||||
"Set value-history\[3\] using \$3"
|
||||
|
||||
gdb_test "print \$\$" "\\\$4 = 102" \
|
||||
"Print value-history\[MAX-1\] using inplicit index \$\$"
|
||||
|
||||
gdb_test "print \$\$" "\\\$5 = 103" \
|
||||
"Print value-history\[MAX-1\] again using implicit index \$\$"
|
||||
|
||||
gdb_test "print \$" "\\\$6 = 103" \
|
||||
"Print value-history\[MAX\] using implicit index \$"
|
||||
|
||||
gdb_test "print \$\$2" "\\\$7 = 102" \
|
||||
"Print value-history\[MAX-2\] using explicit index \$\$2"
|
||||
|
||||
gdb_test "print \$0" "\\\$8 = 102" \
|
||||
"Print value-history\[MAX\] using explicit index \$0"
|
||||
|
||||
gdb_test "print 108" "\\\$9 = 108" ""
|
||||
|
||||
gdb_test "print \$\$0" "\\\$10 = 108" \
|
||||
"Print value-history\[MAX\] using explicit index \$\$0"
|
||||
|
||||
gdb_test "print \$1" "\\\$11 = 101" \
|
||||
"Print value-history\[1\] using explicit index \$1"
|
||||
|
||||
gdb_test "print \$2" "\\\$12 = 102" \
|
||||
"Print value-history\[2\] using explicit index \$2"
|
||||
|
||||
gdb_test "print \$3" "\\\$13 = 103" \
|
||||
"Print value-history\[3\] using explicit index \$3"
|
||||
|
||||
gdb_test "print \$-3" "\\\$14 = 100" \
|
||||
"Print (value-history\[MAX\] - 3) using implicit index \$"
|
||||
|
||||
gdb_test "print \$1 + 3" "\\\$15 = 104" \
|
||||
"Use value-history element in arithmetic expression"
|
||||
}
|
||||
|
||||
# Start with a fresh gdb.
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
|
||||
send_gdb "set print sevenbit-strings\n" ; gdb_expect -re ".*$gdb_prompt $"
|
||||
|
||||
test_value_history
|
||||
test_convenience_variables
|
||||
10
gdb/testsuite/gdb.base/grbx.c
Normal file
10
gdb/testsuite/gdb.base/grbx.c
Normal file
@@ -0,0 +1,10 @@
|
||||
static int grbxx __attribute__ ((section (".data03"))) = 'g' + 'r' + 'b' + 'x';
|
||||
|
||||
int grbx (int x)
|
||||
{
|
||||
if (x)
|
||||
return grbxx;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
542
gdb/testsuite/gdb.base/help.exp
Normal file
542
gdb/testsuite/gdb.base/help.exp
Normal file
@@ -0,0 +1,542 @@
|
||||
# Copyright (C) 1988, 1990, 1991, 1992, 1997, 1998
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# 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)
|
||||
|
||||
#
|
||||
# test gdb help commands
|
||||
#
|
||||
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
gdb_start
|
||||
|
||||
# force the height of the debugger to be pretty large so no pagers getused
|
||||
gdb_test "set height 400" "" "test set height"
|
||||
|
||||
# use a larger expect input buffer for long help outputs.
|
||||
# test help add-symbol-file
|
||||
gdb_test "help add-symbol-file" "Usage: add-symbol-file FILE ADDR.*\[\r\n\]+Load the symbols from FILE, assuming FILE has been dynamically loaded..*\[\r\n\]+ADDR is the starting address of the file\'s text." "help add-symbol-file"
|
||||
# test help aliases
|
||||
gdb_test "help aliases" "Aliases of other commands..*\[\r\n\]+List of commands\:.*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help aliases"
|
||||
gdb_test "help attach" "Attach to a process or file outside of GDB..*\[\r\n\]+This command attaches to another target, of the same type as your last.*\[\r\n\]+\"target\" command .\"info files\" will show your target stack.*\[\r\n\]+The command may take as argument a process id or a device file..*\[\r\n\]+For a process id, you must have permission to send the process a signal,.*\[\r\n\]+and it must have the same effective uid as the debugger..*\[\r\n\]+When using \"attach\" with a process id, the debugger finds the.*\[\r\n\]+program running in the process, looking first in the current working.*\[\r\n\]+directory, or .if not found there. using the source file search path.*\[\r\n\]+\\(see the \"directory\" command\\). You can also use the \"file\" command.*\[\r\n\]+to specify the program, and to load its symbol table." "help attach"
|
||||
# test help breakpoint "b" abbreviation
|
||||
gdb_test "help b" "Set breakpoint at specified line or function..*\[\r\n\]+Argument may be line number, function name, or \"\[*\]\" and an address..*\[\r\n\]+If line number is specified, break at start of code for that line..*\[\r\n\]+If function is specified, break at start of code for that function..*\[\r\n\]+If an address is specified, break at that exact address..*\[\r\n\]+With no arg, uses current execution address of selected stack frame..*\[\r\n\]+This is useful for breaking on return to a stack frame..*\[\r\n\]+Multiple breakpoints at one place are permitted, and useful if conditional..*\[\r\n\]+Do \"help breakpoints\" for info on other commands dealing with breakpoints." "help breakpoint \"b\" abbreviation"
|
||||
# test help breakpoint "br" abbreviation
|
||||
gdb_test "help br" "Set breakpoint at specified line or function..*\[\r\n\]+Argument may be line number, function name, or \"\[*\]\" and an address..*\[\r\n\]+If line number is specified, break at start of code for that line..*\[\r\n\]+If function is specified, break at start of code for that function..*\[\r\n\]+If an address is specified, break at that exact address..*\[\r\n\]+With no arg, uses current execution address of selected stack frame..*\[\r\n\]+This is useful for breaking on return to a stack frame..*\[\r\n\]+Multiple breakpoints at one place are permitted, and useful if conditional..*\[\r\n\]+Do \"help breakpoints\" for info on other commands dealing with breakpoints." "help breakpoint \"br\" abbreviation"
|
||||
# test help breakpoint "bre" abbreviation
|
||||
gdb_test "help bre" "Set breakpoint at specified line or function..*\[\r\n\]+Argument may be line number, function name, or \"\[*\]\" and an address..*\[\r\n\]+If line number is specified, break at start of code for that line..*\[\r\n\]+If function is specified, break at start of code for that function..*\[\r\n\]+If an address is specified, break at that exact address..*\[\r\n\]+With no arg, uses current execution address of selected stack frame..*\[\r\n\]+This is useful for breaking on return to a stack frame..*\[\r\n\]+Multiple breakpoints at one place are permitted, and useful if conditional..*\[\r\n\]+Do \"help breakpoints\" for info on other commands dealing with breakpoints." "help breakpoint \"bre\" abbreviation"
|
||||
# test help breakpoint "brea" abbreviation
|
||||
gdb_test "help brea" "Set breakpoint at specified line or function..*\[\r\n\]+Argument may be line number, function name, or \"\[*\]\" and an address..*\[\r\n\]+If line number is specified, break at start of code for that line..*\[\r\n\]+If function is specified, break at start of code for that function..*\[\r\n\]+If an address is specified, break at that exact address..*\[\r\n\]+With no arg, uses current execution address of selected stack frame..*\[\r\n\]+This is useful for breaking on return to a stack frame..*\[\r\n\]+Multiple breakpoints at one place are permitted, and useful if conditional..*\[\r\n\]+Do \"help breakpoints\" for info on other commands dealing with breakpoints." "help breakpoint \"brea\" abbreviation"
|
||||
# test help breakpoint "break" abbreviation
|
||||
gdb_test "help break" "Set breakpoint at specified line or function..*\[\r\n\]+Argument may be line number, function name, or \"\[*\]\" and an address..*\[\r\n\]+If line number is specified, break at start of code for that line..*\[\r\n\]+If function is specified, break at start of code for that function..*\[\r\n\]+If an address is specified, break at that exact address..*\[\r\n\]+With no arg, uses current execution address of selected stack frame..*\[\r\n\]+This is useful for breaking on return to a stack frame..*\[\r\n\]+Multiple breakpoints at one place are permitted, and useful if conditional..*\[\r\n\]+Do \"help breakpoints\" for info on other commands dealing with breakpoints." "help breakpoint \"break\" abbreviation"
|
||||
# test help breakpoints
|
||||
gdb_test "help breakpoints" "Making program stop at certain points..*\[\r\n\]+List of commands\:.*\[\r\n\]+awatch -- Set a watchpoint for an expression.*\[\r\n\]+break -- Set breakpoint at specified line or function.*\[\r\n\]+catch -- Set catchpoints to catch events.*\[\r\n\]+clear -- Clear breakpoint at specified line or function.*\[\r\n\]+commands -- Set commands to be executed when a breakpoint is hit.*\[\r\n\]+condition -- Specify breakpoint number N to break only if COND is true.*\[\r\n\]+delete -- Delete some breakpoints or auto-display expressions.*\[\r\n\]+disable -- Disable some breakpoints.*\[\r\n\]+enable -- Enable some breakpoints.*\[\r\n\]+hbreak -- Set a hardware assisted breakpoint.*\[\r\n\]+ignore -- Set ignore-count of breakpoint number N to COUNT.*\[\r\n\]+rwatch -- Set a read watchpoint for an expression.*\[\r\n\]+tbreak -- Set a temporary breakpoint.*\[\r\n\]+tcatch -- Set temporary catchpoints to catch events.*\[\r\n\]+thbreak -- Set a temporary hardware assisted breakpoint.*\[\r\n\]+watch -- Set a watchpoint for an expression.*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help breakpoints"
|
||||
# test help backtrace "bt" abbreviation
|
||||
gdb_test "help bt" "Print backtrace of all stack frames, or innermost COUNT frames..*\[\r\n\]+With a negative argument, print outermost -COUNT frames..*\[\r\n\]+Use of the 'full' qualifier also prints the values of the local variables." "help backtrace \"bt\" abbreviation"
|
||||
# test help backtrace
|
||||
gdb_test "help backtrace" "Print backtrace of all stack frames, or innermost COUNT frames..*\[\r\n\]+With a negative argument, print outermost -COUNT frames..*\[\r\n\]+Use of the 'full' qualifier also prints the values of the local variables." "help backtrace"
|
||||
# test help continue "c" abbreviation
|
||||
gdb_test "help c" "Continue program being debugged.*" "help continue \"c\" abbreviation"
|
||||
# test help continue
|
||||
gdb_test "help continue" "Continue program being debugged.*" "help continue"
|
||||
# test help call
|
||||
gdb_test "help call" "Call a function.*" "help call"
|
||||
# test help catch
|
||||
gdb_test "help catch" "Set catchpoints to catch events.*Raised signals may be caught:.*catch signal.*all signals.*catch signal.*signame.*a particular signal.*Raised exceptions may be caught:.*catch throw.*all exceptions, when thrown.*catch throw.*exceptname.*a particular exception, when thrown.*catch catch.*all exceptions, when caught.*catch catch.*exceptname.*a particular exception, when caught.*Thread or process events may be caught:.*catch thread_start.*any threads, just after creation.*catch thread_exit.*any threads, just before expiration.*catch thread_join.*any threads, just after joins.*catch start.*any processes, just after creation.*catch exit.*any processes, just before expiration.*catch fork.*calls to fork.*catch vfork.*calls to vfork.*catch exec.*calls to exec.*Dynamically.linked library events may be caught:.*catch load.*loads of any library.*catch load.*libname.*loads of a particular library.*catch unload.*unloads of any library.*catch unload.*libname.*unloads of a particular library.*The act of your program's execution stopping may also be caught:.*catch stop.*Do.*help set follow-fork-mode.*for info on debugging your program.*after a fork or vfork is caught.*Do.*help breakpoints.*for info on other commands dealing with breakpoints." "help catch"
|
||||
# test help cd
|
||||
gdb_test "help cd" "Set working directory to DIR for debugger and program being debugged..*\[\r\n\]+The change does not take effect for the program being debugged.*\[\r\n\]+until the next time it is started." "help cd"
|
||||
# test help clear
|
||||
gdb_test "help clear" "Clear breakpoint at specified line or function.*\[\r\n\]+Argument may be line number, function name, or .* and an address.*\[\r\n\]+If line number is specified, all breakpoints in that line are cleared.*\[\r\n\]+If function is specified, breakpoints at beginning of function are cleared.*\[\r\n\]+If an address is specified, breakpoints at that address are cleared.*\[\r\n\]+With no argument, clears all breakpoints in the line that the selected frame.*\[\r\n\]+is executing in..*\[\r\n\]+See also the \"delete\" command which clears breakpoints by number." "help clear"
|
||||
# test help commands
|
||||
gdb_test "help commands" "Set commands to be executed when a breakpoint is hit..*\[\r\n\]+Give breakpoint number as argument after \"commands\"..*\[\r\n\]+With no argument, the targeted breakpoint is the last one set..*\[\r\n\]+The commands themselves follow starting on the next line..*\[\r\n\]+Type a line containing \"end\" to indicate the end of them..*\[\r\n\]+Give \"silent\" as the first line to make the breakpoint silent;.*\[\r\n\]+then no output is printed when it is hit, except what the commands print." "help commands"
|
||||
# test help condition
|
||||
gdb_test "help condition" "Specify breakpoint number N to break only if COND is true..*\[\r\n\]+Usage is `condition N COND', where N is an integer and COND is an.*\[\r\n\]+expression to be evaluated whenever breakpoint N is reached. " "help condition"
|
||||
# test help core-file
|
||||
gdb_test "help core-file" "Use FILE as core dump for examining memory and registers..*\[\r\n\]+No arg means have no core file. This command has been superseded by the.*\[\r\n\]+`target core' and `detach' commands." "help core-file"
|
||||
# test help delete "d" abbreviation
|
||||
gdb_test "help d" "Delete some breakpoints or auto-display expressions..*\[\r\n\]+Arguments are breakpoint numbers with spaces in between..*\[\r\n\]+To delete all breakpoints, give no argument..*\[\r\n\]+Also a prefix command for deletion of other GDB objects..*\[\r\n\]+The \"unset\" command is also an alias for \"delete\"..*\[\r\n\]+List of delete subcommands:.*\[\r\n\]+delete breakpoints -- Delete some breakpoints or auto-display expressions.*\[\r\n\]+delete display -- Cancel some expressions to be displayed when program stops.*\[\r\n\]+Type \"help delete\" followed by delete subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help delete \"d\" abbreviation"
|
||||
# test help delete
|
||||
gdb_test "help delete" "Delete some breakpoints or auto-display expressions..*\[\r\n\]+Arguments are breakpoint numbers with spaces in between..*\[\r\n\]+To delete all breakpoints, give no argument..*\[\r\n\]+Also a prefix command for deletion of other GDB objects..*\[\r\n\]+The \"unset\" command is also an alias for \"delete\"..*\[\r\n\]+List of delete subcommands:.*\[\r\n\]+delete breakpoints -- Delete some breakpoints or auto-display expressions.*\[\r\n\]+delete display -- Cancel some expressions to be displayed when program stops.*\[\r\n\]+Type \"help delete\" followed by delete subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help delete"
|
||||
# test help data
|
||||
gdb_test "help data" ".*\[\r\n\]+Examining data..*\[\r\n\]+List of commands:.*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help data"
|
||||
# test help define
|
||||
gdb_test "help define" "Define a new command.*" "help define"
|
||||
# test help delete breakpoints
|
||||
gdb_test "help delete breakpoints" "Delete some breakpoints or auto-display expressions..*\[\r\n\]+Arguments are breakpoint numbers with spaces in between..*\[\r\n\]+To delete all breakpoints, give no argument..*\[\r\n\]+This command may be abbreviated \"delete\"." "help delete breakpoints"
|
||||
# test help delete display
|
||||
gdb_test "help delete display" "Cancel some expressions to be displayed when program stops..*\[\r\n\]+Arguments are the code numbers of the expressions to stop displaying..*\[\r\n\]+No argument means cancel all automatic-display expressions..*\[\r\n\]+Do \"info display\" to see current list of code numbers." "help delete display"
|
||||
# test help detach
|
||||
gdb_test "help detach" "Detach a process or file previously attached.\[\r\n\]+If a process, it is no longer traced, and it continues its execution.\[ \r\n\]+If\[ \r\n\]+you were debugging a file, the file is closed and gdb no longer accesses it." "help detach"
|
||||
# test help directory
|
||||
gdb_test "help directory" "Add directory DIR to beginning of search path for source files..*\[\r\n\]+Forget cached info on source file locations and line positions..*\[\r\n\]+DIR can also be .cwd for the current working directory, or .cdir for the.*\[\r\n\]+directory in which the source file was compiled into object code..*\[\r\n\]+With no argument, reset the search path to .cdir:.cwd, the default." "help directory"
|
||||
# test help disable "dis" abbreviation
|
||||
gdb_test "help dis" "Disable some breakpoints..*\[\r\n\]+Arguments are breakpoint numbers with spaces in between..*\[\r\n\]+To disable all breakpoints, give no argument..*\[\r\n\]+A disabled breakpoint is not forgotten, but has no effect until reenabled..*\[\r\n\]+List of disable subcommands:.*\[\r\n\]+disable breakpoints -- Disable some breakpoints.*\[\r\n\]+disable display -- Disable some expressions to be displayed when program stops.*\[\r\n\]+Type \"help disable\" followed by disable subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help disable \"dis\" abbreviation"
|
||||
# test help disable "disa" abbreviation
|
||||
gdb_test "help disa" "Disable some breakpoints..*\[\r\n\]+Arguments are breakpoint numbers with spaces in between..*\[\r\n\]+To disable all breakpoints, give no argument..*\[\r\n\]+A disabled breakpoint is not forgotten, but has no effect until reenabled..*\[\r\n\]+List of disable subcommands:.*\[\r\n\]+disable breakpoints -- Disable some breakpoints.*\[\r\n\]+disable display -- Disable some expressions to be displayed when program stops.*\[\r\n\]+Type \"help disable\" followed by disable subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help disable \"disa\" abbreviation"
|
||||
# test help disable
|
||||
gdb_test "help disable" "Disable some breakpoints..*\[\r\n\]+Arguments are breakpoint numbers with spaces in between..*\[\r\n\]+To disable all breakpoints, give no argument..*\[\r\n\]+A disabled breakpoint is not forgotten, but has no effect until reenabled..*\[\r\n\]+List of disable subcommands:.*\[\r\n\]+disable breakpoints -- Disable some breakpoints.*\[\r\n\]+disable display -- Disable some expressions to be displayed when program stops.*\[\r\n\]+Type \"help disable\" followed by disable subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help disable"
|
||||
# test help disable breakpoints
|
||||
gdb_test "help disable breakpoints" "Disable some breakpoints..*\[\r\n\]+Arguments are breakpoint numbers with spaces in between..*\[\r\n\]+To disable all breakpoints, give no argument..*\[\r\n\]+A disabled breakpoint is not forgotten, but has no effect until reenabled..*\[\r\n\]+This command may be abbreviated \"disable\"." "help disable breakpoints"
|
||||
# test help disable display
|
||||
gdb_test "help disable display" "Disable some expressions to be displayed when program stops..*\[\r\n\]+Arguments are the code numbers of the expressions to stop displaying..*\[\r\n\]+No argument means disable all automatic-display expressions..*\[\r\n\]+Do \"info display\" to see current list of code numbers." "help disable display"
|
||||
# test help disassemble
|
||||
gdb_test "help disassemble" "Disassemble a specified section of memory..*\[\r\n\]+Default is the function surrounding the pc of the selected frame..*\[\r\n\]+With a single argument, the function surrounding that address is dumped..*\[\r\n\]+Two arguments are taken as a range of memory to dump." "help disassemble"
|
||||
# test help display
|
||||
gdb_test "help display" "Print value of expression EXP each time the program stops..*\[\r\n\]+/FMT may be used before EXP as in the \"print\" command..*\[\r\n\]+/FMT \"i\" or \"s\" or including a size-letter is allowed,.*\[\r\n\]+as in the \"x\" command, and then EXP is used to get the address to examine.*\[\r\n\]+and examining is done as in the \"x\" command..*\[\r\n\]+With no argument, display all currently requested auto-display expressions..*\[\r\n\]+Use \"undisplay\" to cancel display requests previously made." "help display"
|
||||
# test help do
|
||||
gdb_test "help do" "Select and print stack frame called by this one..*\[\r\n\]+An argument says how many frames down to go." "help do"
|
||||
# test help document
|
||||
gdb_test "help document" "Document a user-defined command..*\[\r\n\]+Give command name as argument. Give documentation on following lines..*\[\r\n\]+End with a line of just \"end\"." "help document"
|
||||
# test help down
|
||||
gdb_test "help down" "Select and print stack frame called by this one..*\[\r\n\]+An argument says how many frames down to go." "help down"
|
||||
# test help down-silently
|
||||
gdb_test "help down-silently" "Same as the `down' command, but does not print anything..*\[\r\n\]+This is useful in command scripts." "help down-silently"
|
||||
# this command was removed from GDB 4.5.8
|
||||
# test help dump-me
|
||||
#send_gdb "help dump-me"
|
||||
# -re "Get fatal error; make debugger dump its core."
|
||||
#
|
||||
# }
|
||||
# test help echo
|
||||
gdb_test "help echo" "Print a constant string. Give string as argument..*\[\r\n\]+C escape sequences may be used in the argument..*\[\r\n\]+No newline is added at the end of the argument;.*\[\r\n\]+use \".n\" if you want a newline to be printed..*\[\r\n\]+Since leading and trailing whitespace are ignored in command arguments,.*\[\r\n\]+if you want to print some you must use \".\" before leading whitespace.*\[\r\n\]+to be printed or after trailing whitespace." "help echo"
|
||||
# test help enable breakpoints delete
|
||||
gdb_test "help enable breakpoints delete" "Enable breakpoints and delete when hit. Give breakpoint numbers..*\[\r\n\]+If a breakpoint is hit while enabled in this fashion, it is deleted." "help enable breakpoints delete"
|
||||
# test help enable breakpoints once
|
||||
gdb_test "help enable breakpoints once" "Enable breakpoints for one hit..*" "help enable breakpoints once"
|
||||
# test help enable breakpoints
|
||||
gdb_test "help enable breakpoints" "Enable some breakpoints..*\[\r\n\]+Give breakpoint numbers .separated by spaces. as arguments..*\[\r\n\]+This is used to cancel the effect of the \"disable\" command..*\[\r\n\]+May be abbreviated to simply \"enable\"..*.*\[\r\n\]+List of enable breakpoints subcommands:.*\[\r\n\]+enable breakpoints delete -- Enable breakpoints and delete when hit.*\[\r\n\]+enable breakpoints once -- Enable breakpoints for one hit.*\[\r\n\]+Type \"help enable breakpoints\" followed by enable breakpoints subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help enable breakpoints"
|
||||
# test help enable delete
|
||||
gdb_test "help enable delete" "Enable breakpoints and delete when hit. Give breakpoint numbers..*\[\r\n\]+If a breakpoint is hit while enabled in this fashion, it is deleted." "help enable delete"
|
||||
# test help enable display
|
||||
gdb_test "help enable display" "Enable some expressions to be displayed when program stops..*\[\r\n\]+Arguments are the code numbers of the expressions to resume displaying..*\[\r\n\]+No argument means enable all automatic-display expressions..*\[\r\n\]+Do \"info display\" to see current list of code numbers." "help enable display"
|
||||
# test help enable once
|
||||
gdb_test "help enable once" "Enable breakpoints for one hit.*" "help enable once"
|
||||
# test help enable
|
||||
gdb_test "help enable" "Enable some breakpoints..*\[\r\n\]+Give breakpoint numbers .separated by spaces. as arguments..*\[\r\n\]+With no subcommand, breakpoints are enabled until you command otherwise..*\[\r\n\]+This is used to cancel the effect of the \"disable\" command..*\[\r\n\]+With a subcommand you can enable temporarily..*\[\r\n\]+List of enable subcommands:.*\[\r\n\]+enable delete -- Enable breakpoints and delete when hit.*\[\r\n\]+enable display -- Enable some expressions to be displayed when program stops.*\[\r\n\]+enable once -- Enable breakpoints for one hit.*\[\r\n\]+Type \"help enable\" followed by enable subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help enable"
|
||||
# test help exec-file
|
||||
gdb_test "help exec-file" "Use FILE as program for getting contents of pure memory..*\[\r\n\]+If FILE cannot be found as specified, your execution directory path.*\[\r\n\]+is searched for a command of that name..*\[\r\n\]+No arg means have no executable file." "help exec-file"
|
||||
# test help frame "f" abbreviation
|
||||
gdb_test "help f" "Select and print a stack frame..*\[\r\n\]+With no argument, print the selected stack frame. .See also \"info frame\".*\[\r\n\]+An argument specifies the frame to select..*\[\r\n\]+It can be a stack frame number or the address of the frame..*\[\r\n\]+With argument, nothing is printed if input is coming from.*\[\r\n\]+a command file or a user-defined command." "help frame \"f\" abbreviation"
|
||||
# test help frame
|
||||
gdb_test "help frame" "Select and print a stack frame..*\[\r\n\]+With no argument, print the selected stack frame. .See also \"info frame\"...*\[\r\n\]+An argument specifies the frame to select..*\[\r\n\]+It can be a stack frame number or the address of the frame..*\[\r\n\]+With argument, nothing is printed if input is coming from.*\[\r\n\]+a command file or a user-defined command." "help frame"
|
||||
# test help fg
|
||||
gdb_test "help fg" "Continue program being debugged.*" "help fg"
|
||||
# test help file
|
||||
gdb_test "help file" "Use FILE as program to be debugged..*\[\r\n\]+It is read for its symbols, for getting the contents of pure memory,.*\[\r\n\]+and it is the program executed when you use the `run' command..*\[\r\n\]+If FILE cannot be found as specified, your execution directory path.*\[\r\n\]+..PATH. is searched for a command of that name..*\[\r\n\]+No arg means to have no executable file and no symbols." "help file"
|
||||
# test help files
|
||||
gdb_test "help files" "Specifying.*" "help files"
|
||||
# test help finish
|
||||
gdb_test "help finish" "Execute until selected stack frame returns..*\[\r\n\]+Upon return, the value returned is printed and put in the value history." "help finish"
|
||||
# test help forward-search
|
||||
gdb_test "help forward-search" "Search for regular expression .see regex.3.. from last line listed..*" "help forward-search"
|
||||
# test help help "h" abbreviation
|
||||
gdb_test "help h" "Print list of commands." "help help \"h\" abbreviation"
|
||||
# test help help
|
||||
gdb_test "help help" "Print list of commands." "help help"
|
||||
# test help handle
|
||||
gdb_test "help handle" "Specify how to handle a signal..*" "help handle"
|
||||
# test help info "i" abbreviation
|
||||
gdb_test "help i" "Generic command for showing things about the program being debugged..*\[\r\n\]+List of info subcommands:.*\[\r\n\]+Type \"help info\" followed by info subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help info \"i\" abbreviation"
|
||||
# test help info
|
||||
gdb_test "help info" "Generic command for showing things about the program being debugged..*\[\r\n\]+List of info subcommands:.*\[\r\n\]+Type \"help info\" followed by info subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help info"
|
||||
# test help ignore
|
||||
gdb_test "help ignore" "Set ignore-count of breakpoint number N to COUNT..*\[\r\n\]+Usage is `ignore N COUNT'." "help ignore"
|
||||
# test help info address
|
||||
gdb_test "help info address" "Describe where symbol SYM is stored." "help info address"
|
||||
# test help info all-registers
|
||||
gdb_test "help info all-registers" "List of all registers and their contents, for selected stack frame..*\[\r\n\]+Register name as argument means describe only that register." "help info all-registers"
|
||||
# test help info args
|
||||
gdb_test "help info args" "Argument variables of current stack frame." "help info args"
|
||||
# test help info breakpoints
|
||||
gdb_test "help info breakpoints" "Status of user-settable breakpoints, or breakpoint number NUMBER..*\[\r\n\]+breakpoint set." "help info breakpoints"
|
||||
# test help info catch
|
||||
gdb_test "help info catch" "Exceptions that can be caught in the current stack frame." "help info catch"
|
||||
# test help info copying
|
||||
gdb_test "help info copying" "Conditions for redistributing copies of GDB." "help info copying"
|
||||
# test help info display
|
||||
gdb_test "help info display" "Expressions to display when program stops, with code numbers." "help info display"
|
||||
# test help info frame "f" abbreviation
|
||||
gdb_test "help info f" "All about selected stack frame, or frame at ADDR." "help info frame \"f\" abbreviation"
|
||||
# test help info frame
|
||||
gdb_test "help info frame" "All about selected stack frame, or frame at ADDR." "help info frame"
|
||||
# test help info files
|
||||
gdb_test "help info files" "Names of targets and files being debugged..*\[\r\n\]+Shows the entire stack of targets currently in use .including the exec-file,.*\[\r\n\]+core-file, and process, if any., as well as the symbol file name." "help info files"
|
||||
# test help info float
|
||||
gdb_test "help info float" "Print the status of the floating point unit" "help info float"
|
||||
# test help info functions
|
||||
gdb_test "help info functions" "All function names, or those matching REGEXP." "help info functions"
|
||||
# test help info line
|
||||
gdb_test "help info line" "Core addresses of the code for a source line..*\[\r\n\]+Line can be specified as.*\[\r\n\]+ LINENUM, to list around that line in current file,.*\[\r\n\]+ FILE:LINENUM, to list around that line in that file,.*\[\r\n\]+ FUNCTION, to list around beginning of that function,.*\[\r\n\]+ FILE:FUNCTION, to distinguish among like-named static functions..*\[\r\n\]+Default is to describe the last source line that was listed..*\[\r\n\]+This sets the default address for \"x\" to the line's first instruction.*\[\r\n\]+so that \"x.i\" suffices to start examining the machine code..*\[\r\n\]+The address is also stored as the value of \"._\"." "help info line"
|
||||
# test help info locals
|
||||
gdb_test "help info locals" "Local variables of current stack frame." "help info locals"
|
||||
# test help info program
|
||||
gdb_test "help info program" "Execution status of the program." "help info program"
|
||||
# test help info registers
|
||||
gdb_test "help info registers" "List of integer registers and their contents, for selected stack frame..*\[\r\n\]+Register name as argument means describe only that register." "help info registers"
|
||||
# test help info stack "s" abbreviation
|
||||
gdb_test "help info s" "Backtrace of the stack, or innermost COUNT frames." "help info stack \"s\" abbreviation"
|
||||
# test help info stack
|
||||
gdb_test "help info stack" "Backtrace of the stack, or innermost COUNT frames." "help info stack"
|
||||
# test help info set
|
||||
gdb_test "help info set" "Show all GDB settings." "help info set"
|
||||
# test help info signals
|
||||
gdb_test "help info signals" "What debugger does when program gets various signals.*" "help info signals"
|
||||
# test help info source
|
||||
gdb_test "help info source" "Information about the current source file." "help info source"
|
||||
# test help info sources
|
||||
gdb_test "help info sources" "Source files in the program." "help info sources"
|
||||
# test help info symbol
|
||||
gdb_test "help info symbol" "Describe what symbol is at location ADDR.*"
|
||||
# test help info target
|
||||
gdb_test "help info target" "Names of targets and files being debugged..*\[\r\n\]+Shows the entire stack of targets currently in use .including the exec-file,.*\[\r\n\]+core-file, and process, if any., as well as the symbol file name." "help info target"
|
||||
# test help info terminal
|
||||
gdb_test "help info terminal" "Print inferior's saved terminal status." "help info terminal"
|
||||
# test help info types
|
||||
gdb_test "help info types" "All type names, or those matching REGEXP." "help info types"
|
||||
# test help info variables
|
||||
gdb_test "help info variables" "All global and static variable names, or those matching REGEXP." "help info variables"
|
||||
# test help info warranty
|
||||
gdb_test "help info warranty" "Various kinds of warranty you do not have." "help info warranty"
|
||||
# test help info watchpoints
|
||||
gdb_test "help info watchpoints" "Synonym for ``info breakpoints''." "help info watchpoints"
|
||||
# test help inspect
|
||||
gdb_test "help inspect" "Same as \"print\" command, except that if you are running in the epoch.*\[\r\n\]+environment, the value is printed in its own window." "help inspect"
|
||||
# test help jump
|
||||
gdb_test "help jump" "Continue program being debugged at specified line or address..*\[\r\n\]+Give as argument either LINENUM or \[*\]+ADDR, where ADDR is an expression.*\[\r\n\]+for an address to start at." "help jump"
|
||||
# test help kill
|
||||
gdb_test "help kill" "Kill execution of program being debugged." "help kill"
|
||||
# test help list "l" abbreviation
|
||||
gdb_test "help l" "List specified function or line..*\[\r\n\]+With no argument, lists ten more lines after or around previous listing..*\[\r\n\]+\"list -\" lists the ten lines before a previous ten-line listing..*\[\r\n\]+One argument specifies a line, and ten lines are listed around that line..*\[\r\n\]+Two arguments with comma between specify starting and ending lines to list..*\[\r\n\]+Lines can be specified in these ways:.*\[\r\n\]+ LINENUM, to list around that line in current file,.*\[\r\n\]+ FILE:LINENUM, to list around that line in that file,.*\[\r\n\]+ FUNCTION, to list around beginning of that function,.*\[\r\n\]+ FILE:FUNCTION, to distinguish among like-named static functions..*\[\r\n\]+ \[*\]+ADDRESS, to list around the line containing that address..*\[\r\n\]+With two args if one is empty it stands for ten lines away from the other arg." "help list \"l\" abbreviation"
|
||||
# test help list
|
||||
gdb_test "help list" "List specified function or line..*\[\r\n\]+With no argument, lists ten more lines after or around previous listing..*\[\r\n\]+\"list -\" lists the ten lines before a previous ten-line listing..*\[\r\n\]+One argument specifies a line, and ten lines are listed around that line..*\[\r\n\]+Two arguments with comma between specify starting and ending lines to list..*\[\r\n\]+Lines can be specified in these ways:.*\[\r\n\]+ LINENUM, to list around that line in current file,.*\[\r\n\]+ FILE:LINENUM, to list around that line in that file,.*\[\r\n\]+ FUNCTION, to list around beginning of that function,.*\[\r\n\]+ FILE:FUNCTION, to distinguish among like-named static functions..*\[\r\n\]+ \[*\]+ADDRESS, to list around the line containing that address..*\[\r\n\]+With two args if one is empty it stands for ten lines away from the other arg." "help list"
|
||||
# test help load
|
||||
gdb_test "help load" "Dynamically load FILE into the running program, and record its symbols.*\[\r\n\]+for access from GDB." "help load"
|
||||
# test help make
|
||||
gdb_test "help make" "Run the ``make'' program using the rest of the line as arguments." "help make"
|
||||
# test help next "n" abbreviation
|
||||
gdb_test "help n" "Step program, proceeding through subroutine calls..*\[\r\n\]+Like the \"step\" command as long as subroutine calls do not happen;.*\[\r\n\]+when they do, the call is treated as one instruction..*\[\r\n\]+Argument N means do this N times .or till program stops for another reason.." "help next \"n\" abbreviation"
|
||||
# test help next
|
||||
gdb_test "help next" "Step program, proceeding through subroutine calls..*\[\r\n\]+Like the \"step\" command as long as subroutine calls do not happen;.*\[\r\n\]+when they do, the call is treated as one instruction..*\[\r\n\]+Argument N means do this N times .or till program stops for another reason.." "help next"
|
||||
# test help nexti
|
||||
gdb_test "help ni" "Step one instruction, but proceed through subroutine calls..*\[\r\n\]+Argument N means do this N times .or till program stops for another reason.." "help nexti"
|
||||
# all the commands that used to be here are now in "maintainance" instead
|
||||
# test help obscure
|
||||
gdb_test "help obscure" "Obscure features..*\[\r\n\]+List of commands:.*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help obscure"
|
||||
# test help output
|
||||
gdb_test "help output" "Like \"print\" but don't put in value history and don't print newline..*\[\r\n\]+This is useful in user-defined commands." "help output"
|
||||
# test help overlay
|
||||
gdb_test "help overlay" "Commands for debugging overlays.*"
|
||||
gdb_test "help overlay off" "Disable overlay debugging."
|
||||
gdb_test "help overlay manual" "Enable overlay debugging."
|
||||
gdb_test "help overlay auto" "Enable automatic overlay debugging."
|
||||
gdb_test "help overlay list" "List mappings of overlay sections."
|
||||
gdb_test "help overlay map" "Assert that an overlay section is mapped."
|
||||
gdb_test "help overlay unmap" "Assert that an overlay section is unmapped."
|
||||
gdb_test "help overlay load" "Read the overlay mapping state from the target."
|
||||
# test help print "p" abbreviation
|
||||
gdb_test "help p" "Print value of expression EXP..*\[\r\n\]+Variables accessible are those of the lexical environment of the selected.*\[\r\n\]+EXP may be preceded with /FMT, where FMT is a format letter.*\[\r\n\]+but no count or size letter .see \"x\" command.." "help print \"p\" abbreviation"
|
||||
# test help print
|
||||
gdb_test "help print" "Print value of expression EXP..*\[\r\n\]+Variables accessible are those of the lexical environment of the selected.*\[\r\n\]+EXP may be preceded with /FMT, where FMT is a format letter.*\[\r\n\]+but no count or size letter .see \"x\" command.." "help print"
|
||||
# test help path
|
||||
gdb_test "help path" "Add directory DIR.s. to beginning of search path for object files..*\[\r\n\]+.cwd in the path means the current working directory..*\[\r\n\]+This path is equivalent to the .PATH shell variable. It is a list of.*\[\r\n\]+directories, separated by colons. These directories are searched to find.*\[\r\n\]+fully linked executable files and separately compiled object files as needed." "help path"
|
||||
# test help printcmds
|
||||
gdb_test "help printcmds" "Undefined command: \"printcmds\". Try \"help\"." "help printcmds"
|
||||
# test help printf
|
||||
gdb_test "help printf" "printf \"printf format string\", arg1, arg2, arg3, ..., argn.*\[\r\n\]+This is useful for formatted output in user-defined commands." "help printf"
|
||||
# test help ptype
|
||||
gdb_test "help ptype" "Print definition of type.*" "help ptype"
|
||||
# test help pwd
|
||||
gdb_test "help pwd" "Print working directory. This is used for your program as well." "help pwd"
|
||||
# test help quit "q" abbreviation
|
||||
gdb_test "help q" "Exit gdb." "help quit \"q\" abbreviation"
|
||||
# test help quit
|
||||
gdb_test "help quit" "Exit gdb." "help quit"
|
||||
# test help run "r" abbreviation
|
||||
gdb_test "help r" "Start debugged program. You may specify arguments to give it..*\[\r\n\]+Args may include .*, or .*; they are expanded using \"sh\"..*\[\r\n\]+Input and output redirection with \".\", \".\", or \"..\" are also allowed..*\[\r\n\]+With no arguments, uses arguments last specified .with \"run\" or \"set args\"...*\[\r\n\]+To cancel previous arguments and run with no arguments,.*\[\r\n\]+use \"set args\" without arguments." "help run \"r\" abbreviation"
|
||||
# test help run
|
||||
gdb_test "help run" "Start debugged program. You may specify arguments to give it..*\[\r\n\]+Args may include .*, or .*; they are expanded using \"sh\"..*\[\r\n\]+Input and output redirection with \".\", \".\", or \"..\" are also allowed..*\[\r\n\]+With no arguments, uses arguments last specified .with \"run\" or \"set args\"...*\[\r\n\]+To cancel previous arguments and run with no arguments,.*\[\r\n\]+use \"set args\" without arguments." "help run"
|
||||
# test help rbreak
|
||||
gdb_test "help rbreak" "Set a breakpoint for all functions matching REGEXP." "help rbreak"
|
||||
# test help return
|
||||
gdb_test "help return" "Make selected stack frame return to its caller..*\[\r\n\]+Control remains in the debugger, but when you continue.*\[\r\n\]+execution will resume in the frame above the one now selected..*\[\r\n\]+If an argument is given, it is an expression for the value to return." "help return"
|
||||
# test help reverse-search
|
||||
gdb_test "help reverse-search" "Search backward for regular expression .see regex.3.. from last line listed..*" "help reverse-search"
|
||||
# test help running
|
||||
gdb_test "help running" "Running the program..*\[\r\n\]+List of commands:.*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help running"
|
||||
# test help step "s" abbreviation
|
||||
gdb_test "help s" "Step program until it reaches a different source line..*\[\r\n\]+Argument N means do this N times .or till program stops for another reason.." "help step \"s\" abbreviation"
|
||||
# test help step
|
||||
gdb_test "help step" "Step program until it reaches a different source line..*\[\r\n\]+Argument N means do this N times .or till program stops for another reason.." "help step #1"
|
||||
# test help search
|
||||
gdb_test "help search" "Search for regular expression .see regex.3.. from last line listed..*" "help search"
|
||||
# test help section
|
||||
gdb_test "help section" "Change the base address of section SECTION of the exec file to ADDR..*\[\r\n\]+This can be used if the exec file does not contain section addresses,.*\[\r\n\]+.such as in the a.out format., or when the addresses specified in the.*\[\r\n\]+file itself are wrong. Each section must be changed separately. The.*\[\r\n\]+``info files'' command lists all the sections and their addresses." "help section"
|
||||
#test help set annotate
|
||||
gdb_test "help set annotate" "Set annotation_level.*\[\r\n\]+0 == normal; 1 == fullname \\(for use when running under emacs\\).*\[\r\n\]+2 == output annotated suitably for use by programs that control GDB." "help set annotate"
|
||||
# test help set args
|
||||
gdb_test "help set args" "Set argument list to give program being debugged when it is started..*\[\r\n\]+Follow this command with any number of args, to be passed to the program."
|
||||
# test help set check "c" abbreviation
|
||||
gdb_test "help set c" "Set the status of the type/range checker.*\[\r\n\]+List of set check subcommands:.*\[\r\n\]+set check range -- Set range checking.*\[\r\n\]+set check type -- Set type checking.*\[\r\n\]+Type \"help set check\" followed by set check subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help set check \"c\" abbreviation"
|
||||
# test help set check "ch" abbreviation
|
||||
gdb_test "help set ch" "Set the status of the type/range checker.*\[\r\n\]+List of set check subcommands:.*\[\r\n\]+set check range -- Set range checking.*\[\r\n\]+set check type -- Set type checking.*\[\r\n\]+Type \"help set check\" followed by set check subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help set check \"ch\" abbreviation"
|
||||
# test help set check
|
||||
gdb_test "help set check" "Set the status of the type/range checker.*\[\r\n\]+List of set check subcommands:.*\[\r\n\]+set check range -- Set range checking.*\[\r\n\]+set check type -- Set type checking.*\[\r\n\]+Type \"help set check\" followed by set check subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help set check"
|
||||
# test help set check range
|
||||
gdb_test "help set check range" "Set range checking. .on/warn/off/auto." "help set check range"
|
||||
# test help set check type
|
||||
gdb_test "help set check type" "Set type checking. .on/warn/off/auto." "help set check type"
|
||||
# test help set complaints
|
||||
gdb_test "help set complaints" "Set max number of complaints about incorrect symbols." "help set complaints"
|
||||
# test help set confirm
|
||||
gdb_test "help set confirm" "Set whether to confirm potentially dangerous operations." "help set confirm"
|
||||
# test help set editing
|
||||
gdb_test "help set editing" "Set editing of command lines as they are typed..*\[\r\n\]+Use \"on\" to enable the editing, and \"off\" to disable it..*\[\r\n\]+Without an argument, command line editing is enabled. To edit, use.*\[\r\n\]+EMACS-like or VI-like commands like control-P or ESC." "help set editing"
|
||||
# test help set environment
|
||||
gdb_test "help set environment" "Set environment variable value to give the program..*\[\r\n\]+Arguments are VAR VALUE where VAR is variable name and VALUE is value..*\[\r\n\]+VALUES of environment variables are uninterpreted strings..*\[\r\n\]+This does not affect the program until the next \"run\" command." "help set environment"
|
||||
# test help set height
|
||||
gdb_test "help set height" "Set number of lines gdb thinks are in a page." "help set height"
|
||||
# test help set history expansion
|
||||
gdb_test "help set history expansion" "Set history expansion on command input..*\[\r\n\]+Without an argument, history expansion is enabled." "help set history expansion"
|
||||
# test help set history filename
|
||||
gdb_test "help set history filename" "Set the filename in which to record the command history.*\[\r\n\]+ .the list of previous commands of which a record is kept.." "help set history filename"
|
||||
# test help set history save
|
||||
gdb_test "help set history save" "Set saving of the history record on exit..*\[\r\n\]+Use \"on\" to enable the saving, and \"off\" to disable it..*\[\r\n\]+Without an argument, saving is enabled." "help set history save"
|
||||
# test help set history size
|
||||
gdb_test "help set history size" "Set the size of the command history, .*\[\r\n\]+ie. the number of previous commands to keep a record of." "help set history size"
|
||||
# test help set history
|
||||
gdb_test "help set history" "Generic command for setting command history parameters..*\[\r\n\]+List of set history subcommands:.*\[\r\n\]+set history expansion -- Set history expansion on command input.*\[\r\n\]+set history filename -- Set the filename in which to record the command history.*\[\r\n\]+set history save -- Set saving of the history record on exit.*\[\r\n\]+set history size -- Set the size of the command history.*\[\r\n\]+Type \"help set history\" followed by set history subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help set history"
|
||||
# test help set language
|
||||
gdb_test "help set language" "Set the current source language." "help set language"
|
||||
# test help set listsize
|
||||
gdb_test "help set listsize" "Set number of source lines gdb will list by default." "help set listsize"
|
||||
# test help set print "p" abbreviation
|
||||
# FIXME -- Ultrix hangs randomly on this very long output from gdb and
|
||||
# continues with its output only if something is sent to gdb.
|
||||
# Also, if the system is slow, it may time out because the output is large.
|
||||
gdb_test "help set p" ".*\[\r\n\]+Generic command for setting how things print..*\[\r\n\]+List of set print subcommands:.*\[\r\n\]+Type \"help set print\" followed by set print subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help set print \"p\" abbreviatio"
|
||||
# test help set print "pr" abbreviation
|
||||
gdb_test "help set pr" ".*\[\r\n\]+Generic command for setting how things print..*\[\r\n\]+List of set print subcommands:.*\[\r\n\]+Type \"help set print\" followed by set print subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help set print \"pr\" abbreviation"
|
||||
# test help set print
|
||||
gdb_test "help set print" ".*\[\r\n\]+Generic command for setting how things print..*\[\r\n\]+List of set print subcommands:.*\[\r\n\]+Type \"help set print\" followed by set print subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help set print"
|
||||
# test help set print address
|
||||
gdb_test "help set print address" "Set printing of addresses." "help set print address"
|
||||
# test help set print array
|
||||
gdb_test "help set print array" "Set prettyprinting of arrays." "help set print array"
|
||||
# test help set print asm-demangle
|
||||
gdb_test "help set print asm-demangle" "Set demangling of C\[+\]+ names in disassembly listings." "help set print asm-demangle"
|
||||
# test help set print demangle
|
||||
gdb_test "help set print demangle" "Set demangling of encoded C\[+\]+ names when displaying symbols." "help set print demangle"
|
||||
# test help set print elements
|
||||
gdb_test "help set print elements" "Set limit on string chars or array elements to print..*\[\r\n\]+\"set print elements 0\" causes there to be no limit." "help set print elements"
|
||||
# test help set print object
|
||||
gdb_test "help set print object" "Set printing of object's derived type based on vtable info." "help set print object"
|
||||
# test help set print pretty
|
||||
gdb_test "help set print pretty" "Set prettyprinting of structures." "help set print pretty"
|
||||
# test help set print sevenbit-strings
|
||||
gdb_test "help set print sevenbit-strings" "Set printing of 8-bit characters in strings as .nnn." "help set print sevenbit-strings"
|
||||
# test help set print union
|
||||
gdb_test "help set print union" "Set printing of unions interior to structures." "help set print union"
|
||||
# test help set print vtbl
|
||||
gdb_test "help set print vtbl" "Set printing of C\[+\]+ virtual function tables." "help set print vtbl"
|
||||
# test help set prompt
|
||||
gdb_test "help set prompt" "Set gdb's prompt" "help set prompt"
|
||||
# test help set radix
|
||||
gdb_test "help set radix" "Set default input and output number radices.*\[\r\n\]+Use \'set input-radix\' or \'set output-radix\' to independently set each..*\[\r\n\]+Without an argument, sets both radices back to the default value of 10..*\[\r\n\]+" "help set radix"
|
||||
# test help set symbol-reloading
|
||||
gdb_test "help set symbol-reloading" "Set dynamic symbol table reloading multiple times in one run." "help set symbol-reloading"
|
||||
# test help set variable
|
||||
gdb_test "help set variable" ".*\[\r\n\]+Evaluate expression EXP and assign result to variable VAR, using assignment.*\[\r\n\]+syntax appropriate for the current language .VAR = EXP or VAR := EXP for.*\[\r\n\]+example.. VAR may be a debugger \"convenience\" variable .names starting.*\[\r\n\]+with \\\$., a register .a few standard names starting with \\\$., or an actual.*\[\r\n\]+variable in the program being debugged. EXP is any valid expression.*\[\r\n\]+This may usually be abbreviated to simply \"set\"." "help set variable"
|
||||
# test help set verbose
|
||||
gdb_test "help set verbose" "Set verbosity." "help set verbose"
|
||||
#test help set width
|
||||
gdb_test "help set width" "Set number of characters gdb thinks are in a line." "help set width"
|
||||
# test help set write
|
||||
# This is only supported on targets which use exec.o.
|
||||
gdb_test "help set write" "Set writing into executable and core files." "help set write"
|
||||
# test help set
|
||||
# FIXME -- Ultrix hangs randomly on this very long output from gdb and
|
||||
# continues with its output only if something is sent to gdb.
|
||||
# Also, if the system is slow, it may time out because the output is large.
|
||||
#gdb_test "help set" ".*\[\r\n\]+Evaluate expression EXP and assign result to variable VAR, using assignment.*\[\r\n\]+syntax appropriate for the current language .VAR = EXP or VAR := EXP for.*\[\r\n\]+example.. VAR may be a debugger \"convenience\" variable .names starting.*\[\r\n\]+with \\\$., a register .a few standard names starting with \\\$., or an actual.*\[\r\n\]+variable in the program being debugged. EXP is any valid expression.*\[\r\n\]+set listsize -- Set number of source lines gdb will list by default.*\[\r\n\]+Type \"help set\" followed by set subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous..*\[\r\n\]+" "help set"
|
||||
# test help shell
|
||||
gdb_test "help shell" "Execute the rest of the line as a shell command. .*\[\r\n\]+With no arguments, run an inferior shell." "help shell"
|
||||
#test help show annotate
|
||||
gdb_test "help show annotate" "Show annotation_level.*\[\r\n\]+0 == normal; 1 == fullname \\(for use when running under emacs\\).*\[\r\n\]+2 == output annotated suitably for use by programs that control GDB." "help show annotate"
|
||||
# test help show args
|
||||
gdb_test "help show args" "Show argument list to give program being debugged when it is started..*\[\r\n\]+Follow this command with any number of args, to be passed to the program."
|
||||
# test help show check "c" abbreviation
|
||||
gdb_test "help show c" "Show the status of the type/range checker.*\[\r\n\]+List of show check subcommands:.*\[\r\n\]+show check range -- Show range checking.*\[\r\n\]+show check type -- Show type checking.*\[\r\n\]+Type \"help show check\" followed by show check subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help show check \"c\" abbreviation"
|
||||
# test help show check
|
||||
gdb_test "help show check" "Show the status of the type/range checker.*\[\r\n\]+List of show check subcommands:.*\[\r\n\]+show check range -- Show range checking.*\[\r\n\]+show check type -- Show type checking.*\[\r\n\]+Type \"help show check\" followed by show check subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help show check"
|
||||
# test help show check range
|
||||
gdb_test "help show check range" "Show range checking. .on/warn/off/auto." "help show check range"
|
||||
# test help show check type
|
||||
gdb_test "help show check type" "Show type checking. .on/warn/off/auto." "help show check type"
|
||||
# test help show commands
|
||||
gdb_test "help show commands" "Show the history of commands you typed..*\[\r\n\]+You can supply a command number to start with, or a `\[+\]' to start after.*\[\r\n\]+the previous command number shown." "help show commands"
|
||||
# test help show complaints
|
||||
gdb_test "help show complaints" "Show max number of complaints about incorrect symbols." "help show complaints"
|
||||
# test help show confirm
|
||||
gdb_test "help show confirm" "Show whether to confirm potentially dangerous operations." "help show confirm"
|
||||
# test help show convenience
|
||||
gdb_test "help show convenience" "Debugger convenience .\".foo\". variables..*\[\r\n\]+These variables are created when you assign them values;.*\[\r\n\]+thus, \"print .foo=1\" gives \".foo\" the value 1. Values may be any type..*\[\r\n\]+A few convenience variables are given values automatically:.*\[\r\n\]+\"._\"holds the last address examined with \"x\" or \"info lines\",.*\[\r\n\]+\".__\" holds the contents of the last address examined with \"x\"." "help show convenience"
|
||||
# test help show directories
|
||||
gdb_test "help show directories" "Current search path for finding source files..*\[\r\n\]+.cwd in the path means the current working directory..*\[\r\n\]+.cdir in the path means the compilation directory of the source file." "help show directories"
|
||||
# test help show editing
|
||||
gdb_test "help show editing" "Show editing of command lines as they are typed..*\[\r\n\]+Use \"on\" to enable the editing, and \"off\" to disable it..*\[\r\n\]+Without an argument, command line editing is enabled. To edit, use.*\[\r\n\]+EMACS-like or VI-like commands like control-P or ESC." "help show editing"
|
||||
# test help show environment
|
||||
gdb_test "help show environment" "The environment to give the program, or one variable's value..*\[\r\n\]+With an argument VAR, prints the value of environment variable VAR to.*\[\r\n\]+give the program being debugged. With no arguments, prints the entire.*\[\r\n\]+environment to be given to the program." "help show environment"
|
||||
# test help show height
|
||||
gdb_test "help show height" "Show number of lines gdb thinks are in a page." "help show height"
|
||||
# test help show history expansion
|
||||
gdb_test "help show history expansion" "Show history expansion on command input..*\[\r\n\]+Without an argument, history expansion is enabled." "help show history expansion"
|
||||
# test help show history filename
|
||||
gdb_test "help show history filename" "Show the filename in which to record the command history.*\[\r\n\]+ .the list of previous commands of which a record is kept.." "help show history filename"
|
||||
# test help show history save
|
||||
gdb_test "help show history save" "Show saving of the history record on exit..*\[\r\n\]+Use \"on\" to enable the saving, and \"off\" to disable it..*\[\r\n\]+Without an argument, saving is enabled." "help show history save"
|
||||
# test help show history size
|
||||
gdb_test "help show history size" "Show the size of the command history, .*\[\r\n\]+ie. the number of previous commands to keep a record of." "help show history size"
|
||||
# test help show history
|
||||
gdb_test "help show history" "Generic command for showing command history parameters..*\[\r\n\]+List of show history subcommands:.*\[\r\n\]+show history expansion -- Show history expansion on command input.*\[\r\n\]+show history filename -- Show the filename in which to record the command history.*\[\r\n\]+show history save -- Show saving of the history record on exit.*\[\r\n\]+show history size -- Show the size of the command history.*\[\r\n\]+Type \"help show history\" followed by show history subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help show history"
|
||||
# test help show language
|
||||
gdb_test "help show language" "Show the current source language." "help show language"
|
||||
# test help show listsize
|
||||
gdb_test "help show listsize" "Show number of source lines gdb will list by default." "help show listsize"
|
||||
# test help show print "p" abbreviation
|
||||
gdb_test "help show p" "Generic command for showing print settings..*\[\r\n\]+List of show print subcommands:.*\[\r\n\]+Type \"help show print\" followed by show print subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help show print \"p\" abbreviation"
|
||||
# test help show print "pr" abbreviation
|
||||
gdb_test "help show pr" "Generic command for showing print settings..*\[\r\n\]+List of show print subcommands:.*\[\r\n\]+Type \"help show print\" followed by show print subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help show print \"pr\" abbreviation"
|
||||
# test help show print
|
||||
gdb_test "help show print" "Generic command for showing print settings..*\[\r\n\]+List of show print subcommands:.*\[\r\n\]+Type \"help show print\" followed by show print subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help show print"
|
||||
# test help show paths
|
||||
gdb_test "help show paths" "Current search path for finding object files..*\[\r\n\]+.cwd in the path means the current working directory..*\[\r\n\]+This path is equivalent to the .PATH shell variable. It is a list of.*\[\r\n\]+directories, separated by colons. These directories are searched to find.*\[\r\n\]+fully linked executable files and separately compiled object files as needed." "help show paths"
|
||||
# test help show print address
|
||||
gdb_test "help show print address" "Show printing of addresses." "help show print address"
|
||||
# test help show print array
|
||||
gdb_test "help show print array" "Show prettyprinting of arrays." "help show print array"
|
||||
# test help show print asm-demangle
|
||||
gdb_test "help show print asm-demangle" "Show demangling of C\[+\]+ names in disassembly listings." "help show print asm-demangle"
|
||||
# test help show print demangle
|
||||
gdb_test "help show print demangle" "Show demangling of encoded C\[+\]+ names when displaying symbols." "help show print demangle"
|
||||
# test help show print elements
|
||||
gdb_test "help show print elements" "Show limit on string chars or array elements to print..*\[\r\n\]+\"set print elements 0\" causes there to be no limit." "help show print elements"
|
||||
# test help show print object
|
||||
gdb_test "help show print object" "Show printing of object's derived type based on vtable info." "help show print object"
|
||||
# test help show print pretty
|
||||
gdb_test "help show print pretty" "Show prettyprinting of structures." "help show print pretty"
|
||||
# test help show print sevenbit-strings
|
||||
gdb_test "help show print sevenbit-strings" "Show printing of 8-bit characters in strings as .nnn." "help show print sevenbit-strings"
|
||||
# test help show print union
|
||||
gdb_test "help show print union" "Show printing of unions interior to structures." "help show print union"
|
||||
# test help show print vtbl
|
||||
gdb_test "help show print vtbl" "Show printing of C\[+\]+ virtual function tables." "help show print vtbl"
|
||||
# test help show prompt
|
||||
gdb_test "help show prompt" "Show gdb's prompt" "help show prompt"
|
||||
# test help show radix
|
||||
gdb_test "help show radix" "Show the default input and output number radices.*\[\r\n\]+Use \'show input-radix\' or \'show output-radix\' to independently show each.*\[\r\n\]+" "help show radix"
|
||||
# test help show symbol-reloading
|
||||
gdb_test "help show symbol-reloading" "Show dynamic symbol table reloading multiple times in one run." "help show symbol-reloading"
|
||||
# test help show user
|
||||
gdb_test "help show user" "Show definitions of user defined commands..*\[\r\n\]+Argument is the name of the user defined command..*\[\r\n\]+With no argument, show definitions of all user defined commands." "help show user"
|
||||
# test help show values
|
||||
gdb_test "help show values" "Elements of value history around item number IDX .or last ten.." "help show values"
|
||||
# test help show verbose
|
||||
gdb_test "help show verbose" "Show verbosity..*" "help show verbose"
|
||||
# test help show version
|
||||
gdb_test "help show version" "Show what version of GDB this is." "help show version"
|
||||
# test help show width
|
||||
gdb_test "help show width" "Show number of characters gdb thinks are in a line." "help show width"
|
||||
# test help show write
|
||||
# This is only supported on targets which use exec.o.
|
||||
gdb_test "help show write" "Show writing into executable and core files." "help show write"
|
||||
# test help show
|
||||
# FIXME -- Ultrix hangs randomly on this very long output from gdb and
|
||||
# continues with its output only if something is sent to gdb.
|
||||
# Also, if the system is slow, it may time out because the output is large.
|
||||
#gdb_test "help show" "Generic command for showing things about the debugger..*\[\r\n\]+List of show subcommands:.*\[\r\n\]+show listsize -- Show number of source lines gdb will list by default.*\[\r\n\]+show directories -- Current search path for finding source files.*\[\r\n\]+Type \"help show\" followed by show subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help show"
|
||||
# test help step
|
||||
gdb_test "help step" "Step program until it reaches a different source line..*\[\r\n\]+Argument N means do this N times .or till program stops for another reason.." "help step #2"
|
||||
# test help stepi "si" abbreviation
|
||||
gdb_test "help si" "Step one instruction exactly..*\[\r\n\]+Argument N means do this N times .or till program stops for another reason.." "help stepi \"si\" abbreviation"
|
||||
# test help stepi
|
||||
gdb_test "help stepi" "Step one instruction exactly..*\[\r\n\]+Argument N means do this N times .or till program stops for another reason.." "help stepi"
|
||||
# test help signal
|
||||
gdb_test "help signal" "Continue program giving it signal.*" "help signal"
|
||||
# test help source
|
||||
# vxgdb reads .vxgdbinit
|
||||
gdb_test "help source" "Read commands from a file named FILE..*\[\r\n\]+Note that the file \"\[^\"\]*\" is read automatically in this way.*\[\r\n\]+when gdb is started." "help source"
|
||||
# test help stack
|
||||
gdb_test "help stack" "Examining the stack..*\[\r\n\]+When the program being debugged stops, gdb selects the innermost frame..*\[\r\n\]+The commands below can be used to select other frames by number or address..*\[\r\n\]+List of commands:.*\[\r\n\]+backtrace -- Print backtrace of all stack frames.*\[\r\n\]+bt -- Print backtrace of all stack frames.*\[\r\n\]+down -- Select and print stack frame called by this one.*\[\r\n\]+frame -- Select and print a stack frame.*\[\r\n\]+return -- Make selected stack frame return to its caller.*\[\r\n\]+select-frame -- Select a stack frame without printing anything.*\[\r\n\]+up -- Select and print stack frame that called this one.*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help stack"
|
||||
# test help status
|
||||
gdb_test "help status" "Status inquiries..*\[\r\n\]+List of commands:.*\[\r\n\]+info -- Generic command for showing things about the program being debugged.*\[\r\n\]+show -- Generic command for showing things about the debugger.*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help status"
|
||||
# test help support
|
||||
# FIXME -- Ultrix hangs randomly on this very long output from gdb and
|
||||
# continues with its output only if something is sent to gdb.
|
||||
# Also, if the system is slow, it may time out because the output is large.
|
||||
#gdb_test "help support" "Support facilities..*\[\r\n\]+List of commands:.*\[\r\n\]+show confirm -- Show whether to confirm potentially dangerous operations.*\[\r\n\]+show history -- Generic command for showing command history parameters.*\[\r\n\]+down-silently -- Same as the `down' command.*\[\r\n\]+up-silently -- Same as the `up' command.*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help support"
|
||||
# test help symbol-file
|
||||
gdb_test "help symbol-file" "Load symbol table from executable file FILE..*\[\r\n\]+The `file' command can also load symbol tables, as well as setting the file.*\[\r\n\]+to execute." "help symbol-file"
|
||||
# test help target child
|
||||
gdb_test "help target child" "Unix child process .started by the \"run\" command..*|Undefined target command: \"child\". Try \"help target\"." "help target child"
|
||||
# test help target procfs
|
||||
gdb_test "help target procfs" "Unix /proc child process .started by the \"run\" command.*|Undefined target command: \"procfs\". Try \"help target\"." "help target procfs (procfs version)"
|
||||
# test help target core
|
||||
gdb_test "help target core" ".*Use a core file as a target.*Specify the filename of the core file.*|(Undefined target command: \"core\". Try \"help target\".)" "help target core"
|
||||
# test help target exec
|
||||
gdb_test "help target exec" "Use an executable file as a target..*\[\r\n\]+Specify the filename of the executable file." "help target exec"
|
||||
# test help target remote
|
||||
gdb_test "help target remote" "Use a remote computer via a serial line, using a gdb-specific protocol..*\[\r\n\]+Specify the serial device it is connected to .e.g. /dev/ttya..*" "help target remote"
|
||||
# test help target
|
||||
# the child process target may be "target child" or "target procfs"
|
||||
gdb_test "help target" "Connect to a target machine or process..*\[\r\n\]+The first argument is the type or protocol of the target machine..*\[\r\n\]+Remaining arguments are interpreted by the target protocol. For more.*\[\r\n\]+information on the arguments for a particular protocol, type.*\[\r\n\]+`help target ' followed by the protocol name..*\[\r\n\]+List of target subcommands:.*\[\r\n\]+target exec -- Use an executable file as a target.*\[\r\n\]+Type \"help target\" followed by target subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help target"
|
||||
# test help tbreak
|
||||
gdb_test "help tbreak" "Set a temporary breakpoint.*" "help tbreak"
|
||||
# test help tty
|
||||
gdb_test "help tty" "Set terminal for future runs of program being debugged." "help tty"
|
||||
# test help until "u" abbreviation
|
||||
gdb_test "help u" "Execute until the program reaches a source line greater than the current.*\[\r\n\]+or a specified line or address or function .same args as break command...*\[\r\n\]+Execution will also stop upon exit from the current stack frame." "help until \"u\" abbreviation"
|
||||
# test help until
|
||||
gdb_test "help until" "Execute until the program reaches a source line greater than the current.*\[\r\n\]+or a specified line or address or function .same args as break command...*\[\r\n\]+Execution will also stop upon exit from the current stack frame." "help until"
|
||||
# test help undisplay
|
||||
gdb_test "help undisplay" "Cancel some expressions to be displayed when program stops..*\[\r\n\]+Arguments are the code numbers of the expressions to stop displaying..*\[\r\n\]+No argument means cancel all automatic-display expressions..*\[\r\n\]+\"delete display\" has the same effect as this command..*\[\r\n\]+Do \"info display\" to see current list of code numbers." "help undisplay"
|
||||
# test help unset environment
|
||||
gdb_test "help unset environment" "Cancel environment variable VAR for the program..*\[\r\n\]+This does not affect the program until the next \"run\" command." "help unset environment"
|
||||
# test help unset
|
||||
gdb_test "help unset" "Complement to certain \"set\" commands.*\[\r\n\]+List of unset subcommands:.*\[\r\n\]+unset environment -- Cancel environment variable VAR for the program.*\[\r\n\]+Type \"help unset\" followed by unset subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help unset"
|
||||
# test help up
|
||||
gdb_test "help up" "Select and print stack frame that called this one..*\[\r\n\]+An argument says how many frames up to go." "help up"
|
||||
# test help up-silently
|
||||
gdb_test "help up-silently" "Same as the `up' command, but does not print anything..*\[\r\n\]+This is useful in command scripts." "help up-silently"
|
||||
# test help user-defined
|
||||
gdb_test "help user-defined" "User-defined commands..*\[\r\n\]+The commands in this class are those defined by the user..*\[\r\n\]+Use the \"define\" command to define a command..*\[\r\n\]+List of commands:.*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help user-defined"
|
||||
# test help watch
|
||||
gdb_test "help watch" "Set a watchpoint for an expression..*\[\r\n\]+A watchpoint stops execution of your program whenever the value of.*\[\r\n\]+an expression changes." "help watch"
|
||||
# test help whatis
|
||||
gdb_test "help whatis" "Print data type of expression EXP." "help whatis"
|
||||
# test help where
|
||||
gdb_test "help where" "Print backtrace of all stack frames, or innermost COUNT frames..*\[\r\n\]+With a negative argument, print outermost -COUNT frames..*\[\r\n\]+Use of the 'full' qualifier also prints the values of the local variables." "help where"
|
||||
# test help x
|
||||
gdb_test "help x" "Examine memory: x/FMT ADDRESS..*\[\r\n\]+ADDRESS is an expression for the memory address to examine..*\[\r\n\]+FMT is a repeat count followed by a format letter and a size letter..*\[\r\n\]+Defaults for format and size letters are those previously used..*\[\r\n\]+Default count is 1. Default address is following last thing printed.*\[\r\n\]+with this command or \"print\"." "help x"
|
||||
# test help info bogus-gdb-command
|
||||
gdb_test "help info bogus-gdb-command" "Undefined info command: \"bogus-gdb-command\". Try \"help info\"." "help info bogus-gdb-command"
|
||||
# test help gotcha
|
||||
gdb_test "help gotcha" "Undefined command: \"gotcha\". Try \"help\"." "help gotcha"
|
||||
287
gdb/testsuite/gdb.base/i486-elf.u
Normal file
287
gdb/testsuite/gdb.base/i486-elf.u
Normal file
@@ -0,0 +1,287 @@
|
||||
begin 777 i486-elf
|
||||
M?T5,1@$! 0 ( P ! W(($"#0 !\+@ #0 ( %
|
||||
M "@ %0 1 8 T -( $" "@ H 4 P -0
|
||||
M !, ! ! - #2 ! @ * 8
|
||||
M "@& % ! $ !<!@ 7)8$" "4 2 ( < $
|
||||
M @ ( & " E@0( ' !P O=7-R+VQI8B]L:6)C
|
||||
M+G-O+C$ , , !@ L * ! (
|
||||
M $ 4 # " D '
|
||||
M $ "<@@0(' !( * I)@$" 1 /'_#P &"6! @$
|
||||
M$0 + !@ !<A@0( !$ \?\? K(($"$ 2 )@ /"6! @
|
||||
M $0#Q_RT #,@@0( !( R /(8$" 0 1 H /P +R"
|
||||
M! @ $@ $D !DE@0( !$ \?]? @)8$" 1 /'_ %]C
|
||||
M;&5A;G5P %]E;F0 7V5N=FER;VX 7V5T97AT &%T97AI= !?961A=&$ 97AI
|
||||
M= !?;&EB7W9E<G-I;VX 7U]F<'-T87)T %]'3$]"04Q?3T9&4T547U1!0DQ%
|
||||
M7P!?1%E.04U)0P O=7-R+VQI8B]L:6)C+G-O+C$ '"6! @' 0 =)8$" <%
|
||||
M !XE@0(!PD 'R6! @'!P PP /\U:)8$"/\E;)8$" #_)7"6! AH
|
||||
M .G@_____R5TE@0(: @ #IT/____\E>)8$"&@0 Z<#_____)7R6
|
||||
M! AH& .FP____:@!J (OL4KB<@@0(A<!T#6B<@@0(Z+;___^#Q 2X@)8$
|
||||
M"(7 = 7HI?___V@XA@0(Z)O___^+10B-5(40B15@E@0(4HU5#%)0Z%_____H
|
||||
MCO___^@! 0 @\0,4.B0____:@"X 0 )H !P#TP^L&,\#K ,G#58OL
|
||||
MZ_60D)#K!C/ ZP#)PU6+[.OUD)"0ZP8SP.L R<-5B^SK]9"0D.L&,\#K ,G#
|
||||
M58OLZ_60D)#K!C/ ZP#)PU6+[.OUD)"0ZP8SP.L R<-5B^SK]9"0D.L&,\#K
|
||||
M ,G#58OLZ_60D)#K!C/ ZP#)PU6+[.OUD)"0ZP8SP.L R<-5B^SK]9"0D.L&
|
||||
M,\#K ,G#58OLZ_60D)#K!C/ ZP#)PU6+[.OUD)"0ZP8SP.L R<-5B^SK]9"0
|
||||
MD.L*W05 A@0(ZP#)PU6+[.OQD)"0ZPK=!4B&! CK ,G#58OLZ_&0D)#I\P$
|
||||
M )#&!?B7! @ Q@5TEP0( <8%.I<$" )FQP5LEP0( P!FQP5<EP0(! !FQP4$
|
||||
MEP0(!0#'!1"7! @& QP7PE@0(!P ,<%])8$" @ #'!6B7! @)
|
||||
MQP7\E@0("@ ,<%>)<$" L "A4(8$"*,\EP0(H5B&! BC#)<$"*%4A@0(
|
||||
MHPB7! B@^)<$"*+4EP0(H'27! BB.)<$"* ZEP0(HOB6! AFH6R7! AFHWR7
|
||||
M! AFH5R7! AFHTB7! AFH027! AFHX"7! BA$)<$"*,<EP0(H?"6! BCC)<$
|
||||
M"*'TE@0(HU"7! BA:)<$"*/PEP0(H?R6! BC0)<$"*%XEP0(HV"7! BA/)<$
|
||||
M"*/@EP0(H0R7! BC+)<$"*$(EP0(HRB7! C'!827! CXEP0(QP7LEP0(=)<$
|
||||
M",<%B)<$"#J7! C'!>B7! ALEP0(QP6<EP0(7)<$",<% )<$" 27! C'!4R7
|
||||
M! @0EP0(QP64EP0(\)8$",<%6)<$"/26! C'!7"7! AHEP0(QP7<EP0(_)8$
|
||||
M",<%&)<$"'B7! C'!=B7! @\EP0(QP6@EP0(")<$",<%))<$" ( #'!127
|
||||
M! @" QP60F 0( 0 ,<%_)<$" $ "AF)<$"*, F 0(9J&<F 0(9J.4
|
||||
MF 0(R<-5B^SI!O[__Y ## ,A"
|
||||
M :4 ("6! @ **"! BR@@0(PH($"-*"! @!
|
||||
M : P "(@@0(#0 #B&! @$ Z( $" 4 #L@00(!@ "R!
|
||||
M! @* >P L 0 %0 # 9)8$" ( @ %
|
||||
M !$ 7 :(($" $
|
||||
M 0 \?\ U( $" # $ .B ! @ P " L
|
||||
M@00( , P [($$" # 0 &B"! @ P %
|
||||
M "(@@0( , !@ C(($" # < -R"! @ P (
|
||||
M XA@0( , "0 /(8$" # H %R6! @
|
||||
M P + !DE@0( , # @)8$" # T /"6! @
|
||||
M P . , #P # !
|
||||
M P 1 , $@ # !,
|
||||
M P 4 H 0 \?\1 $ /'_
|
||||
M& ! #Q_R0 0 \?\L $
|
||||
M /'_-@ ! #Q_ST !,@P0(#0 !( " !) \)8$" 0
|
||||
M 1 X 5@ /26! @$ $0 . &4 XA@0( !( "0!K ^)8$
|
||||
M" ( 1 X @0 #2$! @! @ $@ ( (8 #\E@0(! !$ #@"4
|
||||
M )<$" 0 1 X K0 )R"! @< $@ +8 "DF 0( !$ \?^[
|
||||
M !)<$" ( 1 X S )R#! @- $@ ( .( (EP0(" !$
|
||||
M#@#K $)<$" 0 1 X \0 -R"! @ $@ ( /@ 4EP0(!
|
||||
M !$ #@ # 0 8)8$" 0 1 L # $ !B7! @$ $0 . "0! <EP0(
|
||||
M" !$ #@ P 0 ))<$" 0 1 X . $ %R#! @- $@ ( $L! H
|
||||
MEP0($ !$ #@!: 0 7(8$" 1 /'_80$ #B7! @" $0 . '4!
|
||||
M ZEP0( 0 !$ #@"% 0 /)<$" 0 1 X C0$ $"7! @( $0 .
|
||||
M *$! "L@@0(0 !( "H 0 8)8$" 0 A L L $ -R#! @-
|
||||
M$@ ( +P! #\@P0(#0 !( " #1 0 2)<$" 0 1 X Y@$ $R7! @$
|
||||
M $0 . /0! #PE@0( !$ \?_[ 0 ?(,$" T 2 @ " ( %"7
|
||||
M! @( $0 . !T" !8EP0(! !$ #@ T @ K(,$" T 2 @ /P(
|
||||
M %R7! @" $0 . $X" ,A 0($0 !( " !; @ S(($" 2
|
||||
M8 ( &"7! @( $0 . '8" !HEP0(! !$ #@!] @ ;)<$" ( 1
|
||||
M X A0( '"7! @$ $0 . )0" !TEP0( 0 !$ #@"B @ >)<$" 0
|
||||
M 1 X L@( 'R7! @$ $0 . , " " EP0(! !$ #@#7 @ /(8$
|
||||
M" 0 1 H Y ( $N#! @ $@ ( .P" "$EP0(! !$ #@#[ @
|
||||
MB)<$" 0 1 X $P, (R7! @( $0 . "8# "\@@0( !( P
|
||||
M P E)<$" 0 1 X 10, )B7! @$ $0 . $P# !DE@0( !$
|
||||
M\?]B P G)<$" 0 1 X >0, *"7! @$ $0 . (H# !<E@0(!
|
||||
M !$ "P"< P I)<$"!@ 1 X I@, +R7! @8 $0 . + # #4EP0(
|
||||
M @ !$ #@"] P V)<$" 0 1 X S0, -R7! @$ $0 . .,# @
|
||||
MA 0($0 !( " #Q P O(,$" T 2 @ P0 ("6! @ $0#Q_PP$
|
||||
M #@EP0(" !$ #@ :! Z)<$" 0 1 X *@0 .R#! @- $@ (
|
||||
M #T$ #LEP0(! !$ #@!3! \)<$" @ 1 X 8 0 (B"! @
|
||||
M$@ & &8$ #XEP0( 0 !$ #@!M! _)<$" 0 1 X =00 &R#! @-
|
||||
M $@ ( (H$ F 0(D !$ #@"1! C(,$" T 2 @ I00 )"8
|
||||
M! @$ $0 . *\$ "4F 0(" !$ #@"X! S(,$" T 2 @ S 0
|
||||
M )R8! @( $0 . !I-#@V+F5L9@!C<G0Q+G, 8W)T:2YS '9A;'5E<RU8
|
||||
M="YC &=D8FUE+F, <VA?9&%T82YC &-R=&XN<P!V7V-H87)?9G5N8P!V7W-I
|
||||
M9VYE9%]I;G0 =E]U;G-I9VYE9%]I;G0 7V9I;FD =E]U;G-I9VYE9%]C:&%R
|
||||
M7V%R<F%Y &UA:6X =E]S:6=N961?;&]N9P!V7W5N<VEG;F5D7W-H;W)T7W!O
|
||||
M:6YT97( 7V-L96%N=7 7V5N9 !V7W5N<VEG;F5D7W-H;W)T '9?=6YS:6=N
|
||||
M961?<VAO<G1?9G5N8P!V7V1O=6)L90!V7VEN= !?<W1A<G0 ;F]N<')I;6%R
|
||||
M>0!?96YV:7)O;@!V7W5N<VEG;F5D7VQO;F=?<&]I;G1E<@!V7VEN=%]A<G)A
|
||||
M>0!P<FEM87)Y '9?<VEG;F5D7V-H87)?9G5N8P!V7V1O=6)L95]A<G)A>0!?
|
||||
M971E>'0 =E]S:6=N961?8VAA<E]A<G)A>0!V7W5N<VEG;F5D7V-H87( =E]F
|
||||
M;&]A= !V7W-I9VYE9%]L;VYG7V%R<F%Y &%T97AI= !E;G9I<F]N '9?;&]N
|
||||
M9U]F=6YC '9?=6YS:6=N961?;&]N9U]F=6YC '9?<VEG;F5D7W-H;W)T7V%R
|
||||
M<F%Y '9?:6YT7W!O:6YT97( 7V5D871A '9?<VAO<G1?9G5N8P!V7W5N<VEG
|
||||
M;F5D7VEN=%]A<G)A>0!V7W5N<VEG;F5D7VEN=%]P;VEN=&5R '9?:6YT7V9U
|
||||
M;F, =E]S:6=N961?<VAO<G0 =E]F;&]A=%]F=6YC &5X:70 =E]U;G-I9VYE
|
||||
M9%]L;VYG7V%R<F%Y '9?;&]N9P!V7W-H;W)T '9?;&]N9U]P;VEN=&5R '9?
|
||||
M<VEG;F5D7V-H87( =E]U;G-I9VYE9%]L;VYG '9?<VAO<G1?87)R87D =E]U
|
||||
M;G-I9VYE9%]S:&]R=%]A<G)A>0!?;&EB7W9E<G-I;VX 7VUC;W5N= !V7V-H
|
||||
M87)?<&]I;G1E<@!V7W5N<VEG;F5D7V-H87)?<&]I;G1E<@!V7W-I9VYE9%]I
|
||||
M;G1?87)R87D 7U]F<'-T87)T '9?<VEG;F5D7VEN=%]P;VEN=&5R '-?;&EN
|
||||
M:P!?1TQ/0D%,7T]&1E-%5%]404),15\ =E]S:6=N961?<VAO<G1?<&]I;G1E
|
||||
M<@!V7V1O=6)L95]P;VEN=&5R %]?;&]N9V1O=6)L95]U<V5D '9?<W1R=6-T
|
||||
M,0!V7W-T<G5C=#( =E]C:&%R7V%R<F%Y '9?9FQO871?<&]I;G1E<@!V7W-I
|
||||
M9VYE9%]L;VYG7W!O:6YT97( =E]D;W5B;&5?9G5N8P!V7W-I9VYE9%]I;G1?
|
||||
M9G5N8P!?1%E.04U)0P!V7V9L;V%T7V%R<F%Y '9?<VAO<G1?<&]I;G1E<@!V
|
||||
M7W-I9VYE9%]L;VYG7V9U;F, =E]S:6=N961?8VAA<E]P;VEN=&5R '9?;&]N
|
||||
M9U]A<G)A>0!?:6YI= !V7V-H87( 8VQU;FME<@!V7W5N<VEG;F5D7V-H87)?
|
||||
M9G5N8P!U7VQI;FL =E]S:6=N961?<VAO<G1?9G5N8P!S<&]R='-C87( =E]U
|
||||
M;FEO;C( =E]U;G-I9VYE9%]I;G1?9G5N8P!V7W5N:6]N N:6YT97)P "YH
|
||||
M87-H "YD>6YS>6T +F1Y;G-T<@ N<F5L+G!L= N:6YI= N<&QT "YT97AT
|
||||
M "YF:6YI "YR;V1A=&$ +F1A=&$ +F=O= N9'EN86UI8P N8G-S "YS>6UT
|
||||
M86( +G-T<G1A8@ N<VAS=')T86( +F-O;6UE;G0 +F1E8G5G "YL:6YE $ H
|
||||
M(REL:6)C+6DS.#8Z;&EB8RUI,S@V+V-S=2]C<G0Q+G,),2XQ. !A<SH@*%-#
|
||||
M1$4I(#4N," @,#0O,3DO.3 0"@C*6QI8F,M:3,X-CIC<W4O8W)T:2YS"3$N
|
||||
M,@!A<SH@*%-#1$4I(#4N," @,#0O,3DO.3 0"@C*6QI8F,M<&]R=#IG96XO
|
||||
M=F%L=65S+5AT+F,),2XS $ H(REL:6)C.FEN8R]S>6YO;GEM<RYH"3$N,S,
|
||||
M0"@C*6AE860Z;6%T:"YH"3(N,3$N,2XR-P!A8V]M<#H@*%-#1$4I(#4N," @
|
||||
M,#0O,3DO.3 ;W!T:6TZ("A30T1%*2 U+C @(# T+S$Y+SDP &%S.B H4T-$
|
||||
M12D@-2XP(" P-"\Q.2\Y, !A8V]M<#H@*%-#1$4I(#4N," @,#0O,3DO.3
|
||||
M87,Z("A30T1%*2 U+C @(# T+S$Y+SDP $ H(REL:6)C+6DS.#8Z9V5N+W-H
|
||||
M7V1A=&$N8PDQ+C, 86-O;7 Z("A30T1%*2 U+C @(# T+S$Y+SDP &]P=&EM
|
||||
M.B H4T-$12D@-2XP(" P-"\Q.2\Y, !A<SH@*%-#1$4I(#4N," @,#0O,3DO
|
||||
M.3 0"@C*6QI8F,M:3,X-CIL:6)C+6DS.#8O8W-U+V-R=&XN<PDQ+C4 87,Z
|
||||
M("A30T1%*2 U+C @(# T+S$Y+SDP "!L9" Z("A30T1%*2 U+C @(# T+S$Y
|
||||
M+SDP +@ !$ $@!P%@ . !G9&)M92YC #8! 0 !$!3(,$""$!-88$
|
||||
M" 8! !T 3 !( 3@$ #@ =%]S=')U8W0 M@ 8 *@ T $@!U
|
||||
M . !V7V-H87)?;65M8F5R %4 0 C 8 ! '*P T $@"@
|
||||
M. !V7W-H;W)T7VUE;6)E<@!5 0 (P & 0" !RD - !( R0 #@
|
||||
M=E]I;G1?;65M8F5R %4 !P C 8 ! 0 '*@ T $@#S . !V7VQO
|
||||
M;F=?;65M8F5R %4 "@ C 8 ! @ '*P T $@ > 0 . !V7V9L;V%T
|
||||
M7VUE;6)E<@!5 X (P & 0, !RP - !( 2@$ #@ =E]D;W5B;&5?
|
||||
M;65M8F5R %4 #P C 8 !! '! !L 3 !( ; ( #@ +C!F86ME
|
||||
M +8 & "H - !( DP$ #@ =E]C:&%R7VUE;6)E<@!5 $ (P & 0
|
||||
M !RL - !( O@$ #@ =E]S:&]R=%]M96UB97( 50 $ ", !@ $ @
|
||||
M <I #0 2 .<! X '9?:6YT7VUE;6)E<@!5 < (P & 0$ !RH
|
||||
M - !( $0( #@ =E]L;VYG7VUE;6)E<@!5 H (P & 0( !RL -
|
||||
M !( / ( #@ =E]F;&]A=%]M96UB97( 50 . ", !@ $# <L #0 2
|
||||
M &@" X '9?9&]U8FQE7VUE;6)E<@!5 \ (P & 00 !P0 <
|
||||
M%P 2 (L# X '1?=6YI;VX M@ ( *@ T $@"R @ . !V7V-H87)?
|
||||
M;65M8F5R %4 0 C 8 ! '*P T $@#= @ . !V7W-H;W)T7VUE
|
||||
M;6)E<@!5 0 (P & 0 !RD - !( !@, #@ =E]I;G1?;65M8F5R
|
||||
M %4 !P C 8 ! '*@ T $@ P P . !V7VQO;F=?;65M8F5R %4
|
||||
M"@ C 8 ! '*P T $@!; P . !V7V9L;V%T7VUE;6)E<@!5 X
|
||||
M(P & 0 !RP - !( AP, #@ =E]D;W5B;&5?;65M8F5R %4 #P C
|
||||
M 8 ! '! !L 7 !( J00 #@ +C%F86ME +8 " "H -
|
||||
M !( T , #@ =E]C:&%R7VUE;6)E<@!5 $ (P & 0 !RL - !(
|
||||
M^P, #@ =E]S:&]R=%]M96UB97( 50 $ ", !@ $ <I #0 2 "0$
|
||||
M X '9?:6YT7VUE;6)E<@!5 < (P & 0 !RH - !( 3@0 #@
|
||||
M=E]L;VYG7VUE;6)E<@!5 H (P & 0 !RL - !( >00 #@ =E]F
|
||||
M;&]A=%]M96UB97( 50 . ", !@ $ <L #0 2 *4$ X '9?9&]U
|
||||
M8FQE7VUE;6)E<@!5 \ (P & 0 !P0 J !@ 2 -<$ X '9?
|
||||
M8VAA<E]F=6YC %4 0 1 4R#! @A 5F#! @$ ,0 8 $@ ,!0 . !V
|
||||
M7W-I9VYE9%]C:&%R7V9U;F, 50 " !$!7(,$""$!:8,$" 0 S !@ 2
|
||||
M $,% X '9?=6YS:6=N961?8VAA<E]F=6YC %4 P 1 6R#! @A 7F#! @$
|
||||
M *P 8 $@!R!0 . !V7W-H;W)T7V9U;F, 50 $ !$!?(,$""$!B8,$
|
||||
M" 0 R !@ 2 *@% X '9?<VEG;F5D7W-H;W)T7V9U;F, 50 % !$!
|
||||
MC(,$""$!F8,$" 0 T !@ 2 . % X '9?=6YS:6=N961?<VAO<G1?
|
||||
M9G5N8P!5 8 $0&<@P0((0&I@P0(! "D & !( #08 #@ =E]I;G1?
|
||||
M9G5N8P!5 < $0&L@P0((0&Y@P0(! # & !( 008 #@ =E]S:6=N
|
||||
M961?:6YT7V9U;F, 50 ( !$!O(,$""$!R8,$" 0 R !@ 2 '<& X
|
||||
M '9?=6YS:6=N961?:6YT7V9U;F, 50 ) !$!S(,$""$!V8,$" 0 J
|
||||
M!@ 2 *4& X '9?;&]N9U]F=6YC %4 "@ 1 =R#! @A >F#! @$ ,0
|
||||
M 8 $@#:!@ . !V7W-I9VYE9%]L;VYG7V9U;F, 50 + !$![(,$""$!^8,$
|
||||
M" 0 S !@ 2 !$' X '9?=6YS:6=N961?;&]N9U]F=6YC %4 # 1
|
||||
M ?R#! @A 0F$! @$ *P 8 $@! !P . !V7V9L;V%T7V9U;F, 50 .
|
||||
M !$!#(0$""$!'80$" 0 L !@ 2 ' ' X '9?9&]U8FQE7V9U;F,
|
||||
M50 / !$!((0$""$!,80$" 0 5 %0 2 *X' "# 4 >H' 5
|
||||
M!0 2 )H' "# 4 >H' 0 !0 2 *H' !5 < ! #P ! !(
|
||||
MZ@< )4 "C "@ @ " 0 ( "
|
||||
M"'( +@ !D 3 !( >P@ #@ ;&EN:P"V )@ F #0 2 "D( X
|
||||
M &YE>'0 @P % 'J!P (P & 0 !RH - !( 4P@ #@ ;&EN:V9U
|
||||
M;F, @P % %P!P (P & 0$ !R0 - !( =P@ #@ <W1U9F8 <@"N
|
||||
M!P (P & 0( !P0 5 %0 2 +D( "# 4 >H' 5 !0 2
|
||||
M *4( "# 4 >H' 0 !0 2 +4( !5 < ! #P ! !( ]0@
|
||||
M )4 "C "@ @ " 0 ( " "'(
|
||||
M+@ !P 7 !( B0D #@ ='5?;&EN:P"V ) F #0 2 #<) X
|
||||
M &YE>'0 @P % 'J!P (P & 0 !RH - !( 80D #@ ;&EN:V9U
|
||||
M;F, @P % %[" (P & 0 !R0 - !( A0D #@ <W1U9F8 <@"Y
|
||||
M" (P & 0 !P0 Z ! 2 ,<) X "XR9F%K90"V 0 #S
|
||||
M !L @ &)L=64 0 &=R965N !R960 ! #X $ !( "0H
|
||||
M #@ 8V]L;W)S +8 ! /, 'P " <&EN:P ! <'5R<&QE !Y
|
||||
M96QL;W< ! #( $ !( /PH #@ +C-F86ME +8 ! /, $P !
|
||||
M9F]R9 8VAE=GD ! #$ $ !( = H #@ 8V%R<P"V 0 #S
|
||||
M !0 0 '!O<G-C:&4 &)M=P $ ,@ 0 $@"J"@ . N-&9A
|
||||
M:V4 M@ $ \P 3 $ !44E5% !&04Q310 $ ' !8 $@#&
|
||||
M"@ . !B;V]L96%N '( = H #$ $ !( ^PH #@ 8G9A;', M@ $
|
||||
M\P 3 $ !T<G5E !F86QS90 $ '0 !8 $@ 8"P . !B;V]L
|
||||
M96%N,@!R ,8* !& ! 2 &(+ X &UI<V]R9&5R960 M@ $ \P C
|
||||
M , !T:')E90 >F5R;P ! ;VYE ( !T=V\ ! ", &
|
||||
M !( B0L #@ ;6%I;@!5 < $0$TA 0((0$UA@0(! "< ' !( L L
|
||||
M #@ <W!O<G1S8V%R '( /PH ", !0 #D)@$""4 ' !( U0L #@ 8VQU
|
||||
M;FME<@!R D* C 4 _R7! @H !P 2 /T+ X &YO;G!R:6UA<GD
|
||||
M<@#'"0 (P % ,4EP0()0 < $@ B# . !P<FEM87)Y '( B0D ",
|
||||
M!0 #))<$""0 ' !( 1@P #@ =5]L:6YK '( ]0@ ", !0 # )@$""<
|
||||
M ' !( ;0P #@ <U]L:6YK (, !0 !Z@< ", !0 #F)<$""8 ' !(
|
||||
MDPP #@ =E]U;FEO;C( <@"+ P (P % .4F 0()0 < $@"X# . !V
|
||||
M7W5N:6]N '( ; ( ", !0 #G)@$""< ' !( WPP #@ =E]S=')U8W0R
|
||||
M '( 3@$ ", !0 #O)<$""< ' !( !@T #@ =E]S=')U8W0Q '( +@
|
||||
M ", !0 #I)<$""\ ' !( -0T #@ =E]D;W5B;&5?<&]I;G1E<@!C ,
|
||||
M 0\ (P % .@EP0(+@ < $@!C#0 . !V7V9L;V%T7W!O:6YT97( 8P #
|
||||
M $. ", !0 #V)<$"#8 ' !( F0T #@ =E]U;G-I9VYE9%]L;VYG7W!O
|
||||
M:6YT97( 8P # $, ", !0 #&)<$"#0 ' !( S0T #@ =E]S:6=N961?
|
||||
M;&]N9U]P;VEN=&5R &, P !"P C 4 ]R7! @M !P 2 /H- X '9?
|
||||
M;&]N9U]P;VEN=&5R &, P !"@ C 4 W"7! @U !P 2 "\. X '9?
|
||||
M=6YS:6=N961?:6YT7W!O:6YT97( 8P # $) ", !0 #6)<$"#, ' !(
|
||||
M8@X #@ =E]S:6=N961?:6YT7W!O:6YT97( 8P # $( ", !0 #E)<$""P
|
||||
M ' !( C@X #@ =E]I;G1?<&]I;G1E<@!C , 0< (P % -,EP0(-P
|
||||
M < $@#%#@ . !V7W5N<VEG;F5D7W-H;W)T7W!O:6YT97( 8P # $& ",
|
||||
M!0 # )<$"#4 ' !( ^@X #@ =E]S:6=N961?<VAO<G1?<&]I;G1E<@!C
|
||||
M , 04 (P % .<EP0(+@ < $@ H#P . !V7W-H;W)T7W!O:6YT97(
|
||||
M8P # $$ ", !0 #Z)<$"#8 ' !( 7@\ #@ =E]U;G-I9VYE9%]C:&%R
|
||||
M7W!O:6YT97( 8P # $# ", !0 #B)<$"#0 ' !( D@\ #@ =E]S:6=N
|
||||
M961?8VAA<E]P;VEN=&5R &, P ! @ C 4 ^R7! @M !P 2 +\/ X
|
||||
M '9?8VAA<E]P;VEN=&5R &, P ! 0 C 4 X27! @D 0 2 .,/ "5
|
||||
M HP 0 ( ! "%4 #P L !P 2 \0 X '9?9&]U8FQE
|
||||
M7V%R<F%Y '( OP\ ", !0 #*)<$""0 ! !( ,Q )4 "C ! @
|
||||
M $ (50 . "L ' !( 7A #@ =E]F;&]A=%]A<G)A>0!R \0
|
||||
M C 4 ^"7! @D 0 2 ((0 "5 HP 0 ( ! "%4
|
||||
M# S !P 2 +40 X '9?=6YS:6=N961?;&]N9U]A<G)A>0!R %X0 C
|
||||
M 4 V"7! @D 0 2 -D0 "5 HP 0 ( ! "%4 "P Q
|
||||
M !P 2 H1 X '9?<VEG;F5D7VQO;F=?87)R87D <@"U$ (P % -
|
||||
MEP0() $ $@ N$0 E0 *, $ " 0 A5 H *@ <
|
||||
M$@!8$0 . !V7VQO;F=?87)R87D <@ *$0 (P % /PEP0() $ $@!\
|
||||
M$0 E0 *, $ " 0 A5 D ,@ < $@"N$0 . !V7W5N
|
||||
M<VEG;F5D7VEN=%]A<G)A>0!R %@1 C 4 U"7! @D 0 2 -(1 "5
|
||||
M HP 0 ( ! "%4 " P !P 2 (2 X '9?<VEG;F5D
|
||||
M7VEN=%]A<G)A>0!R *X1 C 4 XR7! @D 0 2 "82 "5 HP 0
|
||||
M ( ! "%4 !P I !P 2 $\2 X '9?:6YT7V%R<F%Y '(
|
||||
M A( ", !0 #')<$""0 ! !( <Q( )4 "C ! @ $ (
|
||||
M50 & #0 ' !( IQ( #@ =E]U;G-I9VYE9%]S:&]R=%]A<G)A>0!R $\2
|
||||
M C 4 X"7! @D 0 2 ,L2 "5 HP 0 ( ! "%4
|
||||
M!0 R !P 2 /T2 X '9?<VEG;F5D7W-H;W)T7V%R<F%Y '( IQ( ",
|
||||
M!0 #2)<$""0 ! !( (1, )4 "C ! @ $ (50 $ "L
|
||||
M ' !( 3!, #@ =E]S:&]R=%]A<G)A>0!R /T2 C 4 WR7! @D
|
||||
M 0 2 ' 3 "5 HP 0 ( ! "%4 P S !P 2 *,3 X
|
||||
M '9?=6YS:6=N961?8VAA<E]A<G)A>0!R $P3 C 4 _B6! @D 0 2
|
||||
M ,<3 "5 HP 0 ( ! "%4 @ Q !P 2 /@3 X '9?
|
||||
M<VEG;F5D7V-H87)?87)R87D <@"C$P (P % ,XEP0() $ $@ <%
|
||||
ME0 *, $ " 0 A5 $ *@ < $@!&% . !V7V-H87)?
|
||||
M87)R87D <@#X$P (P % /4EP0() < $@!J% . !V7V1O=6)L90!5
|
||||
M \ (P % ,(EP0((P < $@"-% . !V7V9L;V%T %4 #@ C 4 SR7
|
||||
M! @K !P 2 +@4 X '9?=6YS:6=N961?;&]N9P!5 P (P % -XEP0(
|
||||
M*0 < $@#A% . !V7W-I9VYE9%]L;VYG %4 "P C 4 _R6! @B
|
||||
M!P 2 ,5 X '9?;&]N9P!5 H (P % -HEP0(*@ < $@ M%0 . !V
|
||||
M7W5N<VEG;F5D7VEN= !5 D (P % /TE@0(* < $@!5%0 . !V7W-I
|
||||
M9VYE9%]I;G0 50 ( ", !0 #\)8$""$ ' !( =A4 #@ =E]I;G0 50 '
|
||||
M ", !0 #$)<$""P ' !( HA4 #@ =E]U;G-I9VYE9%]S:&]R= !5 8
|
||||
M(P % ,$EP0(*@ < $@#,%0 . !V7W-I9VYE9%]S:&]R= !5 4 (P %
|
||||
M -<EP0((P < $@#O%0 . !V7W-H;W)T %4 ! C 4 VR7! @K
|
||||
M!P 2 !H6 X '9?=6YS:6=N961?8VAA<@!5 , (P % ,ZEP0(*0 <
|
||||
M$@!#%@ . !V7W-I9VYE9%]C:&%R %4 @ C 4 W27! @B !P 2 &46
|
||||
M X '9?8VAA<@!5 $ (P % /XEP0(! < "2 @ 3(,$"'D
|
||||
M #__P !Z __\0 >P /__( 'T #__S !^ __]
|
||||
M ?P /__4 ($ #__V "" __]P @P /__@ (4
|
||||
M #__Y "& __^@ AP /__L (D #__\ "* ___4
|
||||
M L@ /__Z +4 #__^X "V ___U MP /___ +D
|
||||
M #__P,! "Z __\, 0 NP /__%0$ +T #__QX! "^ __\H
|
||||
M 0 OP /__,@$ ,$ #__SP! #" __]& 0 PP /__4 $ ,4
|
||||
M #__UH! #& __]D 0 R0 /__> $ ,H #__X(! #+ __^,
|
||||
M 0 S0 /__E@$ ,X #__Z(! #/ __^N 0 T0 /__N@$ -(
|
||||
M #__\0! #3 ___. 0 U0 /__V $ -8 #__^(! #7 ___L
|
||||
M 0 V0 /__]@$ -H #__P " #< __\4 @ W0 /__'@( -X
|
||||
M #__R@" #@ __\R @ X0 /__/ ( .( #__T8" #D __]0
|
||||
M @ Y0 /__6@( .8 #__V0" #H __]N @ Z0 /__> ( .H
|
||||
M #__X(" #L __^, @ [0 /__E@( .\ #__Z " #P __^J
|
||||
M @ \0 /__M ( /( #__[X" #T ___( @ ]@ /__T@( /<
|
||||
M #__]X" ___I @
|
||||
M 0 $ " U( $"-0 3
|
||||
M ! D % @ .B ! CH 1 , !
|
||||
M 0 / "P ( L@00(+ $ , $ 0 0 0
|
||||
M%P , " [($$".P! ![ ! !\ )
|
||||
M @ &B"! AH @ ( , ' ! @ H 0 8
|
||||
M "(@@0(B ( $ 0 +@ $ & C(($
|
||||
M"(P" !0 $ ! #, ! !@ -R"! C< @
|
||||
M60, ! Y 0 8 XA@0(. 8 $
|
||||
M 0 /P $ " /(8$"#P& @
|
||||
M $ $< ! P %R6! A<!@ " !
|
||||
M !- 0 , !DE@0(9 8 !P 0 $
|
||||
M4@ 8 # @)8$"( & !P ! $ " %L (
|
||||
M P /"6! CP!@ M $ ! !@ @
|
||||
M \ 8 ' 0 ' 0 0 : ,
|
||||
M / - #4! ! ' # #$$@
|
||||
MD 0 !Z 0 5!, "("
|
||||
M $ @P $ '@5 !P%@
|
||||
M $ (H ! #H*P D@( 0
|
||||
%
|
||||
|
||||
end
|
||||
314
gdb/testsuite/gdb.base/i860-elf.u
Normal file
314
gdb/testsuite/gdb.base/i860-elf.u
Normal file
@@ -0,0 +1,314 @@
|
||||
begin 775 i860-elf
|
||||
M?T5,1@$" 0 " < ! 32 #0 #-4 T "
|
||||
M!0 H !4 $0 8 T 0- "@ H 4 P
|
||||
M -0 !, ! ! - $#0 (
|
||||
M\ "/ % 0 $ DD I) "8 "7 8 !
|
||||
M @ "4P "E, ' !P O=7-R+VQI8B]L:6)C
|
||||
M+G-O+C$ , , !P P + @
|
||||
M # !0 & ! D * "
|
||||
M ! 0 $M !,$@ H "N
|
||||
M !$ __$ / I* 01 + & &20 $0#_\0 !\
|
||||
M !+L F!( F IO 1 /_Q +0 $R0 $@
|
||||
M #( !D0 !!$ H _ 3" 2 20 *3 $0#_
|
||||
M\0 %\ "E, !$ __$ 7V-L96%N=7 7V5N9 !?96YV:7)O;@!?971E
|
||||
M>'0 871E>&ET %]E9&%T80!E>&ET %]L:6)?=F5R<VEO;@!?7V9P<W1A<G0
|
||||
M7T=,3T)!3%]/1D93151?5$%"3$5? %]$64Y!34E# "]U<W(O;&EB+VQI8F,N
|
||||
M<V\N,0 I/ @0 I0 !@0 I1 "@0 I
|
||||
M2 " 0 * ! @ H * 7_RDY[!\ !?>*35 /@
|
||||
M%_\I/>P? #D'0 0 #X &O___;OO0 [!\ .P> ! /@ %_\I0>^] #D
|
||||
M'0 ,[!X &O__^\7_RE%[!\ .0= !A /@ :___Z.^] #L'P [!X $
|
||||
M^ 7_RE)[[T .0= "3L'@ :___X: #( 4'$ 81"__"@0P '$
|
||||
M!>P0 #40@ /6@ N80$M"@ ;___X.??*4SL'@ ;___VUO@ +L$
|
||||
MH) .80&0!O___8H &___\>@ ;___VZ82 (4< 1AE( &()2& ?
|
||||
MY9$I[!\ &P )J$<0 4;___UZ "@$ H $?@^ "$'P !H\$ * _
|
||||
M "@ 0 #X * "@ H ,@ P<0!@!A$+_\* 0 "$0P %&,
|
||||
M 81_ !"GX@ 0 ( * #( ,'$ 8 81"__"@$ A$, !1C &$?P 0
|
||||
MI^( $ " "@ R #!Q & &$0O_PH! (1# 48P !A'\ $*?B !
|
||||
M @ H ,@ P<0!@!A$+_\* 0 "$0P %&, 81_ !"GX@ 0 ( *
|
||||
M #( ,'$ 8 81"__"@$ A$, !1C &$?P 0I^( $ " "@ R
|
||||
M#!Q & &$0O_PH! (1# 48P !A'\ $*?B ! @ H ,@ P<0!@!
|
||||
MA$+_\* 0 "$0P %&, 81_ !"GX@ 0 ( * #( ,'$ 8 81"__"@
|
||||
M$ A$, !1C &$?P 0I^( $ " "@ R #!Q & &$0O_PH! (1#
|
||||
M 48P !A'\ $*?B ! @ H ,@ P<0!@!A$+_\* 0 "$0P %&,
|
||||
M 81_ !"GX@ 0 ( * #( ,'$ 8 81"__"@$ A$, !1C &$?P 0
|
||||
MI^( $ " "@ R #!Q & &$0O_PH! (1# 48P !A'\ $*?B !
|
||||
M @ H ,@ P<0!@!A$+_\$@( <F$0P %&, 81_ !"GX@ 0 ( *
|
||||
M #( ,'$ 8 81"__!(" ')A$, !1C &$?P 0I^( $ " "@ R
|
||||
M#!Q & &$0O_P[!\ (1# "4' !#^4"S _EXD3L'P [!\ )0< *4' #
|
||||
M#^7B"A_EXCSL'P [!\ )0< 24' %'^7B+!_EX=3L'P [!\ )0< :4
|
||||
M' ''^7AX1_EX<7L'P [!\ )0< B4' )'^7AP1_EXCGL'P [!\ )0<
|
||||
M J4' +'^7AS1_EXDGL'P )_ 9(NP? O\"H.[!\ "?P&1CL'P +_ I
|
||||
MV.P? '_"K,[!\ _EXJCL'P !_PJ1.P? /Y>(([!\ ?\*@KL'P
|
||||
M#^7AR.P? 7_"H\[!\ !_EXDSL'P %_PJ+.P? ?Y>(8[!\ !?\*=3L
|
||||
M'P '^7B4.P? 7_"GA[!\ !_EX>WL'P %_PIQ>P? ?Y>)=[!\ !?\
|
||||
M*<'L'P '^7B(>P? 7_"HY[!\ !_EXL7L'P %_PIS>P? ?Y>(1[!\
|
||||
M !?\*DGL'P '^7B,>P? G\"H.[!\ "_P*K;L'P )_ IV.P? O\"GX
|
||||
M[!\ .?\*LSL'P '^7B5>P? #G_"I$[!\ !_EXL'L'P Y_PJ"NP? ?
|
||||
MY>)9[!\ .?\*CSL'P '^7BO>P? #G_"HL[!\ !_EXFWL'P Y_PIU.P?
|
||||
M ?Y>'1[!\ .?\*>#L'P '^7B'>P? #G_"G$[!\ !_EXF7L'P Y_PI
|
||||
MP.P? ?Y>(I[!\ .?\*CCL'P '^7B0>P? #G_"G,[!\ !_EXK'L'P
|
||||
MY_PJ2.P? ?Y>'I[!\ .?\*@SL'P '^7BK>P? #G_"G8[!\ !_EXG'L
|
||||
M'P [!\ )0< *4' "'^7A]1_EX>7L'P [!\ )0< &4' !'^7C:1_E
|
||||
MXM'L'P %_PJ:>P? ?Y>+9[!\ !?\*WCL'P '^7C<.P? 48P !A'\
|
||||
M$*?B ! @ H $ " "@ H 0&D !"R
|
||||
M I3 2W $O@ !,4 3, $
|
||||
M !H # $K - 9 0 !#H !0 $@ & 1,
|
||||
M H ![ "P ! 5 , "DP @ # 4
|
||||
M!P !< !)\ $
|
||||
M 0 __$ 0U # ! $.@ P @
|
||||
M !$P , , 2 # $ $GP P !0
|
||||
M !*P , 8 2P # ' $T P
|
||||
M" !D , D 9$ # * *20
|
||||
M P "P "DP , P I3 # - *<
|
||||
M P #@ , \ # 0
|
||||
M P $0 , !( # 3
|
||||
M P % < 0 __$ . $ /_Q
|
||||
M %0 ! #_\0 "$ 0 __$ I $
|
||||
M /_Q ,P ! #_\0 #H "G !!$ X !) IQ
|
||||
M 01 . 5@ $_@ @$@ " &( !D !( D !H I
|
||||
MR (1 . ?@ %B@ +8$@ " (, "G, !!$ X "1
|
||||
M IT 01 . J@ $X !,$@ +, "N !$ __$
|
||||
M "X IU (1 . R0 %, @$@ " -\ "G8 "!$
|
||||
M X #H IX 01 . [@ $T@ $@ " /4 "GD
|
||||
M!!$ X $ I* 01 + !"0 *>@ $$0 #@ 2$ "GL
|
||||
M "!$ X $M I] 01 . !-0 %" @$@ " 4@
|
||||
M "GX $!$ X %7 9) 1 /_Q !7@ *@@ "$0 #@
|
||||
M 7( "H* 1$ X &" J# 01 . !B@ *A ($0
|
||||
M#@ 9X !30 F!( &E I* 0A + !K0 %6 @
|
||||
M$@ " ;D "H8 !!$ X '. 5L " 2 ( !XP *AP
|
||||
M $$0 #@ ?$ "F\ !$ __$ 'X 4< " 2 ( "!0
|
||||
M*B ($0 #@ AH "HH !!$ X (Q 4Z " 2 ( "
|
||||
M/ *BP "$0 #@ DL !78 (!( @ )8 7< 2
|
||||
M "70 *C ($0 #@ G, "HX !!$ X )Z J/ (1
|
||||
M . "@@ *D $$0 #@ I$ "I$ 1$ X *? J2
|
||||
M 01 . "KP *DP $$0 #@ KT "I0 !!$ X +4 9
|
||||
M$ 01 * "X0 $]@ $@ " ND "I4 !!$ X +X
|
||||
M J6 01 . #$ *EP ($0 #@ R, !8@ !(
|
||||
M ,M J9 01 . #0@ *F@ $$0 #@ TD "DP !$
|
||||
M__$ -? J; 01 . #=@ *G $$0 #@ X< "DD
|
||||
M!!$ L .9 J> !@1 . #HP *I 8$0 #@ ZT "JH
|
||||
M A$ X .Z JK 01 . #R@ *K $$0 #@ ^
|
||||
M !8 (!( @ /N 5$ " 2 ( $ *4P $0#_\0
|
||||
M! D "JT "!$ X 07 JO 01 . $)P %8@ @$@
|
||||
M" !#H "K !!$ X 10 JQ @1 . $70 $K
|
||||
M$@ !@ !&, "K, 1$ X 1J JT 01 . $<@ %$@
|
||||
M @$@ " !(< "K8 D!$ X 2. K: 01 . $F
|
||||
M%)@ @$@ " !*P "MP "!$ X 2U K> @1 . $
|
||||
MO0 %3@ @$@ " !G9&)M90!C<G0Q+G, 8W)T:2YS '9A;'5E<RU8="YC
|
||||
M &=D8FUE+F, <VA?9&%T82YC &-R=&XN<P!V7W5N<VEG;F5D7VEN= !V7W-I
|
||||
M9VYE9%]I;G0 =E]C:&%R7V9U;F, 7V9I;FD =E]U;G-I9VYE9%]C:&%R7V%R
|
||||
M<F%Y &UA:6X =E]S:6=N961?;&]N9P!V7W5N<VEG;F5D7W-H;W)T7W!O:6YT
|
||||
M97( 7V-L96%N=7 7V5N9 !V7W5N<VEG;F5D7W-H;W)T '9?=6YS:6=N961?
|
||||
M<VAO<G1?9G5N8P!V7V1O=6)L90!V7VEN= !?<W1A<G0 ;F]N<')I;6%R>0!?
|
||||
M96YV:7)O;@!V7W5N<VEG;F5D7VQO;F=?<&]I;G1E<@!V7VEN=%]A<G)A>0!P
|
||||
M<FEM87)Y '9?<VEG;F5D7V-H87)?9G5N8P!V7V1O=6)L95]A<G)A>0!?971E
|
||||
M>'0 =E]S:6=N961?8VAA<E]A<G)A>0!V7W5N<VEG;F5D7V-H87( =E]F;&]A
|
||||
M= !V7W-I9VYE9%]L;VYG7V%R<F%Y &%T97AI= !E;G9I<F]N '9?;&]N9U]F
|
||||
M=6YC '9?<VEG;F5D7W-H;W)T7V%R<F%Y '9?=6YS:6=N961?;&]N9U]F=6YC
|
||||
M '9?:6YT7W!O:6YT97( 7V5D871A '9?<VAO<G1?9G5N8P!V7W5N<VEG;F5D
|
||||
M7VEN=%]A<G)A>0!V7W5N<VEG;F5D7VEN=%]P;VEN=&5R '9?:6YT7V9U;F,
|
||||
M=E]S:6=N961?<VAO<G0 =E]F;&]A=%]F=6YC &5X:70 =E]U;G-I9VYE9%]L
|
||||
M;VYG7V%R<F%Y '9?;&]N9P!V7W-H;W)T '9?;&]N9U]P;VEN=&5R '9?<VEG
|
||||
M;F5D7V-H87( =E]U;G-I9VYE9%]L;VYG '9?<VAO<G1?87)R87D =E]U;G-I
|
||||
M9VYE9%]S:&]R=%]A<G)A>0!?;&EB7W9E<G-I;VX 7VUC;W5N= !V7V-H87)?
|
||||
M<&]I;G1E<@!V7W5N<VEG;F5D7V-H87)?<&]I;G1E<@!V7W-I9VYE9%]I;G1?
|
||||
M87)R87D 7U]F<'-T87)T '9?<VEG;F5D7VEN=%]P;VEN=&5R '-?;&EN:P!?
|
||||
M1TQ/0D%,7T]&1E-%5%]404),15\ =E]S:6=N961?<VAO<G1?<&]I;G1E<@!V
|
||||
M7V1O=6)L95]P;VEN=&5R %]?;&]N9V1O=6)L95]U<V5D '9?<W1R=6-T,0!V
|
||||
M7W-T<G5C=#( =E]C:&%R7V%R<F%Y '9?9FQO871?<&]I;G1E<@!V7W-I9VYE
|
||||
M9%]L;VYG7W!O:6YT97( =E]D;W5B;&5?9G5N8P!V7W-I9VYE9%]I;G1?9G5N
|
||||
M8P!?1%E.04U)0P!V7V9L;V%T7V%R<F%Y '9?<VAO<G1?<&]I;G1E<@!V7W-I
|
||||
M9VYE9%]L;VYG7V9U;F, =E]S:6=N961?8VAA<E]P;VEN=&5R '9?;&]N9U]A
|
||||
M<G)A>0!?:6YI= !V7V-H87( 8VQU;FME<@!V7W5N<VEG;F5D7V-H87)?9G5N
|
||||
M8P!U7VQI;FL <W!O<G1S8V%R '9?<VEG;F5D7W-H;W)T7V9U;F, =E]U;FEO
|
||||
M;C( =E]U;FEO;@!V7W5N<VEG;F5D7VEN=%]F=6YC N:6YT97)P "YH87-H
|
||||
M "YD>6YS>6T +F1Y;G-T<@ N<F5L82YP;'0 +FEN:70 +G!L= N=&5X= N
|
||||
M9FEN:0 N<F]D871A "YD871A "YG;W0 +F1Y;F%M:6, +F)S<P N<WEM=&%B
|
||||
M "YS=')T86( +G-H<W1R=&%B "YC;VUM96YT "YD96)U9P N;&EN90 D2&5A
|
||||
M9&5R.B O<"]20U,O=71I;#(M,BXQ+W5S<B]S<F,O;&EB+VQI8F,O:3@V,"]C
|
||||
M<W4O8W)T,2YS+'8@,BXQ(#DR+S U+S$T(# W.C$V.C(P(&1A=FED;V9F($5X
|
||||
M<" D $ H(RE&5%@@,BXQ+C N,2!S8V1E.B]U<W(O8V-S+VQI8B]C<G0Q+F\
|
||||
M)$AE861E<CH@+W O4D-3+W5T:6PR+3(N,2]U<W(O<W)C+VQI8B]L:6)C+VDX
|
||||
M-C O8W-U+V-R=&DN<RQV(#(N,2 Y,B\P-2\Q-" P-SHQ-CHR,2!D879I9&]F
|
||||
M9B!%>' @) ! *",I1E18(#(N,2XP+C$@<V-D93HO=7-R+V-C<R]L:6(O8W)T
|
||||
M:2YO "1(96%D97(Z("]P+U)#4R]U=&EL,BTR+C$O=7-R+W-R8R]L:6(O;&EB
|
||||
M8R]P;W)T+V=E;B]V86QU97,M6'0N8RQV(#(N,2 Y,B\P-2\Q-" P-SHR-SHP
|
||||
M,B!D879I9&]F9B!%>' @) D2&5A9&5R.B O<"]20U,O=71I;#(M,BXQ+W5S
|
||||
M<B]S<F,O;&EB+VQI8F,O:6YC+W-Y;F]N>6US+F@L=B R+C$@.3(O,#4O,30@
|
||||
M,#<Z,C(Z,3D@9&%V:61O9F8@17AP("0 )$AE861E<CH@+W O4D-3+W5T:6PR
|
||||
M+3(N,2]U<W(O<W)C+VAE860O;6%T:"YH+'8@,BXQ(#DR+S U+S$T(# W.C$R
|
||||
M.C4W(&1A=FED;V9F($5X<" D &%C;VUP.B H4T-$12D@-2XP(#$R+S X+S@Y
|
||||
M &%S.B H4T-$12D@-2XP(#$R+S X+S@Y $ H(RE&5%@@,BXQ+C N,2!S8V1E
|
||||
M.B]U<W(O8V-S+VQI8B]V86QU97,M6'0N;P!A8V]M<#H@*%-#1$4I(#4N," Q
|
||||
M,B\P."\X.0!A<SH@*%-#1$4I(#4N," Q,B\P."\X.0 D2&5A9&5R.B O<"]2
|
||||
M0U,O=71I;#(M,BXQ+W5S<B]S<F,O;&EB+VQI8F,O:3@V,"]G96XO<VA?9&%T
|
||||
M82YC+'8@,BXQ(#DR+S U+S$T(# W.C$W.C4T(&1A=FED;V9F($5X<" D &%C
|
||||
M;VUP.B H4T-$12D@-2XP(#$R+S X+S@Y &%S.B H4T-$12D@-2XP(#$R+S X
|
||||
M+S@Y $ H(RE&5%@@,BXQ+C N,2!S8V1E.B]U<W(O8V-S+VQI8B]L:6)C+G-O
|
||||
M "1(96%D97(Z("]P+U)#4R]U=&EL,BTR+C$O=7-R+W-R8R]L:6(O;&EB8R]I
|
||||
M.#8P+V-S=2]C<G1N+G,L=B R+C$@.3(O,#4O,30@,#<Z,38Z,C(@9&%V:61O
|
||||
M9F8@17AP("0 0"@C*4946" R+C$N,"XQ('-C9&4Z+W5S<B]C8W,O;&EB+V-R
|
||||
M=&XN;P @;&0@.B H4T-$12D@-2XP(#$R+S X+S@Y "X $0 2 6< X
|
||||
M9V1B;64N8P !-@ $!$0 $_ !(0 &0 !!@ = !, $@ 4X
|
||||
M.'1?<W1R=6-T "V & "H #0 2 =0 X=E]C:&%R7VUE;6)E<@
|
||||
M50 ! ", !@0 !P "L #0 2 H X=E]S:&]R=%]M96UB97( %4
|
||||
M! C 8$ @< I T $@ ,D .'9?:6YT7VUE;6)E<@ 50 ' ",
|
||||
M!@0 $!P "H #0 2 \P X=E]L;VYG7VUE;6)E<@ 50 * ", !@0
|
||||
M (!P "L #0 2 !'@ X=E]F;&]A=%]M96UB97( %4 #@ C 8$
|
||||
M# < L T $@ 4H .'9?9&]U8FQE7VUE;6)E<@ 50 / ", !@0 0
|
||||
M!P 0 ; !, $@ FP ."XP9F%K90 M@ !@ J T $@ 9,
|
||||
M.'9?8VAA<E]M96UB97( %4 0 C 8$ < K T $@ ;X .'9?
|
||||
M<VAO<G1?;65M8F5R !5 0 (P &! (' *0 - !( 'G #AV7VEN
|
||||
M=%]M96UB97( %4 !P C 8$ ! < J T $@ A$ .'9?;&]N9U]M
|
||||
M96UB97( %4 "@ C 8$ " < K T $@ CP .'9?9FQO871?;65M
|
||||
M8F5R !5 X (P &! P' + - !( )H #AV7V1O=6)L95]M96UB
|
||||
M97( %4 #P C 8$ $ < $ ' 7 !( .+ #AT7W5N:6]N "V
|
||||
M " "H #0 2 "L@ X=E]C:&%R7VUE;6)E<@ 50 ! ", !@0
|
||||
M!P "L #0 2 "W0 X=E]S:&]R=%]M96UB97( %4 ! C 8$ <
|
||||
M I T $@ P8 .'9?:6YT7VUE;6)E<@ 50 ' ", !@0 !P "H
|
||||
M#0 2 #, X=E]L;VYG7VUE;6)E<@ 50 * ", !@0 !P "L #0 2
|
||||
M #6P X=E]F;&]A=%]M96UB97( %4 #@ C 8$ < L T $@
|
||||
M X< .'9?9&]U8FQE7VUE;6)E<@ 50 / ", !@0 !P 0 ; !<
|
||||
M$@ !*D ."XQ9F%K90 M@ @ J T $@ ] .'9?8VAA<E]M96UB
|
||||
M97( %4 0 C 8$ < K T $@ _L .'9?<VAO<G1?;65M8F5R
|
||||
M !5 0 (P &! ' *0 - !( 0D #AV7VEN=%]M96UB97( %4
|
||||
M!P C 8$ < J T $@ !$X .'9?;&]N9U]M96UB97( %4 "@ C
|
||||
M 8$ < K T $@ !'D .'9?9FQO871?;65M8F5R !5 X (P &
|
||||
M! ' + - !( 2E #AV7V1O=6)L95]M96UB97( %4 #P C 8$
|
||||
M < $ *@ & !( 37 #AV7V-H87)?9G5N8P 50 ! 1$ !/X
|
||||
M 2$ !08 ! #$ !@ 2 %# X=E]S:6=N961?8VAA<E]F=6YC !5
|
||||
M (!$0 %" !(0 %$ $ ,P & !( 5# #AV7W5N<VEG;F5D7V-H
|
||||
M87)?9G5N8P 50 # 1$ !1( 2$ !1H ! "L !@ 2 %<@ X=E]S
|
||||
M:&]R=%]F=6YC !5 0!$0 %' !(0 %) $ ,@ & !( 6H #AV
|
||||
M7W-I9VYE9%]S:&]R=%]F=6YC !5 4!$0 %)@!(0 %+@ $ - &
|
||||
M !( 7@ #AV7W5N<VEG;F5D7W-H;W)T7V9U;F, %4 !@$1 4P $A 4
|
||||
MX 0 I 8 $@ !@T .'9?:6YT7V9U;F, %4 !P$1 4Z $A 5
|
||||
M" 0 P 8 $@ !D$ .'9?<VEG;F5D7VEN=%]F=6YC !5 @!$0
|
||||
M%1 !(0 %3 $ ,@ & !( 9W #AV7W5N<VEG;F5D7VEN=%]F=6YC
|
||||
M !5 D!$0 %3@!(0 %5@ $ *@ & !( :E #AV7VQO;F=?9G5N
|
||||
M8P 50 * 1$ !5@ 2$ !6 ! #$ !@ 2 &V@ X=E]S:6=N961?
|
||||
M;&]N9U]F=6YC !5 L!$0 %8@!(0 %:@ $ ,P & !( <1 #AV
|
||||
M7W5N<VEG;F5D7VQO;F=?9G5N8P 50 , 1$ !6P 2$ !70 ! "L
|
||||
M!@ 2 '0 X=E]F;&]A=%]F=6YC !5 X!$0 %=@!(0 %?@ $
|
||||
M+ & !( =P #AV7V1O=6)L95]F=6YC !5 \!$0 %@ !(0 %B $
|
||||
M %0 5 !( >N (, !0$ ?J %0 % !( >: (, !0$ ?J
|
||||
M$ % !( >J %4 !P 0 \ $ $@ !^H E0 *, * "
|
||||
M ( $ @ @@ <@ "X 9 !, $@ "'L
|
||||
M.&QI;FL +8 "8 )@ - !( @I #AN97AT "# 4! 'Z@ C 8$
|
||||
M < J T $@ "%, .&QI;FMF=6YC "# 4! '< C 8$
|
||||
M! < D T $@ "'< .'-T=69F !R 'K@ C 8$ " < $
|
||||
M%0 5 !( BY (, !0$ ?J %0 % !( BE (, !0$ ?J $ %
|
||||
M !( BU %4 !P 0 \ $ $@ "/4 E0 *, * "
|
||||
M ( $ @ @@ <@ "X < !< $@ "8D .'1U
|
||||
M7VQI;FL +8 "0 )@ - !( DW #AN97AT "# 4! 'Z@ C 8$
|
||||
M < J T $@ "6$ .&QI;FMF=6YC "# 4! (>P C 8$
|
||||
M < D T $@ "84 .'-T=69F !R (N0 C 8$ < $
|
||||
M.@ $ !( G' #@N,F9A:V4 +8 $ /, &P )B;'5E %G<F5E
|
||||
M;@ <F5D 0 ^ 0 $@ "@D .&-O;&]R<P M@ 0 \P ?
|
||||
M G!I;FL 7!U<G!L90 >65L;&]W 0 R 0 $@
|
||||
M"C\ ."XS9F%K90 M@ 0 \P 3 69O<F0 &-H979Y 0
|
||||
M Q 0 $@ "G0 .&-A<G, +8 $ /, % %P;W)S8VAE !B
|
||||
M;7< ! #( ! 2 *J@ X+C1F86ME "V ! #S !, !5%)5
|
||||
M10 1D%,4T4 ! !P %@ 2 *Q@ X8F]O;&5A;@ <@ "G0
|
||||
M Q 0 $@ "OL .&)V86QS "V ! #S !, !=')U90 9F%L
|
||||
M<V4 ! !T %@ 2 +& X8F]O;&5A;C( '( K& 1@ $ !(
|
||||
M MB #AM:7-O<F1E<F5D "V ! #S ", #=&AR964 'IE<F\
|
||||
M 6]N90 "='=O 0 C 8 $@ "XD .&UA:6X %4 !P$1
|
||||
M 6* $A 9 0 G < $@ "[ .'-P;W)T<V-A<@ <@ "C\
|
||||
M(P % P *V@ E < $@ "]4 .&-L=6YK97( '( H) ", !0, "K0
|
||||
M * ' !( O] #AN;VYP<FEM87)Y !R )QP C 4# IY "4
|
||||
M!P 2 ,(@ X<')I;6%R>0 <@ "8D (P % P *?0 D < $@ #$8
|
||||
M.'5?;&EN:P <@ "/4 (P % P *M@ G < $@ #&T .'-?;&EN:P
|
||||
M@P % 0 !^H (P % P *F@ F < $@ #), .'9?=6YI;VXR !R #
|
||||
MBP C 4# K< "4 !P 2 ,N X=E]U;FEO;@ <@ FP (P % P
|
||||
M*W@ G < $@ #-\ .'9?<W1R=6-T,@ <@ 4X (P % P *I G
|
||||
M < $@ #08 .'9?<W1R=6-T,0 <@ "X (P % P *G@ O < $@
|
||||
M#34 .'9?9&]U8FQE7W!O:6YT97( &, P$ #P C 4# J< "X !P 2
|
||||
M -8P X=E]F;&]A=%]P;VEN=&5R !C ,! X (P % P *JP V <
|
||||
M$@ #9D .'9?=6YS:6=N961?;&]N9U]P;VEN=&5R !C ,! P (P % P
|
||||
M*>@ T < $@ #<T .'9?<VEG;F5D7VQO;F=?<&]I;G1E<@ 8P # 0 +
|
||||
M ", !0, "JP +0 ' !( WZ #AV7VQO;F=?<&]I;G1E<@ 8P # 0 *
|
||||
M ", !0, "I -0 ' !( XO #AV7W5N<VEG;F5D7VEN=%]P;VEN=&5R
|
||||
M !C ,! D (P % P *B@ S < $@ #F( .'9?<VEG;F5D7VEN=%]P
|
||||
M;VEN=&5R !C ,! @ (P % P *F0 L < $@ #HX .'9?:6YT7W!O
|
||||
M:6YT97( &, P$ !P C 4# J' #< !P 2 .Q0 X=E]U;G-I9VYE
|
||||
M9%]S:&]R=%]P;VEN=&5R !C ,! 8 (P % P *= U < $@ #OH
|
||||
M.'9?<VEG;F5D7W-H;W)T7W!O:6YT97( &, P$ !0 C 4# J; "X
|
||||
M!P 2 /* X=E]S:&]R=%]P;VEN=&5R !C ,! 0 (P % P *KP V
|
||||
M < $@ #UX .'9?=6YS:6=N961?8VAA<E]P;VEN=&5R !C ,! , (P %
|
||||
M P *E@ T < $@ #Y( .'9?<VEG;F5D7V-H87)?<&]I;G1E<@ 8P #
|
||||
M 0 " ", !0, "K +0 ' !( ^_ #AV7V-H87)?<&]I;G1E<@ 8P #
|
||||
M 0 ! ", !0, "I4 ) ! !( _C )4 "C ! @ 0@
|
||||
M50 / + ' !( ! / #AV7V1O=6)L95]A<G)A>0 <@ #[\ (P % P
|
||||
M*?@ D $ $@ $#, E0 *, $ " !" !5 X K <
|
||||
M$@ $%X .'9?9FQO871?87)R87D '( ! / ", !0, "JT ) ! !(
|
||||
M !"" )4 "C ! @ 0@ 50 , ,P ' !( !"U #AV7W5N
|
||||
M<VEG;F5D7VQO;F=?87)R87D '( !!> ", !0, "HP ) ! !( !#9
|
||||
M )4 "C ! @ 0@ 50 + ,0 ' !( !$* #AV7W-I9VYE
|
||||
M9%]L;VYG7V%R<F%Y !R 0M0 C 4# J$ "0 0 2 1+@"5
|
||||
MHP 0 ( $( %4 "@ "H !P 2 16 X=E]L;VYG7V%R<F%Y
|
||||
M !R 1"@ C 4# JQ "0 0 2 1? "5 HP 0 (
|
||||
M $( %4 "0 #( !P 2 1K@ X=E]U;G-I9VYE9%]I;G1?87)R87D '(
|
||||
M !%8 ", !0, "H@ ) ! !( !'2 )4 "C ! @ 0@
|
||||
M50 ( , ' !( !(" #AV7W-I9VYE9%]I;G1?87)R87D '( !&N ",
|
||||
M!0, "I< ) ! !( !(F )4 "C ! @ 0@ 50 '
|
||||
M*0 ' !( !)/ #AV7VEN=%]A<G)A>0 <@ $@( (P % P *>P D $
|
||||
M$@ $G, E0 *, $ " !" !5 8 T < $@ $J< .'9?
|
||||
M=6YS:6=N961?<VAO<G1?87)R87D '( !)/ ", !0, "I0 ) ! !(
|
||||
M !++ )4 "C ! @ 0@ 50 % ,@ ' !( !+] #AV7W-I
|
||||
M9VYE9%]S:&]R=%]A<G)A>0 <@ $J< (P % P *A@ D $ $@ $R$
|
||||
ME0 *, $ " !" !5 0 K < $@ $TP .'9?<VAO<G1?
|
||||
M87)R87D '( !+] ", !0, "I, ) ! !( !-P )4 "C ! @
|
||||
M 0@ 50 # ,P ' !( !.C #AV7W5N<VEG;F5D7V-H87)?87)R
|
||||
M87D '( !-, ", !0, "G( ) ! !( !/' )4 "C ! @
|
||||
M 0@ 50 " ,0 ' !( !/X #AV7W-I9VYE9%]C:&%R7V%R<F%Y !R
|
||||
M 3HP C 4# J" "0 0 2 4' "5 HP 0 ( $(
|
||||
M %4 0 "H !P 2 41@ X=E]C:&%R7V%R<F%Y !R 3^ C 4# J
|
||||
MJ "0 !P 2 4:@ X=E]D;W5B;&4 %4 #P C 4# IV ", !P 2
|
||||
M 4C0 X=E]F;&]A= 50 . ", !0, "H, *P ' !( !2X #AV7W5N
|
||||
M<VEG;F5D7VQO;F< %4 # C 4# J2 "D !P 2 4X0 X=E]S:6=N
|
||||
M961?;&]N9P 50 + ", !0, "G, (@ ' !( !4# #AV7VQO;F< %4
|
||||
M"@ C 4# J. "H !P 2 5+0 X=E]U;G-I9VYE9%]I;G0 %4 "0 C
|
||||
M 4# IP "@ !P 2 550 X=E]S:6=N961?:6YT !5 @ (P % P
|
||||
M*<0 A < $@ %78 .'9?:6YT !5 < (P % P *> L < $@
|
||||
M%:( .'9?=6YS:6=N961?<VAO<G0 %4 !@ C 4# IU "H !P 2 5
|
||||
MS X=E]S:6=N961?<VAO<G0 %4 !0 C 4# J+ ", !P 2 5[P X
|
||||
M=E]S:&]R= 50 $ ", !0, "H\ *P ' !( !8: #AV7W5N<VEG;F5D
|
||||
M7V-H87( %4 P C 4# J"@ "D !P 2 60P X=E]S:6=N961?8VAA
|
||||
M<@ 50 " ", !0, "I$ (@ ' !( !9E #AV7V-H87( %4 0 C 4#
|
||||
M JS 0 ' "D@ $_ !Y__\ ( >O__ ,
|
||||
M 'O__P %@ !]__\ " ?O__ J '___P - "!__\
|
||||
M #X @O__ !( (/__P 4@ "%__\ %P AO__ !F
|
||||
M (?__P < ")__\ 'H BO__ "$ ++__P C@ "U__\
|
||||
M )$ MO__ "3 +?__P E@ "Y__\ )D NO__ "<
|
||||
M +O__P GP "]__\ *( OO__ "E +___P J #!__\
|
||||
M *L PO__ "N ,/__P L0 #%__\ +0 QO__ "X
|
||||
M ,G__P O #*__\ , R___ #$ ,W__P R #.__\
|
||||
M ,P S___ #0 -'__P U #2__\ -@ T___ #<
|
||||
M -7__P X #6__\ .0 U___ #H -G__P [ #:__\
|
||||
M / W/__ #T -W__P ^ #>__\ /P X/__ $
|
||||
M .'__P !! #B__\ 0@ Y/__ $, .7__P !$ #F__\
|
||||
M 10 Z/__ $8 .G__P !' #J__\ 2 [/__ $D
|
||||
M .W__P !* #O__\ 2P \/__ $O /'__P !,@ #R__\
|
||||
M 34 ]/__ $X /;__P !/ #W__\ 3P /__ %$
|
||||
M $
|
||||
M ! @ $-0 #4 $P 0 ) !0
|
||||
M ( !#H Z $@ # 0 $ #P L " 1
|
||||
M, 3 #0 ! ( $ $ !< # @ $@ (
|
||||
M >P 0 ? ! ( !)\ "? #
|
||||
M # !P 0 , *0 P & 2L K 0
|
||||
M 0 " "\ , !@ $L + @
|
||||
M$ @ T # 8 !- #0 !< ! (
|
||||
M .@ P & 9 "0 0 0 " $
|
||||
M ! @ &1 D0 % " !( 0
|
||||
M , "DD )) @ 0 3@ $ # I
|
||||
M, "3 < 0 ! %, & P *4P E,
|
||||
M < 0 ! @ !< " , "G )P <
|
||||
M @ 80 ( "< < $
|
||||
M !P $ $ &D # !# $T0
|
||||
M 0 !Q P 5D0 )$ $
|
||||
M >P $ %B( 0N ! (0
|
||||
M ! !I0 6< ! "+ 0
|
||||
> PP I( $
|
||||
|
||||
end
|
||||
25
gdb/testsuite/gdb.base/int-type.c
Normal file
25
gdb/testsuite/gdb.base/int-type.c
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
int w;
|
||||
|
||||
|
||||
|
||||
int main ()
|
||||
{
|
||||
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
breakpoint();
|
||||
#endif
|
||||
|
||||
x = 14;
|
||||
y = 3;
|
||||
z = 2;
|
||||
w = 2;
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
37
gdb/testsuite/gdb.base/interrupt.c
Normal file
37
gdb/testsuite/gdb.base/interrupt.c
Normal file
@@ -0,0 +1,37 @@
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
char x;
|
||||
int nbytes;
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
breakpoint();
|
||||
#endif
|
||||
printf ("talk to me baby\n");
|
||||
while (1)
|
||||
{
|
||||
nbytes = read (0, &x, 1);
|
||||
if (nbytes < 0)
|
||||
{
|
||||
#ifdef EINTR
|
||||
if (errno != EINTR)
|
||||
#endif
|
||||
perror ("");
|
||||
}
|
||||
else if (nbytes == 0)
|
||||
{
|
||||
printf ("end of file\n");
|
||||
exit (0);
|
||||
}
|
||||
else
|
||||
write (1, &x, 1);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
func1 ()
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
175
gdb/testsuite/gdb.base/interrupt.exp
Normal file
175
gdb/testsuite/gdb.base/interrupt.exp
Normal file
@@ -0,0 +1,175 @@
|
||||
# Copyright (C) 1994, 1995, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
if [host_info exists name] {
|
||||
if [board_info host exists gdb,nointerrupts] {
|
||||
verbose "Skipping interrupt.exp because of nointerrupts."
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
if [target_info exists gdb,noinferiorio] {
|
||||
verbose "Skipping interrupt.exp because of noinferiorio."
|
||||
return
|
||||
}
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile interrupt
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
gdb_start
|
||||
|
||||
|
||||
if ![file exists $binfile] then {
|
||||
perror "$binfile does not exist."
|
||||
return 0
|
||||
} else {
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load $binfile
|
||||
# Hope this is unix :-)
|
||||
gdb_test "shell stty intr '^C'" "" \
|
||||
"set interrupt character in interrupt.exp"
|
||||
if [runto_main] then {
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re "\r\ntalk to me baby\r\n$" {
|
||||
pass "child process is alive"
|
||||
}
|
||||
timeout { fail "run (timeout)" }
|
||||
eof { fail "run (eof)" }
|
||||
}
|
||||
# This should appear twice, once for the echo and once for the
|
||||
# program's output. Under dejagnu (but not interactively) for
|
||||
# SunOS4, it only appears once. Don't worry about it, I imagine
|
||||
# dejagnu has just done something to the tty modes.
|
||||
send_gdb "a\n"
|
||||
gdb_expect {
|
||||
-re "^a\r\n(|a\r\n)$" {
|
||||
pass "child process ate our char"
|
||||
}
|
||||
timeout { fail "echo a (timeout)" }
|
||||
eof { fail "echo a (eof)" }
|
||||
}
|
||||
# Wait until the program is in the read system call again.
|
||||
sleep 2
|
||||
|
||||
# Cntrl-c may fail for simulator targets running on a BSD host.
|
||||
# This is the result of a combination of the read syscall
|
||||
# being restarted and gdb capturing the cntrl-c signal.
|
||||
|
||||
# Cntrl-c may fail for simulator targets on slow hosts.
|
||||
# This is because there is a race condition between entering
|
||||
# the read and delivering the cntrl-c.
|
||||
|
||||
send_gdb "\003"
|
||||
gdb_expect {
|
||||
-re "Program received signal SIGINT.*$gdb_prompt $" {
|
||||
pass "send_gdb control C"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "send_gdb control C" }
|
||||
timeout { fail "send_gdb control C (timeout)" }
|
||||
eof { fail "send_gdb control C (eof)" }
|
||||
}
|
||||
|
||||
send_gdb "p func1 ()\n"
|
||||
gdb_expect {
|
||||
-re " = 4.*$gdb_prompt $" { pass "call function when asleep" }
|
||||
-re ".*Program received signal SIGSEGV.*$gdb_prompt $" {
|
||||
setup_xfail "i*86-pc-linux*-gnu*"
|
||||
fail "child died when we called func1, skipped rest of tests"
|
||||
return
|
||||
}
|
||||
-re "$gdb_prompt $" { fail "call function when asleep (wrong output)" }
|
||||
default {
|
||||
|
||||
# This fail probably happens whenever we use /proc (we
|
||||
# don't use PRSABORT), but apparently also happens on
|
||||
# other machines as well.
|
||||
|
||||
setup_xfail "sparc*-*-solaris2*"
|
||||
setup_xfail "mips-*-ultrix*"
|
||||
setup_xfail "hppa*-*-*"
|
||||
setup_xfail "i386*-*-bsd*"
|
||||
setup_xfail "i*86-*-solaris2*"
|
||||
setup_xfail "*-*-sysv4*"
|
||||
setup_xfail "vax-*-*"
|
||||
setup_xfail "alpha-*-*"
|
||||
setup_xfail "*-*-irix*"
|
||||
setup_xfail "*-*-hpux*"
|
||||
setup_xfail "*-*-*lynx*"
|
||||
fail "call function when asleep (stays asleep)"
|
||||
# Send_Gdb a newline to wake it up
|
||||
send_gdb "\n"
|
||||
gdb_test "" " = 4" "call function after waking it"
|
||||
}
|
||||
# eof { fail "call function when asleep (eof)" }
|
||||
}
|
||||
|
||||
# Now try calling the function again.
|
||||
gdb_test "p func1 ()" " = 4" "call function a second time"
|
||||
|
||||
# And the program should still be doing the same thing.
|
||||
# The optional trailing \r\n is in case we sent a newline above
|
||||
# to wake the program, in which case the program now sends it
|
||||
# back. We check for it either here or in the next gdb_expect
|
||||
# command, because which one it ends up in is timing dependent.
|
||||
send_gdb "continue\n"
|
||||
# For some reason, i386-*-sysv4 gdb fails to issue the Continuing
|
||||
# message, but otherwise appears normal (FIXME).
|
||||
gdb_expect {
|
||||
-re "^continue\r\nContinuing.\r\n(\r\n|)$" { pass "continue" }
|
||||
-re "^continue\r\n\r\n" { fail "continue (missing Continuing.)" }
|
||||
-re "$gdb_prompt $" { fail "continue" }
|
||||
timeout { fail "continue (timeout)" }
|
||||
eof { fail "continue (eof)" }
|
||||
}
|
||||
|
||||
send_gdb "data\n"
|
||||
# The optional leading \r\n is in case we sent a newline above
|
||||
# to wake the program, in which case the program now sends it
|
||||
# back.
|
||||
gdb_expect {
|
||||
-re "^(\r\n|)data\r\n(|data\r\n)$" { pass "echo data" }
|
||||
timeout { fail "echo data (timeout)" }
|
||||
eof { fail "echo data (eof)" }
|
||||
}
|
||||
|
||||
setup_xfail "i*86-pc-linux*-gnu*"
|
||||
send_gdb "\004"
|
||||
gdb_expect {
|
||||
-re "end of file.*Program exited normally.*$gdb_prompt $" {
|
||||
pass "send_gdb end of file"
|
||||
}
|
||||
-re "$gdb_prompt $" { fail "send end of file" }
|
||||
timeout { fail "send end of file (timeout)" }
|
||||
eof { fail "send end of file (eof)" }
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0
|
||||
19
gdb/testsuite/gdb.base/jump.c
Normal file
19
gdb/testsuite/gdb.base/jump.c
Normal file
@@ -0,0 +1,19 @@
|
||||
/* This program is used to test the "jump" command. There's nothing
|
||||
particularly deep about the functionality nor names in here.
|
||||
*/
|
||||
|
||||
static int square (x)
|
||||
int x;
|
||||
{
|
||||
return x*x;
|
||||
}
|
||||
|
||||
|
||||
main ()
|
||||
{
|
||||
int i = 99;
|
||||
|
||||
i++;
|
||||
i = square (i);
|
||||
i--;
|
||||
}
|
||||
192
gdb/testsuite/gdb.base/jump.exp
Normal file
192
gdb/testsuite/gdb.base/jump.exp
Normal file
@@ -0,0 +1,192 @@
|
||||
# Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
# are we on a target board
|
||||
if ![isnative] then {
|
||||
return 0
|
||||
}
|
||||
|
||||
clear_xfail "*-*-*"
|
||||
|
||||
set testfile "jump"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
# Build the test case
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
|
||||
# Start with a fresh gdb
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
if ![runto_main] then {
|
||||
perror "Couldn't run to main"
|
||||
return -1
|
||||
}
|
||||
|
||||
# Set a breakpoint on the statement that we're about to jump to.
|
||||
# The statement doesn't contain a function call.
|
||||
#
|
||||
send_gdb "break 18\n"
|
||||
set bp_on_non_call 0
|
||||
gdb_expect {
|
||||
-re "\[Bb\]reakpoint (\[0-9\]*) at 0x\[0-9a-fA-F\]*: file .*${srcfile}, line 18.*$gdb_prompt $"\
|
||||
{set bp_on_non_call $expect_out(1,string)
|
||||
pass "break before jump to non-call"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "break before jump to non-call"}
|
||||
timeout {fail "(timeout) break before jump to non-call"}
|
||||
}
|
||||
|
||||
# Can we jump to the statement? Do we stop there?
|
||||
#
|
||||
send_gdb "jump 18\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint \[0-9\]*, .*${srcfile}:18.*$gdb_prompt $"\
|
||||
{pass "jump to non-call"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "jump to non-call"}
|
||||
timeout {fail "(timeout) jump to non-call"}
|
||||
}
|
||||
|
||||
# Set a breakpoint on the statement that we're about to jump to.
|
||||
# The statement does contain a function call.
|
||||
#
|
||||
send_gdb "break 17\n"
|
||||
set bp_on_call 0
|
||||
gdb_expect {
|
||||
-re "\[Bb\]reakpoint (\[0-9\]*) at 0x\[0-9a-fA-F\]*: file .*${srcfile}, line 17.*$gdb_prompt $"\
|
||||
{set bp_on_call $expect_out(1,string)
|
||||
pass "break before jump to call"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "break before jump to call"}
|
||||
timeout {fail "(timeout) break before jump to call"}
|
||||
}
|
||||
|
||||
# Can we jump to the statement? Do we stop there?
|
||||
#
|
||||
send_gdb "jump 17\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint \[0-9\]*, .*${srcfile}:17.*$gdb_prompt $"\
|
||||
{pass "jump to call"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "jump to call"}
|
||||
timeout {fail "(timeout) jump to call"}
|
||||
}
|
||||
|
||||
# If we disable the breakpoint at the function call, and then
|
||||
# if we jump to that statement, do we not stop there, but at
|
||||
# the following breakpoint?
|
||||
#
|
||||
send_gdb "disable $bp_on_call\n"
|
||||
gdb_expect {
|
||||
-re "$gdb_prompt $"\
|
||||
{pass "disable breakpoint on call"}
|
||||
timeout {fail "(timeout) disable breakpoint on call"}
|
||||
}
|
||||
|
||||
send_gdb "jump 17\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint \[0-9\]*, .*${srcfile}:18.*$gdb_prompt $"\
|
||||
{pass "jump to call with disabled breakpoint"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "jump to call with disabled breakpoint"}
|
||||
timeout {fail "(timeout) jump to call with disabled breakpoint"}
|
||||
}
|
||||
|
||||
# Verify that GDB responds gracefully to the "jump" command without
|
||||
# an argument.
|
||||
#
|
||||
send_gdb "jump\n"
|
||||
gdb_expect {
|
||||
-re "Argument required .starting address..*$gdb_prompt $"\
|
||||
{pass "jump without argument disallowed"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "jump without argument disallowed"}
|
||||
timeout {fail "(timeout) jump without argument disallowed"}
|
||||
}
|
||||
|
||||
# Verify that GDB responds gracefully to the "jump" command with
|
||||
# trailing junk.
|
||||
#
|
||||
send_gdb "jump 17 100\n"
|
||||
gdb_expect {
|
||||
-re "Junk at end of line specification: 100.*$gdb_prompt $"\
|
||||
{pass "jump with trailing argument junk"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "jump with trailing argument junk"}
|
||||
timeout {fail "(timeout) jump with trailing argument junk"}
|
||||
}
|
||||
|
||||
# Verify that GDB responds gracefully to a request to jump out of
|
||||
# the current function. (Note that this will very likely cause the
|
||||
# inferior to die. Be prepared to rerun the inferior, if further
|
||||
# testing is desired.)
|
||||
#
|
||||
# Try it both ways: confirming and not confirming the jump.
|
||||
#
|
||||
send_gdb "jump 8\n"
|
||||
gdb_expect {
|
||||
-re "Line 8 is not in `main'. Jump anyway.*y or n. $"\
|
||||
{send_gdb "n\n"
|
||||
gdb_expect {
|
||||
-re "Not confirmed.*$gdb_prompt $"\
|
||||
{pass "aborted jump out of current function"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "aborted jump out of current function"}
|
||||
timeout {fail "(timeout) aborted jump out of current function"}
|
||||
}
|
||||
}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "aborted jump out of current function"}
|
||||
timeout {fail "(timeout) aborted jump out of current function"}
|
||||
}
|
||||
|
||||
send_gdb "jump 8\n"
|
||||
gdb_expect {
|
||||
-re "Line 8 is not in `main'. Jump anyway.*y or n. $"\
|
||||
{send_gdb "y\n"
|
||||
gdb_expect {
|
||||
-re "Continuing at.*$gdb_prompt $"\
|
||||
{pass "jump out of current function"}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "jump out of current function"}
|
||||
timeout {fail "(timeout) jump out of current function"}
|
||||
}
|
||||
}
|
||||
-re "$gdb_prompt $"\
|
||||
{fail "jump out of current function"}
|
||||
timeout {fail "(timeout) jump out of current function"}
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
return 0
|
||||
122
gdb/testsuite/gdb.base/langs.exp
Normal file
122
gdb/testsuite/gdb.base/langs.exp
Normal file
@@ -0,0 +1,122 @@
|
||||
# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile langs
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
if [is_remote host] {
|
||||
remote_download host ${srcdir}/${subdir}/langs1.f
|
||||
remote_download host ${srcdir}/${subdir}/langs2.cxx
|
||||
}
|
||||
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/langs0.c" "${binfile}0.o" object {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/langs1.c" "${binfile}1.o" object {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/langs2.c" "${binfile}2.o" object {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
if { [gdb_compile "${binfile}0.o ${binfile}1.o ${binfile}2.o" ${binfile} executable {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
# Create and source the file that provides information about the compiler
|
||||
# used to compile the test case.
|
||||
if [get_compiler_info ${binfile}] {
|
||||
return -1;
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load $binfile
|
||||
|
||||
gdb_test "b langs0" {Function "langs0" not defined\.} \
|
||||
"break on nonexistent function in langs.exp"
|
||||
|
||||
if [runto csub] then {
|
||||
|
||||
gdb_test "show language" "currently c\".*" \
|
||||
"show language at csub in langs.exp"
|
||||
# On some machines, foo doesn't get demangled because the N_SOL for
|
||||
# langs2.cxx is seen only after the function stab for foo. So
|
||||
# the following regexps are kludged to accept foo__Fi as well as foo,
|
||||
# even though only the latter is correct. I haven't tried to xfail it
|
||||
# because it depends on details of the compiler.
|
||||
|
||||
if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
|
||||
gdb_test "bt" "#0.*csub.*#1.*(foo|foo__Fi) \\(.*#2.*cppsub_ .*#3.*fsub.*#4.*langs0__2do \\(.*#5 \[0-9a-fx\]* in main.*" "backtrace in langs.exp"
|
||||
|
||||
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
|
||||
gdb_test "up" ".* in (foo|foo__Fi) .* at langs2\\.cxx.*return csub \\(.*" \
|
||||
"up to foo in langs.exp"
|
||||
gdb_test "show language" "currently c\\+\\+.*" \
|
||||
"show language at foo in langs.exp"
|
||||
|
||||
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
|
||||
gdb_test "up" ".* in cppsub_ .* at langs2\\.cxx.*return foo \\(.*" \
|
||||
"up to cppsub_ in langs.exp"
|
||||
gdb_test "show language" "currently c\\+\\+.*" \
|
||||
"show language at cppsub_ in langs.exp"
|
||||
|
||||
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
|
||||
gdb_test "up" ".* in fsub.* at langs1\\.f.*return \\(cppsub .*" \
|
||||
"up to fsub in langs.exp"
|
||||
gdb_test "show language" "currently fortran.*" \
|
||||
"show language at fsub in langs.exp"
|
||||
|
||||
if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
|
||||
gdb_test "up" ".* in langs0__2do .* at .*langs0\\.c.*return fsub.*" \
|
||||
"up to langs0__2do in langs.exp"
|
||||
gdb_test "show language" "currently c\".*" \
|
||||
"show language at langs0__2do in langs.exp"
|
||||
|
||||
gdb_test "up" ".* in main .* at .*langs0\\.c.*if \\(langs0__2do \\(.*" \
|
||||
"up to main in langs.exp"
|
||||
gdb_test "show language" "currently c\".*" \
|
||||
"show language at main in langs.exp"
|
||||
|
||||
if [target_info exists gdb,noresults] { return }
|
||||
|
||||
if [target_info exists use_gdb_stub] {
|
||||
gdb_breakpoint "exit"
|
||||
gdb_test "cont" "Breakpoint .*exit.*" "continue to exit in langs.exp"
|
||||
} else {
|
||||
gdb_test "cont" "Program exited normally\\..*" \
|
||||
"continue to exit in langs.exp"
|
||||
}
|
||||
}
|
||||
|
||||
return 0
|
||||
28
gdb/testsuite/gdb.base/langs0.c
Normal file
28
gdb/testsuite/gdb.base/langs0.c
Normal file
@@ -0,0 +1,28 @@
|
||||
/* This file is actually in C, it is not supposed to simulate something
|
||||
translated from another language or anything like that. */
|
||||
int
|
||||
csub (x)
|
||||
int x;
|
||||
{
|
||||
return x + 1;
|
||||
}
|
||||
|
||||
int
|
||||
langs0__2do ()
|
||||
{
|
||||
return fsub_ () + 2;
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
breakpoint();
|
||||
#endif
|
||||
if (langs0__2do () == 5003)
|
||||
/* Success. */
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
33
gdb/testsuite/gdb.base/langs1.c
Normal file
33
gdb/testsuite/gdb.base/langs1.c
Normal file
@@ -0,0 +1,33 @@
|
||||
/* langs1.f -- translated by f2c (version of 5 May 1990 1:12:08). */
|
||||
|
||||
/* f2c output hacked as follows for GDB testsuite:
|
||||
1. Change commented out "#" lines to #line directives.
|
||||
I don't know why this behavior isn't the default for f2c -g.
|
||||
2. Remove include of f2c.h and put in just a typedef for "integer".
|
||||
Additional notes:
|
||||
3. f2c was called as "f2c -g langs1.f".
|
||||
4. We don't need to use the fortran libraries. */
|
||||
|
||||
typedef int integer;
|
||||
|
||||
/* Table of constant values */
|
||||
|
||||
static integer c__10000 = 10000;
|
||||
|
||||
/* I am not sure whether there is a way to have a fortran program without */
|
||||
/* a MAIN, but it does not really harm us to have one. */
|
||||
/* Main program */ MAIN__()
|
||||
{
|
||||
} /* MAIN__ */
|
||||
|
||||
#line 4 "langs1.f"
|
||||
/* Subroutine */ int fsub_()
|
||||
{
|
||||
extern integer cppsub_();
|
||||
|
||||
#line 5 "langs1.f"
|
||||
#line 6 "langs1.f"
|
||||
return cppsub_(&c__10000);
|
||||
#line 7 "langs1.f"
|
||||
} /* fsub_ */
|
||||
|
||||
7
gdb/testsuite/gdb.base/langs1.f
Normal file
7
gdb/testsuite/gdb.base/langs1.f
Normal file
@@ -0,0 +1,7 @@
|
||||
c I am not sure whether there is a way to have a fortran program without
|
||||
c a MAIN, but it does not really harm us to have one.
|
||||
end
|
||||
subroutine fsub
|
||||
integer*4 cppsub
|
||||
return (cppsub (10000))
|
||||
end
|
||||
15
gdb/testsuite/gdb.base/langs2.c
Normal file
15
gdb/testsuite/gdb.base/langs2.c
Normal file
@@ -0,0 +1,15 @@
|
||||
/* This is intended to be a vague simulation of cfront output. */
|
||||
#line 1 "langs2.cxx"
|
||||
extern int csub ();
|
||||
int
|
||||
foo__Fi (x) int x;
|
||||
{
|
||||
return csub (x / 2);
|
||||
}
|
||||
|
||||
extern int cppsub_ ();
|
||||
int
|
||||
cppsub_ (y) int *y;
|
||||
{
|
||||
return foo__Fi (*y);
|
||||
}
|
||||
13
gdb/testsuite/gdb.base/langs2.cxx
Normal file
13
gdb/testsuite/gdb.base/langs2.cxx
Normal file
@@ -0,0 +1,13 @@
|
||||
extern "C" int csub (int);
|
||||
int
|
||||
foo (int x)
|
||||
{
|
||||
return csub (x / 2);
|
||||
}
|
||||
|
||||
extern "C" int cppsub_ (int *);
|
||||
int
|
||||
cppsub_ (int *y)
|
||||
{
|
||||
return foo (*y);
|
||||
}
|
||||
521
gdb/testsuite/gdb.base/list.exp
Normal file
521
gdb/testsuite/gdb.base/list.exp
Normal file
@@ -0,0 +1,521 @@
|
||||
# Copyright (C) 1992, 1994, 1995, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# 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
|
||||
|
||||
set testfile "list"
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
# Need to download the header to the host.
|
||||
remote_download host ${srcdir}/${subdir}/list0.h list0.h
|
||||
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/list0.c" "${binfile}0.o" object {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/list1.c" "${binfile}1.o" object {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
if { [gdb_compile "${binfile}0.o ${binfile}1.o" ${binfile} executable {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Create and source the file that provides information about the compiler
|
||||
# used to compile the test case.
|
||||
if [get_compiler_info ${binfile}] {
|
||||
return -1;
|
||||
}
|
||||
|
||||
#
|
||||
# Local utility proc just to set and verify listsize
|
||||
# Return 1 if success, 0 if fail.
|
||||
#
|
||||
|
||||
set set_listsize_count 0;
|
||||
|
||||
proc set_listsize { arg } {
|
||||
global gdb_prompt
|
||||
global set_listsize_count;
|
||||
|
||||
incr set_listsize_count;
|
||||
if [gdb_test "set listsize $arg" "" "setting listsize to $arg #$set_listsize_count"] {
|
||||
return 0;
|
||||
}
|
||||
if { $arg <= 0 } {
|
||||
set arg "unlimited";
|
||||
}
|
||||
|
||||
if [gdb_test "show listsize" "Number of source lines.* is ${arg}.*" "show listsize $arg #$set_listsize_count"] {
|
||||
return 0;
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
#
|
||||
# Test display of listsize lines around a given line number.
|
||||
#
|
||||
|
||||
proc test_listsize {} {
|
||||
global gdb_prompt
|
||||
|
||||
# Show default size
|
||||
|
||||
gdb_test "show listsize" "Number of source lines gdb will list by default is 10.*" "show default list size"
|
||||
|
||||
# Show the default lines
|
||||
# The second case is for optimized code, it is still correct.
|
||||
|
||||
if ![isnative] {
|
||||
runto_main;
|
||||
unsupported "list default lines around main";
|
||||
} else {
|
||||
gdb_test "list" "(1\[ \t\]+#include \"list0.h\".*10\[ \t\]+x = 0;|2.*11\[ \t\]+foo .x\[+)\]+;)" "list default lines around main"
|
||||
}
|
||||
|
||||
# Ensure we can limit printouts to one line
|
||||
|
||||
if [ set_listsize 1 ] then {
|
||||
setup_xfail "*-*-*"
|
||||
gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"" "list line 1 with listsize 1"
|
||||
setup_xfail "*-*-*"
|
||||
gdb_test "list 2" "2\[ \t\]+" "list line 2 with listsize 1"
|
||||
}
|
||||
|
||||
# Try just two lines
|
||||
|
||||
if [ set_listsize 2 ] {
|
||||
gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"" "list line 1 with listsize 2"
|
||||
gdb_test "list 2" "1\[ \t\]+#include \"list0.h\"\r\n2\[ \t\]+" "list line 2 with listsize 2"
|
||||
gdb_test "list 3" "2\[ \t\]+\r\n3\[ \t\]+main \[)(\]+" "list line 3 with listsize 2"
|
||||
}
|
||||
|
||||
# Try small listsize > 1 that is an odd number
|
||||
|
||||
if [ set_listsize 3 ] {
|
||||
setup_xfail "*-*-*"
|
||||
gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"2\[ \t\]+" "list line 1 with listsize 3"
|
||||
setup_xfail "*-*-*"
|
||||
gdb_test "list 2" "1\[ \t\]+#include \"list0.h\".*3\[ \t\]+main \[)(\]+" "list line 2 with listsize 3"
|
||||
|
||||
setup_xfail "*-*-*"
|
||||
gdb_test "list 3" "2\[ \t\]+\r\n3\[ \t\]+main \[(\]+\[)\]+\r\n4\[ \t\]+\{" "list line 3 with listsize 3"
|
||||
}
|
||||
|
||||
# Try small listsize > 2 that is an even number.
|
||||
|
||||
if [ set_listsize 4 ] then {
|
||||
gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"\r\n2\[ \t\]+" "list line 1 with listsize 4"
|
||||
gdb_test "list 2" "1\[ \t\]+#include \"list0.h\".*3\[ \t\]+main \[)(\]+" "list line 2 with listsize 4"
|
||||
|
||||
gdb_test "list 3" "1\[ \t\]+#include \"list0.h\".*4\[ \t\]+\{" "list line 3 with listsize 4"
|
||||
gdb_test "list 4" "2\[ \t\]+\r\n.*5\[ \t\]+int x;.*" "list line 4 with listsize 4"
|
||||
}
|
||||
|
||||
# Try a size larger than the entire file.
|
||||
|
||||
if [ set_listsize 100 ] then {
|
||||
gdb_test "list 1" "1\[ \t\]+#include \"list0.h\".*\r\n42\[ \t\]+\}" "list line 1 with listsize 100"
|
||||
|
||||
gdb_test "list 10" "1\[ \t\]+#include \"list0.h\".*\r\n42\[ \t\]+\}" "list line 10 with listsize 100"
|
||||
}
|
||||
|
||||
# Try listsize of 0 which suppresses printing.
|
||||
|
||||
set_listsize 0
|
||||
gdb_test "list 1" "" "listsize of 0 suppresses output"
|
||||
|
||||
# Try listsize of -1 which is special, and means unlimited.
|
||||
|
||||
set_listsize -1
|
||||
setup_xfail "*-*-*"
|
||||
gdb_test "list 1" "1\[ \t\]+#include .*\r\n39\[ \t\]+\}" "list line 1 with unlimited listsize"
|
||||
}
|
||||
|
||||
#
|
||||
# Test "list filename:number" for C include file
|
||||
#
|
||||
|
||||
proc test_list_include_file {} {
|
||||
global gdb_prompt
|
||||
|
||||
setup_xfail "a29k-*-udi"
|
||||
setup_xfail_format "DWARF 1"
|
||||
setup_xfail_format "COFF"
|
||||
gdb_test "list list0.h:1" "1\[ \t\]+/\[*\]+ An include file .*5\[ \t\]+foo \[(\]+x\[)\]+" "list line 1 in include file"
|
||||
|
||||
setup_xfail "a29k-*-udi"
|
||||
setup_xfail_format "DWARF 1"
|
||||
setup_xfail_format "COFF"
|
||||
gdb_test "list list0.h:100" "Line number 95 out of range; .*list0.h has 36 lines." "list message for lines past EOF"
|
||||
}
|
||||
|
||||
#
|
||||
# Test "list filename:number" for C source file
|
||||
#
|
||||
|
||||
proc test_list_filename_and_number {} {
|
||||
global gdb_prompt
|
||||
|
||||
set testcnt 0
|
||||
|
||||
send_gdb "list list0.c:1\n"
|
||||
gdb_expect {
|
||||
-re "1\[ \t\]+#include \"list0.h\".*5\[ \t\]+int x;\r\n$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "list list0.c:1" ; gdb_suppress_tests }
|
||||
timeout { fail "list list0.c:1 (timeout)" ; gdb_suppress_tests }
|
||||
}
|
||||
send_gdb "list list0.c:10\n"
|
||||
gdb_expect {
|
||||
-re "5\[ \t\]+int x;.*14\[ \t\]+foo .x\[+)\]+;\r\n$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "list list.c:10" ; gdb_suppress_tests }
|
||||
timeout { fail "list list.c:10 (timeout)" ; gdb_suppress_tests }
|
||||
}
|
||||
send_gdb "list list1.c:1\n"
|
||||
gdb_expect {
|
||||
-re "1\[ \t\]+void.*5\[ \t\]+printf \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "list list1.c:1" ; gdb_suppress_tests }
|
||||
timeout { fail "list list1.c:1 (timeout)" ; gdb_suppress_tests }
|
||||
}
|
||||
send_gdb "list list1.c:12\n"
|
||||
gdb_expect {
|
||||
-re "7\[ \t\]+long_line \[(\]+.*\[)\]+;.*14\[ \t\]+\}\r\n.*$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "list list1.c:12" ; gdb_suppress_tests }
|
||||
timeout { fail "list list1.c:12 (timeout)" ; gdb_suppress_tests }
|
||||
}
|
||||
pass "list filename:number ($testcnt tests)"
|
||||
gdb_stop_suppressing_tests;
|
||||
}
|
||||
|
||||
#
|
||||
# Test "list function" for C source file
|
||||
#
|
||||
|
||||
proc test_list_function {} {
|
||||
global gdb_prompt
|
||||
global gcc_compiled
|
||||
|
||||
# gcc appears to generate incorrect debugging information for code
|
||||
# in include files, which breaks this test.
|
||||
# SunPRO cc is the second case below, it's also correct.
|
||||
setup_xfail "a29k-*-udi"
|
||||
gdb_test "list main" "(5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;|1\[ \t\]+#include .*8\[ \t\]+breakpoint\[(\]\[)\]+;)" "list function in source file 1"
|
||||
|
||||
# Ultrix gdb takes the second case below; it's also correct.
|
||||
# SunPRO cc is the third case.
|
||||
gdb_test "list bar" "(1\[ \t\]+void.*7\[ \t\]*long_line ..;.*9\[ \t\]*|1\[ \t\]+void.*8\[ \t\]+\}|1\[ \t\]+void.*7\[ \t\]*long_line ..;)" "list function in source file 2"
|
||||
|
||||
# Test "list function" for C include file
|
||||
# Ultrix gdb is the second case, still correct.
|
||||
# SunPRO cc is the third case.
|
||||
setup_xfail "powerpc-*-*"
|
||||
setup_xfail_format "DWARF 1"
|
||||
gdb_test "list foo" "(3\[ \t\]+.*12\[ \t\]+bar \[(\]+.*\[)\]+;|2\[ \t\]+including file.*11\[ \t\]+bar \[(\]+.*\[)\]+;|1\[ \t\]+/. An include file.*10\[ \t\]+bar \[(\]+.*\[)\]+;)" "list function in include file"
|
||||
}
|
||||
|
||||
proc test_list_forward {} {
|
||||
global gdb_prompt
|
||||
|
||||
set testcnt 0
|
||||
|
||||
send_gdb "list list0.c:10\n"
|
||||
gdb_expect {
|
||||
-re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
|
||||
-re ".*$gdb_prompt $" { fail "list list0.c:10" ; gdb_suppress_tests }
|
||||
timeout { fail "list list0.c:10 (timeout)" ; gdb_suppress_tests }
|
||||
}
|
||||
|
||||
send_gdb "list\n"
|
||||
gdb_expect {
|
||||
-re "15\[ \t\]+foo \[(\]+.*\[)\]+;.*24\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
|
||||
-re ".*$gdb_prompt $" { fail "list 15-24" ; gdb_suppress_tests }
|
||||
timeout { fail "list 15-24 (timeout)" ; gdb_suppress_tests }
|
||||
}
|
||||
|
||||
send_gdb "list\n"
|
||||
gdb_expect {
|
||||
-re "25\[ \t\]+foo \[(\]+.*\[)\]+;.*34\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
|
||||
-re ".*$gdb_prompt $" { fail "list 25-34" ; gdb_suppress_tests }
|
||||
timeout { fail "list 25-34 (timeout)" ; gdb_suppress_tests }
|
||||
}
|
||||
|
||||
send_gdb "list\n"
|
||||
gdb_expect {
|
||||
-re "35\[ \t\]+foo \[(\]+.*\[)\]+;.*42\[ \t\]+\}\r\n$gdb_prompt $" { incr testcnt }
|
||||
-re ".*$gdb_prompt $" { fail "list 35-42" ; gdb_suppress_tests }
|
||||
timeout { fail "list 35-42 (timeout)" ; gdb_suppress_tests }
|
||||
}
|
||||
|
||||
pass "successive list commands to page forward ($testcnt tests)"
|
||||
gdb_stop_suppressing_tests;
|
||||
}
|
||||
|
||||
proc test_list_backwards {} {
|
||||
global gdb_prompt
|
||||
|
||||
set testcnt 0
|
||||
|
||||
send_gdb "list list0.c:33\n"
|
||||
gdb_expect {
|
||||
-re "28\[ \t\]+foo \[(\]+.*\[)\]+;.*37\[ \t\]+\r\n$gdb_prompt $" { incr testcnt }
|
||||
-re ".*$gdb_prompt $" { fail "list list0.c:33" ; gdb_suppress_tests }
|
||||
timeout { fail "list list0.c:33 (timeout)" ; gdb_suppress_tests }
|
||||
}
|
||||
|
||||
send_gdb "list -\n"
|
||||
gdb_expect {
|
||||
-re "18\[ \t\]+foo \[(\]+.*\[)\]+;.*27\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
|
||||
-re ".*$gdb_prompt $" { fail "list 18-27" ; gdb_suppress_tests }
|
||||
timeout { fail "list 18-27 (timeout)" ; gdb_suppress_tests }
|
||||
}
|
||||
|
||||
send_gdb "list -\n"
|
||||
gdb_expect {
|
||||
-re "8\[ \t\]+breakpoint\[(\]\[)\];.*17\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
|
||||
-re ".*$gdb_prompt $" { fail "list 8-17" ; gdb_suppress_tests }
|
||||
timeout { fail "list 8-17 (timeout)" ; gdb_suppress_tests }
|
||||
}
|
||||
|
||||
send_gdb "list -\n"
|
||||
gdb_expect {
|
||||
-re "1\[ \t\]+#include .*7\[ \t\]+set_debug_traps\[(\]\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
|
||||
-re ".*$gdb_prompt $" { fail "list 1-7" ; gdb_suppress_tests }
|
||||
timeout { fail "list 1-7 (timeout)" ; gdb_suppress_tests }
|
||||
}
|
||||
|
||||
pass "$testcnt successive \"list -\" commands to page backwards"
|
||||
gdb_stop_suppressing_tests;
|
||||
}
|
||||
|
||||
#
|
||||
# Test "list first,last"
|
||||
#
|
||||
|
||||
proc test_list_range {} {
|
||||
global gdb_prompt
|
||||
|
||||
gdb_test "list list0.c:2,list0.c:5" "2\[ \t\]+\r\n3\[ \t\]+main \[)(\]+.*5\[ \t\]+int x;" "list range; filename:line1,filename:line2"
|
||||
|
||||
gdb_test "list 2,5" "2\[ \t\]+\r\n3\[ \t\]+main \[)(\]+.*5\[ \t\]+int x;" "list range; line1,line2"
|
||||
|
||||
# gdb_test "list -1,6" "Line number 0 out of range; .*list0.c has 39 lines." "list range; lower bound negative"
|
||||
|
||||
# gdb_test "list -100,-40" "Line number -60 out of range; .*list0.c has 39 lines." "list range; both bounds negative"
|
||||
|
||||
gdb_test "list 30,43" "30\[ \t\]+foo \[(\]+.*\[)\]+;.*42\[ \t\]+\}" "list range; upper bound past EOF"
|
||||
|
||||
gdb_test "list 43,100" "Line number 43 out of range; .*list0.c has 42 lines." "list range; both bounds past EOF"
|
||||
|
||||
gdb_test "list list0.c:2,list1.c:17" "Specified start and end are in different files." "list range, must be same files"
|
||||
}
|
||||
|
||||
#
|
||||
# Test "list filename:function"
|
||||
#
|
||||
|
||||
proc test_list_filename_and_function {} {
|
||||
global gdb_prompt
|
||||
|
||||
set testcnt 0
|
||||
|
||||
# gcc appears to generate incorrect debugging information for code
|
||||
# in include files, which breaks this test.
|
||||
# SunPRO cc is the second case below, it's also correct.
|
||||
setup_xfail "a29k-*-udi"
|
||||
send_gdb "list list0.c:main\n"
|
||||
gdb_expect {
|
||||
-re "1\[ \t\]+#include .*8\[ \t\]+breakpoint\[(\]\[)\]+;\r\n$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
|
||||
pass "list function in source file 1"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "list list0.c:main" }
|
||||
timeout { fail "list list0.c:main (timeout)" }
|
||||
}
|
||||
|
||||
# The i960 and a29k-amd-udi are the second case
|
||||
|
||||
# Not sure what the point of having this function be unused is.
|
||||
# AIX is legitimately removing it.
|
||||
setup_xfail "rs6000-*-aix*"
|
||||
send_gdb "list list0.c:unused\n"
|
||||
gdb_expect {
|
||||
-re "36\[ \t\]+\}.*42\[ \t\]+\}\r\n$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re "37.*42\[ \t\]+\}\r\n$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "list list0.c:unused" }
|
||||
timeout { fail "list list0.c:unused (timeout)" }
|
||||
}
|
||||
clear_xfail "rs6000-*-aix*"
|
||||
|
||||
# gcc appears to generate incorrect debugging information for code
|
||||
# in include files, which breaks this test.
|
||||
# Ultrix gdb is the second case, one line different but still correct.
|
||||
# SunPRO cc is the third case.
|
||||
setup_xfail "rs6000-*-*" 1804
|
||||
setup_xfail "powerpc-*-*" 1804
|
||||
setup_xfail "a29k-*-udi"
|
||||
setup_xfail_format "DWARF 1"
|
||||
setup_xfail_format "COFF"
|
||||
send_gdb "list list0.h:foo\n"
|
||||
gdb_expect {
|
||||
-re "2\[ \t\]+including file. This.*11\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re "1\[ \t\]+/. An include file.*10\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re "3\[ \t\]+.*12\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re "No source file named list0.h.\r\n$gdb_prompt $" {
|
||||
fail "list list0.h:foo"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "list list0.h:foo" }
|
||||
timeout { fail "list list0.h:foo (timeout)" }
|
||||
}
|
||||
|
||||
# Ultrix gdb is the second case.
|
||||
# a29k-amd-udi is the third case.
|
||||
send_gdb "list list1.c:bar\n"
|
||||
gdb_expect {
|
||||
-re "1\[ \t\]+void.*8\[ \t\]+\}\r\n$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re "1\[ \t\]+void.*7\[ \t\]*long_line ..;\r\n$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re "1\[ \t\]+void.*9\[ \t\]*\r\n$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "list list1.c:bar" }
|
||||
timeout { fail "list list1.c:bar (timeout)" }
|
||||
}
|
||||
|
||||
# The i960 and a29k-amd-udi are the second case
|
||||
|
||||
# Not sure what the point of having this function be unused is.
|
||||
# AIX is legitimately removing it.
|
||||
setup_xfail "rs6000-*-aix*"
|
||||
send_gdb "list list1.c:unused\n"
|
||||
gdb_expect {
|
||||
-re "7\[ \t\]+long_line \[(\]\[)\];.*14\[ \t\]+\}\r\n.*$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re "9.*14\[ \t\]+\}\r\n.*$gdb_prompt $" {
|
||||
incr testcnt
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "list list1.c:unused" }
|
||||
timeout { fail "list list1.c:unused (timeout)" }
|
||||
}
|
||||
clear_xfail "rs6000-*-aix*"
|
||||
|
||||
pass "list filename:function ($testcnt tests)"
|
||||
|
||||
# Test some invalid specs
|
||||
# The following test takes the FIXME result on most systems using
|
||||
# DWARF. It fails to notice that main() is not in the file requested.
|
||||
|
||||
setup_xfail "*-*-*"
|
||||
|
||||
# Does this actually work ANYWHERE? I believe not, as this is an `aspect' of
|
||||
# lookup_symbol(), where, when it is given a specific symtab which does not
|
||||
# contain the requested symbol, it will subsequently search all of the symtabs
|
||||
# for the requested symbol.
|
||||
|
||||
gdb_test "list list0.c:foo" "Function \"foo\" not defined in .*list0.c" "list filename:function; wrong filename rejected"
|
||||
|
||||
gdb_test "list foobar.c:main" "No source file named foobar.c." "list filename:function; nonexistant file"
|
||||
|
||||
setup_xfail_format "DWARF 1"
|
||||
gdb_test "list list0.h:foobar" "Function \"foobar\" not defined." "list filename:function; nonexistant function"
|
||||
|
||||
}
|
||||
|
||||
proc test_forward_search {} {
|
||||
global timeout
|
||||
|
||||
gdb_test "set listsize 4" ""
|
||||
# On SunOS4, this gives us lines 19-22. On AIX, it gives us
|
||||
# lines 20-23. This depends on whether the line number of a function
|
||||
# is considered to be the openbrace or the first statement--either one
|
||||
# is acceptable.
|
||||
gdb_test "list long_line" "20\[ \t\]+long_line .*"
|
||||
|
||||
gdb_test "search 4321" " not found"
|
||||
|
||||
gdb_test "search 6789" "24\[ \t\]+oof .6789.;"
|
||||
|
||||
# Test that GDB won't crash if the line being searched is extremely long.
|
||||
|
||||
set oldtimeout $timeout
|
||||
set timeout [expr "$timeout + 300"]
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
gdb_test "search 1234" ".*1234.*" "search extremely long line (> 5000 chars)"
|
||||
set timeout $oldtimeout
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
}
|
||||
|
||||
# Start with a fresh gdb.
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
if [target_info exists gdb_stub] {
|
||||
gdb_step_for_stub;
|
||||
}
|
||||
|
||||
gdb_test "set width 0" "" "set width 0"
|
||||
|
||||
test_listsize
|
||||
get_debug_format
|
||||
if [ set_listsize 10 ] then {
|
||||
test_list_include_file
|
||||
test_list_filename_and_number
|
||||
test_list_function
|
||||
test_list_forward
|
||||
test_list_backwards
|
||||
test_list_range
|
||||
test_list_filename_and_function
|
||||
test_forward_search
|
||||
}
|
||||
42
gdb/testsuite/gdb.base/list0.c
Normal file
42
gdb/testsuite/gdb.base/list0.c
Normal file
@@ -0,0 +1,42 @@
|
||||
#include "list0.h"
|
||||
|
||||
main ()
|
||||
{
|
||||
int x;
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
breakpoint();
|
||||
#endif
|
||||
x = 0;
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
foo (x++);
|
||||
}
|
||||
|
||||
static void
|
||||
unused ()
|
||||
{
|
||||
/* Not used for anything */
|
||||
}
|
||||
36
gdb/testsuite/gdb.base/list0.h
Normal file
36
gdb/testsuite/gdb.base/list0.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/* An include file that actually causes code to be generated in the
|
||||
including file. This is known to cause problems on some systems. */
|
||||
|
||||
static void
|
||||
foo (x)
|
||||
int x;
|
||||
{
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
bar (x++);
|
||||
}
|
||||
33
gdb/testsuite/gdb.base/list1.c
Normal file
33
gdb/testsuite/gdb.base/list1.c
Normal file
File diff suppressed because one or more lines are too long
575
gdb/testsuite/gdb.base/logical.exp
Normal file
575
gdb/testsuite/gdb.base/logical.exp
Normal file
@@ -0,0 +1,575 @@
|
||||
# Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# This file was written by Elena Zannoni (ezannoni@cygnus.com)
|
||||
|
||||
# This file is part of the gdb testsuite
|
||||
|
||||
#
|
||||
# tests for correctenss of logical operators, associativity and precedence
|
||||
# with integer type variables
|
||||
#
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
#
|
||||
# test running programs
|
||||
#
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile "int-type"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
|
||||
#
|
||||
# set it up at a breakpoint so we can play with the variable values
|
||||
#
|
||||
|
||||
if ![runto_main] then {
|
||||
perror "couldn't run to breakpoint"
|
||||
continue
|
||||
}
|
||||
|
||||
#
|
||||
# test expressions with "int" types
|
||||
#
|
||||
|
||||
gdb_test "set variable x=0" "" "set variable x=0"
|
||||
gdb_test "set variable y=0" "" "set variable y=0"
|
||||
gdb_test "set variable z=0" "" "set variable z=0"
|
||||
|
||||
send_gdb "print x\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of x"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x" }
|
||||
timeout { fail "(timeout) print value of x" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print y\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of y" }
|
||||
timeout { fail "(timeout) print value of y" }
|
||||
}
|
||||
|
||||
send_gdb "print z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of z" }
|
||||
timeout { fail "(timeout) print value of z" }
|
||||
}
|
||||
|
||||
|
||||
# truth tables for && , || , !
|
||||
|
||||
send_gdb "print x && y\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of x<y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<y" }
|
||||
timeout { fail "(timeout) print value of x<y" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
send_gdb "print x || y\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of x<=y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<=y" }
|
||||
timeout { fail "(timeout) print value of x<=y" }
|
||||
}
|
||||
|
||||
send_gdb "print !x\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of x>y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x>y" }
|
||||
timeout { fail "(timeout) print value of x>y" }
|
||||
}
|
||||
|
||||
gdb_test "set variable y=1" "" "set variable y=1"
|
||||
|
||||
send_gdb "print x && y\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of x<y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<y" }
|
||||
timeout { fail "(timeout) print value of x<y" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
send_gdb "print x || y\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of x<=y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<=y" }
|
||||
timeout { fail "(timeout) print value of x<=y" }
|
||||
}
|
||||
|
||||
gdb_test "set variable x=1" "" "set variable x=1"
|
||||
|
||||
send_gdb "print x && y\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of x<y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<y" }
|
||||
timeout { fail "(timeout) print value of x<y" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
send_gdb "print x || y\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of x<=y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<=y" }
|
||||
timeout { fail "(timeout) print value of x<=y" }
|
||||
}
|
||||
|
||||
send_gdb "print !x\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of x>y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x>y" }
|
||||
timeout { fail "(timeout) print value of x>y" }
|
||||
}
|
||||
|
||||
gdb_test "set variable y=0" "" "set variable y=0"
|
||||
|
||||
send_gdb "print x && y\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of x<y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<y" }
|
||||
timeout { fail "(timeout) print value of x<y" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
send_gdb "print x || y\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of x<=y"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x<=y" }
|
||||
timeout { fail "(timeout) print value of x<=y" }
|
||||
}
|
||||
|
||||
|
||||
# end truth tables for &&, ||, !
|
||||
|
||||
|
||||
# test associativity of && , || , !
|
||||
|
||||
gdb_test "set variable x=0" "" "set variable x=0"
|
||||
gdb_test "set variable y=0" "" "set variable y=0"
|
||||
gdb_test "set variable z=0" "" "set variable z=0"
|
||||
|
||||
send_gdb "print x && y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of x && y && z (000)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x && y && z (000) " }
|
||||
timeout { fail "(timeout) print value of x && y && z (000) " }
|
||||
}
|
||||
|
||||
send_gdb "print x || y || z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of x || y || z (000)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || y || z (000)" }
|
||||
timeout { fail "(timeout) print value of x || y || z (000) " }
|
||||
}
|
||||
|
||||
send_gdb "print !!x\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of !!x (0)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !!x (0)" }
|
||||
timeout { fail "(timeout) print value of !!x (0) " }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable y=1" "" "set variable y=1"
|
||||
|
||||
send_gdb "print x && y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of x && y && z (010)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x && y && z (010) " }
|
||||
timeout { fail "(timeout) print value of x && y && z (010) " }
|
||||
}
|
||||
|
||||
send_gdb "print x || y || z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of x || y || z (010)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || y || z (010)" }
|
||||
timeout { fail "(timeout) print value of x || y || z (010) " }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable z=1" "" "set variable z=1"
|
||||
|
||||
send_gdb "print x && y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of x && y && z (011)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x && y && z (011) " }
|
||||
timeout { fail "(timeout) print value of x && y && z (011) " }
|
||||
}
|
||||
|
||||
send_gdb "print x || y || z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of x || y || z (011)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || y || z (011)" }
|
||||
timeout { fail "(timeout) print value of x || y || z (011) " }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable x=1" "" "set variable x=1"
|
||||
|
||||
send_gdb "print x && y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of x && y && z (111)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x && y && z (111) " }
|
||||
timeout { fail "(timeout) print value of x && y && z (111) " }
|
||||
}
|
||||
|
||||
send_gdb "print x || y || z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of x || y || z (111)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || y || z (111)" }
|
||||
timeout { fail "(timeout) print value of x || y || z (111) " }
|
||||
}
|
||||
|
||||
send_gdb "print !!x\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of !!x (1)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !!x (1)" }
|
||||
timeout { fail "(timeout) print value of !!x (1) " }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable z=0" "" "set variable z=0"
|
||||
|
||||
send_gdb "print x && y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of x && y && z (110)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x && y && z (110) " }
|
||||
timeout { fail "(timeout) print value of x && y && z (110) " }
|
||||
}
|
||||
|
||||
send_gdb "print x || y || z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of x || y || z (110)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || y || z (110)" }
|
||||
timeout { fail "(timeout) print value of x || y || z (110) " }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
gdb_test "set variable y=0" "" "set variable y=0"
|
||||
|
||||
send_gdb "print x && y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of x && y && z (100)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x && y && z (100) " }
|
||||
timeout { fail "(timeout) print value of x && y && z (100) " }
|
||||
}
|
||||
|
||||
send_gdb "print x || y || z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of x || y || z (100)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || y || z (100)" }
|
||||
timeout { fail "(timeout) print value of x || y || z (100) " }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
gdb_test "set variable z=1" "" "set variable z=1"
|
||||
|
||||
send_gdb "print x && y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of x && y && z (101)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x && y && z (101) " }
|
||||
timeout { fail "(timeout) print value of x && y && z (101) " }
|
||||
}
|
||||
|
||||
send_gdb "print x || y || z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of x || y || z (101)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || y || z (101)" }
|
||||
timeout { fail "(timeout) print value of x || y || z (101) " }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable x=0" "" "set variable x=0"
|
||||
|
||||
send_gdb "print x && y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of x && y && z (001)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x && y && z (001) " }
|
||||
timeout { fail "(timeout) print value of x && y && z (001) " }
|
||||
}
|
||||
|
||||
send_gdb "print x || y || z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of x || y || z (001)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || y || z (001)" }
|
||||
timeout { fail "(timeout) print value of x || y || z (001) " }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
# test precedence of &&, || ,!
|
||||
|
||||
|
||||
send_gdb "print !x && y\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of !x && y (00)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !x && y (00)" }
|
||||
timeout { fail "(timeout) print value of !x && y (00) " }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable x=1" "" "set variable x=1"
|
||||
|
||||
|
||||
send_gdb "print !x && y\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of !x && y (10)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !x && y (10)" }
|
||||
timeout { fail "(timeout) print value of !x && y (10) " }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
gdb_test "set variable y=1" "" "set variable y=1"
|
||||
|
||||
send_gdb "print !x || y\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of !x || y (11)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !x || y (11)" }
|
||||
timeout { fail "(timeout) print value of !x || y (11) " }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable x=0" "" "set variable x=0"
|
||||
|
||||
|
||||
send_gdb "print !x || y\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of !x || y (01)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !x || y (01)" }
|
||||
timeout { fail "(timeout) print value of !x || y (01) " }
|
||||
}
|
||||
|
||||
|
||||
|
||||
gdb_test "set variable x=1" "" "set variable x=1"
|
||||
gdb_test "set variable z=0" "" "set variable z=0"
|
||||
|
||||
send_gdb "print x || y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of x || y && z (110)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || y && z (110)" }
|
||||
timeout { fail "(timeout) print value of x || y && z (110) " }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable y=0" "" "set variable y=0"
|
||||
|
||||
|
||||
send_gdb "print x || y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of x || y && z (100)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || y && z (100)" }
|
||||
timeout { fail "(timeout) print value of x || y && z (100) " }
|
||||
}
|
||||
|
||||
|
||||
|
||||
gdb_test "set variable x=0" "" "set variable x=0"
|
||||
|
||||
send_gdb "print x || !y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
|
||||
gdb_test "set variable x=1" "" "set variable x=1"
|
||||
send_gdb "print x || !y && z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of x || !y && z "
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || !y && z" }
|
||||
timeout { fail "(timeout) print value of x || !y && z " }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x || y && z " }
|
||||
timeout { fail "(timeout) print value of x || y && z " }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
gdb_test "set variable x=1" "" "set variable x=1"
|
||||
gdb_test "set variable y=2" "" "set variable y=2"
|
||||
gdb_test "set variable w=3" "" "set variable w=3"
|
||||
gdb_test "set variable z=3" "" "set variable z=3"
|
||||
|
||||
|
||||
send_gdb "print x > y || w == z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of x > y || w == z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x > y || w == z" }
|
||||
timeout { fail "(timeout) print value of x > y || w == z " }
|
||||
}
|
||||
|
||||
|
||||
gdb_test "set variable x=1" "" "set variable x=1"
|
||||
gdb_test "set variable y=2" "" "set variable y=2"
|
||||
gdb_test "set variable w=1" "" "set variable w=1"
|
||||
gdb_test "set variable z=3" "" "set variable z=3"
|
||||
|
||||
|
||||
send_gdb "print x >= y && w != z\n"
|
||||
gdb_expect {
|
||||
-re ".*0.*$gdb_prompt $" {
|
||||
pass "print value of x >= y || w != z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x >= y || w != z" }
|
||||
timeout { fail "(timeout) print value of x >= y || w != z " }
|
||||
}
|
||||
|
||||
|
||||
|
||||
gdb_test "set variable x=2" "" "set variable x=2"
|
||||
gdb_test "set variable y=2" "" "set variable y=2"
|
||||
gdb_test "set variable w=2" "" "set variable w=2"
|
||||
gdb_test "set variable z=3" "" "set variable z=3"
|
||||
|
||||
|
||||
send_gdb "print ! x > y || w + z\n"
|
||||
gdb_expect {
|
||||
-re ".*1.*$gdb_prompt $" {
|
||||
pass "print value of x > y || w != z"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of x > y || w != z" }
|
||||
timeout { fail "(timeout) print value of x > y || w != z " }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
55
gdb/testsuite/gdb.base/long_long.c
Normal file
55
gdb/testsuite/gdb.base/long_long.c
Normal file
@@ -0,0 +1,55 @@
|
||||
/* Test long long expression; test printing in general.
|
||||
*
|
||||
* /CLO/BUILD_ENV/Exports/cc -g +e -o long_long long_long.c
|
||||
*
|
||||
* or
|
||||
*
|
||||
* cc +e +DA2.0 -g -o long_long long_long.c
|
||||
*/
|
||||
|
||||
long long callee( i )
|
||||
long long i;
|
||||
{
|
||||
register long long result;
|
||||
|
||||
result = 0x12345678;
|
||||
result = result << i;
|
||||
result += 0x9abcdef0;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int known_types()
|
||||
{
|
||||
long long bin = 0, oct = 0, dec = 0, hex = 0;
|
||||
|
||||
/* Known values, filling the full 64 bits.
|
||||
*/
|
||||
bin = 0x123456789abcdefLL; /* 64 bits = 16 hex digits */
|
||||
oct = 01234567123456701234567LL; /* = 21+ octal digits */
|
||||
dec = 12345678901234567890LL; /* = 19+ decimal digits */
|
||||
|
||||
/* Stop here and look!
|
||||
*/
|
||||
hex = bin - dec | oct;
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
||||
register long long x, y;
|
||||
register long long i;
|
||||
|
||||
x = (long long) 0xfedcba9876543210LL;
|
||||
y = x++;
|
||||
x +=y;
|
||||
i = 11;
|
||||
x = callee( i );
|
||||
y += x;
|
||||
|
||||
known_types();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
163
gdb/testsuite/gdb.base/long_long.exp
Normal file
163
gdb/testsuite/gdb.base/long_long.exp
Normal file
@@ -0,0 +1,163 @@
|
||||
# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
|
||||
# long_long.exp Test printing of 64-bit things in 32-bit gdb.
|
||||
# Also test differnet kinds of formats.
|
||||
#
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
set testfile long_long
|
||||
set srcfile ${srcdir}/${subdir}/${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
# What compiler are we using?
|
||||
#
|
||||
if [get_compiler_info ${binfile}] {
|
||||
return -1
|
||||
}
|
||||
|
||||
if {$gcc_compiled == 0} {
|
||||
if [istarget "hppa*-hp-hpux*"] then {
|
||||
### FIXME +e only works with HP's compiler
|
||||
set additional_flags "additional_flags=+e -w"
|
||||
} else {
|
||||
# don't know what the compiler is, hope it supports long long!
|
||||
set additional_flags "additional_flags=-w"
|
||||
}
|
||||
} else {
|
||||
set additional_flags "additional_flags=-w"
|
||||
}
|
||||
|
||||
if { [gdb_compile "${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
# use this to debug:
|
||||
#log_user 1
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
if { ![runto known_types] } then {
|
||||
fail "run to known_types"
|
||||
return
|
||||
}
|
||||
|
||||
gdb_test "n 4" ".*34.*" "get to known place"
|
||||
|
||||
# Check the hack for long long prints.
|
||||
#
|
||||
gdb_test "p/x hex" ".*0x0.*" "default print hex"
|
||||
gdb_test "p/x dec" ".*0xab54a98ceb1f0ad2.*" "default print dec"
|
||||
gdb_test "p/x bin" ".*0x123456789abcdef.*" "default print bin"
|
||||
gdb_test "p/x oct" ".*0xa72ee53977053977.*" "default print oct"
|
||||
|
||||
gdb_test "p/x hex" ".*0x0.*" "hex print"
|
||||
gdb_test "p/u dec" ".*12345678901234567890.*" "decimal print"
|
||||
gdb_test "p/t bin" ".*100100011010001010110011110001001101010111100110111101111.*" "binary print"
|
||||
gdb_test "p/o oct" ".*01234567123456701234567.*" "octal print"
|
||||
|
||||
# Try all the combinations to bump up coverage.
|
||||
#
|
||||
gdb_test "p/d oct" ".*12046818088235383159.*" ""
|
||||
gdb_test "p/u oct" ".*0xa72ee53977053977.*" ""
|
||||
gdb_test "p/o oct" ".*.*" ""
|
||||
gdb_test "p/t oct" ".*1010011100101110111001010011100101110111000001010011100101110111.*" ""
|
||||
gdb_test "p/a oct" ".*That operation is not available.*" ""
|
||||
gdb_test "p/c oct" ".*0xa72ee53977053977.*" ""
|
||||
gdb_test "p/f oct" ".*-5.9822653797615723e-120.*" ""
|
||||
|
||||
gdb_test "p/d *(int *)&oct" ".*-1490098887.*" ""
|
||||
gdb_test "p/u *(int *)&oct" ".*2804868409.*" ""
|
||||
gdb_test "p/o *(int *)&oct" ".*024713562471.*" ""
|
||||
gdb_test "p/t *(int *)&oct" ".*10100111001011101110010100111001.*" ""
|
||||
gdb_test "p/a *(int *)&oct" ".*0xa72ee539.*" ""
|
||||
gdb_test "p/c *(int *)&oct" ".*57 '9'.*" ""
|
||||
gdb_test "p/f *(int *)&oct" ".*-2.42716126e-15.*" ""
|
||||
|
||||
gdb_test "p/d *(short *)&oct" ".*-22738.*" ""
|
||||
gdb_test "p/u *(short *)&oct" ".*42798.*" ""
|
||||
gdb_test "p/o *(short *)&oct" ".*0123456.*" ""
|
||||
gdb_test "p/t *(short *)&oct" ".*1010011100101110.*" ""
|
||||
gdb_test "p/a *(short *)&oct" ".*0xffffa72e.*" ""
|
||||
gdb_test "p/c *(short *)&oct" ".* 46 '.'.*" ""
|
||||
gdb_test "p/a **short *)&oct" ".*0xffffa72e <.*" ""
|
||||
gdb_test "p/f *(short *)&oct" ".*-22738.*" ""
|
||||
|
||||
gdb_test "x/x &oct" ".*0xa72ee539.*" ""
|
||||
gdb_test "x/d &oct" ".*.-1490098887*" ""
|
||||
gdb_test "x/u &oct" ".*2804868409.*" ""
|
||||
gdb_test "x/o &oct" ".*024713562471.*" ""
|
||||
gdb_test "x/t &oct" ".*10100111001011101110010100111001.*" ""
|
||||
gdb_test "x/a &oct" ".*0xa72ee539 <.*" ""
|
||||
gdb_test "x/c &oct" ".*-89 'M-''.*" ""
|
||||
gdb_test "x/f &oct" ".*-5.9822653797615723e-120.*" ""
|
||||
|
||||
gdb_test "x/2x &oct" ".*.*" ""
|
||||
gdb_test "x/2d &oct" ".*.*" ""
|
||||
gdb_test "x/2u &oct" ".*.*" ""
|
||||
gdb_test "x/2o &oct" ".*.*" ""
|
||||
gdb_test "x/2t &oct" ".*.*" ""
|
||||
gdb_test "x/2a &oct" ".*.*" ""
|
||||
gdb_test "x/2c &oct" ".*.*" ""
|
||||
gdb_test "x/2f &oct" ".*.*" ""
|
||||
|
||||
gdb_test "x/2bx &oct" ".*.*" ""
|
||||
gdb_test "x/2bd &oct" ".*.*" ""
|
||||
gdb_test "x/2bu &oct" ".*.*" ""
|
||||
gdb_test "x/2bo &oct" ".*.*" ""
|
||||
gdb_test "x/2bt &oct" ".*.*" ""
|
||||
gdb_test "x/2ba &oct" ".*.*" ""
|
||||
gdb_test "x/2bc &oct" ".*.*" ""
|
||||
gdb_test "x/2bf &oct" ".*.*" ""
|
||||
|
||||
gdb_test "x/2hx &oct" ".*.*" ""
|
||||
gdb_test "x/2hd &oct" ".*.*" ""
|
||||
gdb_test "x/2hu &oct" ".*.*" ""
|
||||
gdb_test "x/2ho &oct" ".*.*" ""
|
||||
gdb_test "x/2ht &oct" ".*.*" ""
|
||||
gdb_test "x/2ha &oct" ".*.*" ""
|
||||
gdb_test "x/2hc &oct" ".*.*" ""
|
||||
gdb_test "x/2hf &oct" ".*.*" ""
|
||||
|
||||
gdb_test "x/2wx &oct" ".*.*" ""
|
||||
gdb_test "x/2wd &oct" ".*.*" ""
|
||||
gdb_test "x/2wu &oct" ".*.*" ""
|
||||
gdb_test "x/2wo &oct" ".*.*" ""
|
||||
gdb_test "x/2wt &oct" ".*.*" ""
|
||||
gdb_test "x/2wa &oct" ".*.*" ""
|
||||
gdb_test "x/2wc &oct" ".*.*" ""
|
||||
gdb_test "x/2wf &oct" ".*.*" ""
|
||||
|
||||
gdb_test "x/2gx &oct" ".*.*" ""
|
||||
gdb_test "x/2gd &oct" ".*.*" ""
|
||||
gdb_test "x/2gu &oct" ".*.*" ""
|
||||
gdb_test "x/2go &oct" ".*.*" ""
|
||||
gdb_test "x/2gt &oct" ".*.*" ""
|
||||
gdb_test "x/2ga &oct" ".*.*" ""
|
||||
gdb_test "x/2gc &oct" ".*.*" ""
|
||||
gdb_test "x/2gf &oct" ".*.*" ""
|
||||
|
||||
gdb_exit
|
||||
return 0
|
||||
160
gdb/testsuite/gdb.base/m32r.ld
Normal file
160
gdb/testsuite/gdb.base/m32r.ld
Normal file
@@ -0,0 +1,160 @@
|
||||
OUTPUT_FORMAT("elf32-m32r", "elf32-m32r",
|
||||
"elf32-m32r")
|
||||
OUTPUT_ARCH(m32r)
|
||||
ENTRY(_start)
|
||||
SEARCH_DIR(/usr/cygnus/m32r-961018/H-sparc-sun-sunos4.1//lib);
|
||||
/* Do we need any of these for elf?
|
||||
__DYNAMIC = 0; */
|
||||
SECTIONS
|
||||
{
|
||||
OVERLAY 0x300000 : AT (0x400000)
|
||||
{
|
||||
.ovly0 { foo.o(.text) }
|
||||
.ovly1 { bar.o(.text) }
|
||||
}
|
||||
OVERLAY 0x380000 : AT (0x480000)
|
||||
{
|
||||
.ovly2 { baz.o(.text) }
|
||||
.ovly3 { grbx.o(.text) }
|
||||
}
|
||||
OVERLAY 0x340000 : AT (0x440000)
|
||||
{
|
||||
.data00 { foo.o(.data) }
|
||||
.data01 { bar.o(.data) }
|
||||
}
|
||||
OVERLAY 0x3C0000 : AT (0x4C0000)
|
||||
{
|
||||
.data02 { baz.o(.data) }
|
||||
.data03 { grbx.o(.data) }
|
||||
}
|
||||
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = 0x208000;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.rel.text : { *(.rel.text) }
|
||||
.rela.text : { *(.rela.text) }
|
||||
.rel.data : { *(.rel.data) }
|
||||
.rela.data : { *(.rela.data) }
|
||||
.rel.rodata : { *(.rel.rodata) }
|
||||
.rela.rodata : { *(.rela.rodata) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.init : { *(.rel.init) }
|
||||
.rela.init : { *(.rela.init) }
|
||||
.rel.fini : { *(.rel.fini) }
|
||||
.rela.fini : { *(.rela.fini) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.init : { *(.init) } =0
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
{
|
||||
*(.text)
|
||||
/* .gnu.warning sections are handled specially by elf32.em. */
|
||||
*(.gnu.warning)
|
||||
*(.gnu.linkonce.t*)
|
||||
} =0
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
.fini : { *(.fini) } =0
|
||||
.rodata : { *(.rodata) *(.gnu.linkonce.r*) }
|
||||
.rodata1 : { *(.rodata1) }
|
||||
/* Adjust the address for the data segment. We want to adjust up to
|
||||
the same address within the page on the next page up. */
|
||||
. = ALIGN(32) + (ALIGN(8) & (32 - 1));
|
||||
.data :
|
||||
{
|
||||
*(.data)
|
||||
*(.gnu.linkonce.d*)
|
||||
_ovly_table = .;
|
||||
_ovly0_entry = .;
|
||||
LONG(ABSOLUTE(ADDR(.ovly0)));
|
||||
LONG(SIZEOF(.ovly0));
|
||||
LONG(LOADADDR(.ovly0));
|
||||
LONG(0);
|
||||
_ovly1_entry = .;
|
||||
LONG(ABSOLUTE(ADDR(.ovly1)));
|
||||
LONG(SIZEOF(.ovly1));
|
||||
LONG(LOADADDR(.ovly1));
|
||||
LONG(0);
|
||||
_ovly2_entry = .;
|
||||
LONG(ABSOLUTE(ADDR(.ovly2)));
|
||||
LONG(SIZEOF(.ovly2));
|
||||
LONG(LOADADDR(.ovly2));
|
||||
LONG(0);
|
||||
_ovly3_entry = .;
|
||||
LONG(ABSOLUTE(ADDR(.ovly3)));
|
||||
LONG(SIZEOF(.ovly3));
|
||||
LONG(LOADADDR(.ovly3));
|
||||
LONG(0);
|
||||
_data00_entry = .;
|
||||
LONG(ABSOLUTE(ADDR(.data00)));
|
||||
LONG(SIZEOF(.data00));
|
||||
LONG(LOADADDR(.data00));
|
||||
LONG(0);
|
||||
_data01_entry = .;
|
||||
LONG(ABSOLUTE(ADDR(.data01)));
|
||||
LONG(SIZEOF(.data01));
|
||||
LONG(LOADADDR(.data01));
|
||||
LONG(0);
|
||||
_data02_entry = .;
|
||||
LONG(ABSOLUTE(ADDR(.data02)));
|
||||
LONG(SIZEOF(.data02));
|
||||
LONG(LOADADDR(.data02));
|
||||
LONG(0);
|
||||
_data03_entry = .;
|
||||
LONG(ABSOLUTE(ADDR(.data03)));
|
||||
LONG(SIZEOF(.data03));
|
||||
LONG(LOADADDR(.data03));
|
||||
LONG(0);
|
||||
_novlys = .;
|
||||
LONG((_novlys - _ovly_table) / 16);
|
||||
|
||||
CONSTRUCTORS
|
||||
}
|
||||
.data1 : { *(.data1) }
|
||||
.ctors : { *(.ctors) }
|
||||
.dtors : { *(.dtors) }
|
||||
.got : { *(.got.plt) *(.got)}
|
||||
.dynamic : { *(.dynamic) }
|
||||
/* We want the small data sections together, so single-instruction offsets
|
||||
can access them all, and initialized data all before uninitialized, so
|
||||
we can shorten the on-disk segment size. */
|
||||
.sdata : { *(.sdata) }
|
||||
_edata = .;
|
||||
PROVIDE (edata = .);
|
||||
__bss_start = .;
|
||||
.sbss : { *(.sbss) *(.scommon) }
|
||||
.bss : { *(.dynbss) *(.bss) *(COMMON) }
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
/* Stabs debugging sections. */
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
.stab.excl 0 : { *(.stab.excl) }
|
||||
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||
.stab.index 0 : { *(.stab.index) }
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||
.comment 0 : { *(.comment) }
|
||||
/* DWARF debug sections.
|
||||
Symbols in the .debug DWARF section are relative to the beginning of the
|
||||
section so we begin .debug at 0. It's not clear yet what needs to happen
|
||||
for the others. */
|
||||
.debug 0 : { *(.debug) }
|
||||
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
.debug_sfnames 0 : { *(.debug_sfnames) }
|
||||
.line 0 : { *(.line) }
|
||||
.stack 0x5ffffc : { _stack = .; *(.stack) }
|
||||
/* These must appear regardless of . */
|
||||
}
|
||||
225
gdb/testsuite/gdb.base/m32rovly.c
Normal file
225
gdb/testsuite/gdb.base/m32rovly.c
Normal file
@@ -0,0 +1,225 @@
|
||||
|
||||
/*
|
||||
* Ovlymgr.c -- Runtime Overlay Manager for the GDB testsuite.
|
||||
*/
|
||||
|
||||
#include "ovlymgr.h"
|
||||
|
||||
/* Local functions and data: */
|
||||
|
||||
extern unsigned long _ovly_table[][4];
|
||||
extern unsigned long _novlys __attribute__ ((section (".data")));
|
||||
enum ovly_index { VMA, SIZE, LMA, MAPPED};
|
||||
|
||||
static void ovly_copy (unsigned long dst, unsigned long src, long size);
|
||||
|
||||
/* Flush the data and instruction caches at address START for SIZE bytes.
|
||||
Support for each new port must be added here. */
|
||||
/* FIXME: Might be better to have a standard libgloss function that
|
||||
ports provide that we can then use. Use libgloss instead of newlib
|
||||
since libgloss is the one intended to handle low level system issues.
|
||||
I would suggest something like _flush_cache to avoid the user's namespace
|
||||
but not be completely obscure as other things may need this facility. */
|
||||
|
||||
static void
|
||||
FlushCache (void)
|
||||
{
|
||||
#ifdef __M32R__
|
||||
volatile char *mspr = (char *) 0xfffffff7;
|
||||
*mspr = 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* OverlayLoad:
|
||||
* Copy the overlay into its runtime region,
|
||||
* and mark the overlay as "mapped".
|
||||
*/
|
||||
|
||||
bool
|
||||
OverlayLoad (unsigned long ovlyno)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
if (ovlyno < 0 || ovlyno >= _novlys)
|
||||
exit (-1); /* fail, bad ovly number */
|
||||
|
||||
if (_ovly_table[ovlyno][MAPPED])
|
||||
return TRUE; /* this overlay already mapped -- nothing to do! */
|
||||
|
||||
for (i = 0; i < _novlys; i++)
|
||||
if (i == ovlyno)
|
||||
_ovly_table[i][MAPPED] = 1; /* this one now mapped */
|
||||
else if (_ovly_table[i][VMA] == _ovly_table[ovlyno][VMA])
|
||||
_ovly_table[i][MAPPED] = 0; /* this one now un-mapped */
|
||||
|
||||
ovly_copy (_ovly_table[ovlyno][VMA],
|
||||
_ovly_table[ovlyno][LMA],
|
||||
_ovly_table[ovlyno][SIZE]);
|
||||
|
||||
FlushCache ();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* OverlayUnload:
|
||||
* Copy the overlay back into its "load" region.
|
||||
* Does NOT mark overlay as "unmapped", therefore may be called
|
||||
* more than once for the same mapped overlay.
|
||||
*/
|
||||
|
||||
bool
|
||||
OverlayUnload (unsigned long ovlyno)
|
||||
{
|
||||
if (ovlyno < 0 || ovlyno >= _novlys)
|
||||
exit (-1); /* fail, bad ovly number */
|
||||
|
||||
if (!_ovly_table[ovlyno][MAPPED])
|
||||
exit (-1); /* error, can't copy out a segment that's not "in" */
|
||||
|
||||
ovly_copy (_ovly_table[ovlyno][LMA],
|
||||
_ovly_table[ovlyno][VMA],
|
||||
_ovly_table[ovlyno][SIZE]);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef __D10V__
|
||||
#define IMAP0 (*(short *)(0xff00))
|
||||
#define IMAP1 (*(short *)(0xff02))
|
||||
#define DMAP (*(short *)(0xff04))
|
||||
|
||||
static void
|
||||
D10VTranslate (unsigned long logical,
|
||||
short *dmap,
|
||||
unsigned long **addr)
|
||||
{
|
||||
unsigned long physical;
|
||||
unsigned long seg;
|
||||
unsigned long off;
|
||||
|
||||
/* to access data, we use the following mapping
|
||||
0x00xxxxxx: Logical data address segment (DMAP translated memory)
|
||||
0x01xxxxxx: Logical instruction address segment (IMAP translated memory)
|
||||
0x10xxxxxx: Physical data memory segment (On-chip data memory)
|
||||
0x11xxxxxx: Physical instruction memory segment (On-chip insn memory)
|
||||
0x12xxxxxx: Phisical unified memory segment (Unified memory)
|
||||
*/
|
||||
|
||||
/* Addresses must be correctly aligned */
|
||||
if (logical & (sizeof (**addr) - 1))
|
||||
exit (-1);
|
||||
|
||||
/* If the address is in one of the two logical address spaces, it is
|
||||
first translated into a physical address */
|
||||
seg = (logical >> 24);
|
||||
off = (logical & 0xffffffL);
|
||||
switch (seg)
|
||||
{
|
||||
case 0x00: /* in logical data address segment */
|
||||
if (off <= 0x7fffL)
|
||||
physical = (0x10L << 24) + off;
|
||||
else
|
||||
/* Logical address out side of on-chip segment, not
|
||||
supported */
|
||||
exit (-1);
|
||||
break;
|
||||
case 0x01: /* in logical instruction address segment */
|
||||
{
|
||||
short map;
|
||||
if (off <= 0x1ffffL)
|
||||
map = IMAP0;
|
||||
else if (off <= 0x3ffffL)
|
||||
map = IMAP1;
|
||||
else
|
||||
/* Logical address outside of IMAP[01] segment, not
|
||||
supported */
|
||||
exit (-1);
|
||||
if (map & 0x1000L)
|
||||
{
|
||||
/* Instruction memory */
|
||||
physical = (0x11L << 24) | off;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Unified memory */
|
||||
physical = ((map & 0x7fL) << 17) + (off & 0x1ffffL);
|
||||
if (physical > 0xffffffL)
|
||||
/* Address outside of unified address segment */
|
||||
exit (-1);
|
||||
physical |= (0x12L << 24);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0x10:
|
||||
case 0x11:
|
||||
case 0x12:
|
||||
physical = logical;
|
||||
break;
|
||||
default:
|
||||
exit (-1); /* error */
|
||||
}
|
||||
|
||||
seg = (physical >> 24);
|
||||
off = (physical & 0xffffffL);
|
||||
switch (seg)
|
||||
{
|
||||
case 0x10: /* dst is a 15 bit offset into the on-chip memory */
|
||||
*dmap = 0;
|
||||
*addr = (long *) (0x0000 + ((short)off & 0x7fff));
|
||||
break;
|
||||
case 0x11: /* dst is an 18-bit offset into the on-chip
|
||||
instruction memory */
|
||||
*dmap = 0x1000L | ((off & 0x3ffffL) >> 14);
|
||||
*addr = (long *) (0x8000 + ((short)off & 0x3fff));
|
||||
break;
|
||||
case 0x12: /* dst is a 24-bit offset into unified memory */
|
||||
*dmap = off >> 14;
|
||||
*addr = (long *) (0x8000 + ((short)off & 0x3fff));
|
||||
break;
|
||||
default:
|
||||
exit (-1); /* error */
|
||||
}
|
||||
}
|
||||
#endif /* __D10V__ */
|
||||
|
||||
static void
|
||||
ovly_copy (unsigned long dst, unsigned long src, long size)
|
||||
{
|
||||
#ifdef __M32R__
|
||||
memcpy ((void *) dst, (void *) src, size);
|
||||
return;
|
||||
#endif /* M32R */
|
||||
|
||||
#ifdef __D10V__
|
||||
unsigned long *s, *d, tmp;
|
||||
short dmap_src, dmap_dst;
|
||||
short dmap_save;
|
||||
|
||||
/* all section sizes should by multiples of 4 bytes */
|
||||
dmap_save = DMAP;
|
||||
|
||||
D10VTranslate (src, &dmap_src, &s);
|
||||
D10VTranslate (dst, &dmap_dst, &d);
|
||||
|
||||
while (size > 0)
|
||||
{
|
||||
/* NB: Transfer 4 byte (long) quantites, problems occure
|
||||
when only two bytes are transfered */
|
||||
DMAP = dmap_src;
|
||||
tmp = *s;
|
||||
DMAP = dmap_dst;
|
||||
*d = tmp;
|
||||
d++;
|
||||
s++;
|
||||
size -= sizeof (tmp);
|
||||
src += sizeof (tmp);
|
||||
dst += sizeof (tmp);
|
||||
if ((src & 0x3fff) == 0)
|
||||
D10VTranslate (src, &dmap_src, &s);
|
||||
if ((dst & 0x3fff) == 0)
|
||||
D10VTranslate (dst, &dmap_dst, &d);
|
||||
}
|
||||
DMAP = dmap_save;
|
||||
#endif /* D10V */
|
||||
}
|
||||
|
||||
459
gdb/testsuite/gdb.base/m68k-aout.u
Normal file
459
gdb/testsuite/gdb.base/m68k-aout.u
Normal file
@@ -0,0 +1,459 @@
|
||||
begin 777 m68k-aout
|
||||
M !"P $ ! #$@
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M $Y6__!(USB 2^X !$GM 0F3$J<9ORYTV4"68PCS $ 0O.0 $ 0O"R\5
|
||||
M8?\ %"WOP #"\ 8?\ -.6(],[CB __!.7DYU3E8 $Y>3G4 $@.
|
||||
M $C7 !P & ).7DYU2 X 2-< ' 8 DY>3G5(#@ !(UP
|
||||
M< !@ "3EY.=4@. $C7 !P & ).7DYU2 X 2-< ' 8
|
||||
M DY>3G5(#@ !(UP < !@ "3EY.=4@. $C7 !"@& ).7DYU
|
||||
M2 X 2-< $* 8 DY>3G5(#@ !(UP 0H!@ "3EY.=4@.
|
||||
M $C7 !"@& ).7DYU2 X 2-< $* 8 DY>3G5(#@ !(UP
|
||||
M0H!@ "3EY.=4@. $C7 #R %P/8 DY>3G5(#@ !(UP \@!<
|
||||
M#V ).7DYU2 X 2-< $(Y 0-!/\ $ ! V$_P @ $#@S_ #
|
||||
M 0.C/\ 0 ! \,_P !0 $#YP!B/ 00' '(\ !!$< @CP $$AP
|
||||
M"2/ 03' *(\ !!0< LCP $%0C_$+( !!8(_Q :0 07"/\
|
||||
M $& 3^0 $#0 !!D$_D ! V 09A/Y 0. $&@S^0 $#H
|
||||
M !!L,_D ! \ 0<#/Y 0/@ $'0C^0 $$ !!\(_D !!$ 0A"/Y
|
||||
M 02 $(PC^0 $$P !"4(_D !!0 0G"/Y 05 $*0C^0 $%@
|
||||
M !"L(_D !!< 0M"/Y 08 $+@C_ $#0 !#$(_P ! V 0R"/\
|
||||
M 0. $,PC_ $#H !#0(_P ! \ 0U"/\ 0/@ $-@C_ $$
|
||||
M !#<(_P !!$ 0X"/\ 02 $.0C_ $$P !#H(_P !!0 0["/\
|
||||
M 05 $/ C_ $%@ !#T(_P !!< 0^' "(\ !'4< (CP $=AP
|
||||
M 2/ 1X' !(\ !'<(_D !$\ 11#/Y 1+ $31.7DYU0"@C*61B
|
||||
M>'AX+G,)-2XR("A"97)K96QE>2D@-R\Q,B\X-0 2'D !'H('D !'D3I!8
|
||||
MCTYR"HQ.5@ 8?\ 6+RX "&'_ %%B/3EY.=0 3E8 $Y>3G5.5@
|
||||
M< %.0"/ 3Y'#_3EY.=0
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M ! , $YU ! *",I8W)T,"YC"30N-B H0F5R:V5L97DI(#,O,S O
|
||||
M.#, !
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M ! 0 &0 "P0 )( !4 $V0 !4 &X
|
||||
M /8 3X <H
|
||||
MC( IX Q8 WX
|
||||
M ^( !"8 !'( !*(
|
||||
M !,B $ !/" $ !32 $ !8"
|
||||
M ( !:R ( !?2 ( !D2 0 !
|
||||
MFB 0 !JB 0 !O" 0 !QB 0
|
||||
M !UR 0 !ZB 0 !]2 @ " B $
|
||||
M "'2 $ "-2 $ "62 ( "=2
|
||||
M ( "CB ( "LR 0 "S2 0 "
|
||||
MY" 0 #!R 0 #&" 0 #," 0
|
||||
M #2B 0 #9B @ #A" $ #FB $
|
||||
M #M" $ #TR ( #ZB ( $!2
|
||||
M ( $)2 0 $.B 0 $4R 0 $
|
||||
M<2 0 $A" 0 $GB 0 $NB 0
|
||||
M $T2 @ $ZH !C___L% %@R !@ %D2 !@
|
||||
M &*X C___L% &O" @ &R" @ '6B0
|
||||
M $ !4 $0 'D !> ':20 $ !H $0 'H !R '
|
||||
M?R0 $ !\ $0 'L "& 'ER0 ( "0 $0 'T ":
|
||||
M 'IR0 ( "D $0 'X "N 'OB0 ( "X $0 '\
|
||||
M #" 'UR0 0 #, $0 ($ #6 'Y20 0 #@ $0
|
||||
M (( #J '^B0 0 #T $0 (, #^ ($20 0 $(
|
||||
M $0 (4 $2 (("0 0 $< $0 (8 $F (-B0 0 $P
|
||||
M $0 (< $Z (3B0 0 %$ $0 (D %. (7B0 @
|
||||
M %: $0 (H %D (<( )C___L% (W" )@ (YX
|
||||
M )#___L% ))R ) ),B 0 )5H 3___L% )
|
||||
M?2 0 )C" 0 )JH 3___L% )QB 0
|
||||
M )U( 3___L% )\H 3___L% *#H 3___L% *&X 3_
|
||||
M__L% *2"0 0 %P $0 +( %Z $0 +, %Z $0
|
||||
M +0 %Z $0 +4 %Z $0 +8 & $0 +< &(
|
||||
M $0 +@ &0 $0 +D &0 $0 +H &8 $0 +L &@
|
||||
M $0 +P &H $0 +T &H $0 +X &P $0 +\
|
||||
M &X $0 , ' $0 ,$ ' $0 ,( '( $0
|
||||
M ,, '0 $0 ,0 '8 $0 ,4 '8 $0 ,8 'B
|
||||
M $0 ,< 'V $0 ,@ 'V $0 ,D 'V $0 ,H (
|
||||
M $0 ,L (* $0 ,P (4 $0 ,T (4 $0 ,X
|
||||
M (> $0 ,\ (H $0 - (R $0 -$ (R $0
|
||||
M -( (\ $0 -, )& $0 -0 )0 $0 -4 )0
|
||||
M $0 -8 ): $0 -< )D $0 -@ )N $0 -D )N
|
||||
M $0 -H )X $0 -L *, $0 -P *, $0 -T
|
||||
M *6 $0 -X *@ $0 -\ *J $0 . *J $0
|
||||
M .$ *T $0 .( *^ $0 ., +( $0 .0 +(
|
||||
M $0 .4 +2 $0 .8 +< $0 .< +F $0 .@ +F
|
||||
M $0 .D +P $0 .H +Z $0 .L ,$ $0 .P
|
||||
M ,$ $0 .T ,. $0 .X ,8 $0 .\ ,8 $0
|
||||
M / ,@ $0 /$ ,H $0 /( ,P $0 /, ,X
|
||||
M $0 /0 ,X $0 /4 -" $0 /8 -" $0 /< -,
|
||||
M *4 0 /< -0 *5 0 -0 *7 0 .( *8P0 !N(
|
||||
M .D *:P0 Y8 .L *<P0 !N( .T *? < !7( ! $ *A04
|
||||
M!0X *BP4 WX %P *D04 Z .( *EP4 !BX !* *
|
||||
MHP< )( ! ( *J@D !T8 ! T *L@D !^X ! V *P0D !&8 ! X
|
||||
M *T@D !YH ! Z *VPD $P ! \ *ZPD =H ! ^ *_0D !_
|
||||
M !! +! D "$0 !!$ +$@D !H !!( +(@D ![D !!, +*@D
|
||||
M"&$ !!0 +.0D !-D !!4 +2@D !L@ !!8 +4PD !6L !!< +
|
||||
M70D !W, !!D +:PD !ET !!F +@ D !&D !!H +EPD ID !!L
|
||||
M +I@D &T !!P +O D !2, !!T +U D !MT !!\ +X0D @,
|
||||
M !"$ +]0D 0D !", ,"PD ;L !"4 ,&0D *4 !"< ,+@D
|
||||
M!T\ !"D ,10D <T !"L ,5 D +D !"T ,9 D "%( !#$ ,
|
||||
M= D _H !#( ,BPD !,@ !#, ,I D !B8 !#0 ,M0D !A0 !#4
|
||||
M ,S0D !ZP !#8 ,YPD !?H !#< ,]@D \X !#@ -# D "(0
|
||||
M !#D -) D JX !#H -- D !O0 !#L -2PD !\( !#P -9 D
|
||||
M O8 !#T -=0D !T0 !#X -APD !RL !#\ -D@D !RP !$4 -
|
||||
MG0D !\8 !$L -I@D !R !$T -L 4 ZL !4 -O04 !V\ !H
|
||||
M -T04 !G4 !\ -YP4 !8T "0 -]04 !'< "D ."@4 H,
|
||||
M "X .(04 !Z\ #, .+04 /, #@ .0 4 !,4 #T .504
|
||||
M ,\ $( .8@4 !), $< .=@4 YD $P .C 4 !2< %$ .
|
||||
MF@4 !)T %: .J0D !T4 !$\ .L0D !X4 !%$ .N0D !\\ !'4
|
||||
M .P@D G< !'8 .S@D !)X !'< .UPD O@ !'@ .X@D 2<
|
||||
M !'D .ZP4 :D -T .] 4 ;0 .$ ._0< !,8 ! P /!P4
|
||||
M Y8 .D /$04 !N( .L /& 4 "!P .T /'PD !Y< !/D /
|
||||
M)F-R=# N;P!G9&)M92YO &=D8FUE+F, :6YT.G0Q/7(Q.RTR,30W-#@S-C0X
|
||||
M.S(Q-#<T.#,V-#<[ &-H87(Z=#(]<C([,#LQ,C<[ &QO;F<Z=#,]<C$[+3(Q
|
||||
M-#<T.#,V-#@[,C$T-S0X,S8T-SL <VAO<G0Z=#0]<C$[+3,R-S8X.S,R-S8W
|
||||
M.P!U;G-I9VYE9"!C:&%R.G0U/7(Q.S [,C4U.P!U;G-I9VYE9"!S:&]R=#IT
|
||||
M-CUR,3LP.S8U-3,U.P!U;G-I9VYE9"!L;VYG.G0W/7(Q.S [+3$[ '5N<VEG
|
||||
M;F5D(&EN=#IT.#UR,3LP.RTQ.P!F;&]A=#IT.3UR,3LT.S [ &1O=6)L93IT
|
||||
M,3 ]<C$[.#LP.P!V;VED.G0Q,3TQ,0 _/S\Z=#$R/3$ =E]C:&%R.D<R '9?
|
||||
M<VEG;F5D7V-H87(Z1S( =E]U;G-I9VYE9%]C:&%R.D<U '9?<VAO<G0Z1S0
|
||||
M=E]S:6=N961?<VAO<G0Z1S0 =E]U;G-I9VYE9%]S:&]R=#I'-@!V7VEN=#I'
|
||||
M,0!V7W-I9VYE9%]I;G0Z1S$ =E]U;G-I9VYE9%]I;G0Z1S@ =E]L;VYG.D<Q
|
||||
M '9?<VEG;F5D7VQO;F<Z1S$ =E]U;G-I9VYE9%]L;VYG.D<X '9?9FQO870Z
|
||||
M1SD =E]D;W5B;&4Z1S$P '9?8VAA<E]A<G)A>3I',3,]87(Q.S [,3LR '9?
|
||||
M<VEG;F5D7V-H87)?87)R87DZ1S$S '9?=6YS:6=N961?8VAA<E]A<G)A>3I'
|
||||
M,30]87(Q.S [,3LU '9?<VAO<G1?87)R87DZ1S$U/6%R,3LP.S$[- !V7W-I
|
||||
M9VYE9%]S:&]R=%]A<G)A>3I',34 =E]U;G-I9VYE9%]S:&]R=%]A<G)A>3I'
|
||||
M,38]87(Q.S [,3LV '9?:6YT7V%R<F%Y.D<Q-SUA<C$[,#LQ.S$ =E]S:6=N
|
||||
M961?:6YT7V%R<F%Y.D<Q-P!V7W5N<VEG;F5D7VEN=%]A<G)A>3I',3@]87(Q
|
||||
M.S [,3LX '9?;&]N9U]A<G)A>3I',3< =E]S:6=N961?;&]N9U]A<G)A>3I'
|
||||
M,3< =E]U;G-I9VYE9%]L;VYG7V%R<F%Y.D<Q. !V7V9L;V%T7V%R<F%Y.D<Q
|
||||
M.3UA<C$[,#LQ.SD =E]D;W5B;&5?87)R87DZ1S(P/6%R,3LP.S$[,3 =E]C
|
||||
M:&%R7W!O:6YT97(Z1S(Q/2HR '9?<VEG;F5D7V-H87)?<&]I;G1E<CI',C$
|
||||
M=E]U;G-I9VYE9%]C:&%R7W!O:6YT97(Z1S(R/2HU '9?<VAO<G1?<&]I;G1E
|
||||
M<CI',C,]*C0 =E]S:6=N961?<VAO<G1?<&]I;G1E<CI',C, =E]U;G-I9VYE
|
||||
M9%]S:&]R=%]P;VEN=&5R.D<R-#TJ-@!V7VEN=%]P;VEN=&5R.D<R-3TJ,0!V
|
||||
M7W-I9VYE9%]I;G1?<&]I;G1E<CI',C4 =E]U;G-I9VYE9%]I;G1?<&]I;G1E
|
||||
M<CI',C8]*C@ =E]L;VYG7W!O:6YT97(Z1S(U '9?<VEG;F5D7VQO;F=?<&]I
|
||||
M;G1E<CI',C4 =E]U;G-I9VYE9%]L;VYG7W!O:6YT97(Z1S(V '9?9FQO871?
|
||||
M<&]I;G1E<CI',C<]*CD =E]D;W5B;&5?<&]I;G1E<CI',C@]*C$P '1?<W1R
|
||||
M=6-T.E0R.3US,C1V7V-H87)?;65M8F5R.C(L,"PX.W9?<VAO<G1?;65M8F5R
|
||||
M.C0L,38L,38[=E]I;G1?;65M8F5R.C$L,S(L,S([=E]L;VYG7VUE;6)E<CHQ
|
||||
M+#8T+#,R.W9?9FQO871?;65M8F5R.CDL.38L,S([=E]D;W5B;&5?;65M8F5R
|
||||
M.C$P+#$R."PV-#L[ '9?<W1R=6-T,3I',CD =E]S=')U8W0R.D<S,#US,C1V
|
||||
M7V-H87)?;65M8F5R.C(L,"PX.W9?<VAO<G1?;65M8F5R.C0L,38L,38[=E]I
|
||||
M;G1?;65M8F5R.C$L,S(L,S([=E]L;VYG7VUE;6)E<CHQ+#8T+#,R.W9?9FQO
|
||||
M871?;65M8F5R.CDL.38L,S([=E]D;W5B;&5?;65M8F5R.C$P+#$R."PV-#L[
|
||||
M '1?=6YI;VXZ5#,Q/74X=E]C:&%R7VUE;6)E<CHR+# L.#MV7W-H;W)T7VUE
|
||||
M;6)E<CHT+# L,38[=E]I;G1?;65M8F5R.C$L,"PS,CMV7VQO;F=?;65M8F5R
|
||||
M.C$L,"PS,CMV7V9L;V%T7VUE;6)E<CHY+# L,S([=E]D;W5B;&5?;65M8F5R
|
||||
M.C$P+# L-C0[.P!V7W5N:6]N.D<S,0!V7W5N:6]N,CI',S(]=3AV7V-H87)?
|
||||
M;65M8F5R.C(L,"PX.W9?<VAO<G1?;65M8F5R.C0L,"PQ-CMV7VEN=%]M96UB
|
||||
M97(Z,2PP+#,R.W9?;&]N9U]M96UB97(Z,2PP+#,R.W9?9FQO871?;65M8F5R
|
||||
M.CDL,"PS,CMV7V1O=6)L95]M96UB97(Z,3 L,"PV-#L[ '9?8VAA<E]F=6YC
|
||||
M.D8R '9?<VEG;F5D7V-H87)?9G5N8SI&,@!V7W5N<VEG;F5D7V-H87)?9G5N
|
||||
M8SI&-0!V7W-H;W)T7V9U;F,Z1C0 =E]S:6=N961?<VAO<G1?9G5N8SI&- !V
|
||||
M7W5N<VEG;F5D7W-H;W)T7V9U;F,Z1C8 =E]I;G1?9G5N8SI&,0!V7W-I9VYE
|
||||
M9%]I;G1?9G5N8SI&,0!V7W5N<VEG;F5D7VEN=%]F=6YC.D8X '9?;&]N9U]F
|
||||
M=6YC.D8Q '9?<VEG;F5D7VQO;F=?9G5N8SI&,0!V7W5N<VEG;F5D7VQO;F=?
|
||||
M9G5N8SI&. !V7V9L;V%T7V9U;F,Z1CD =E]D;W5B;&5?9G5N8SI&,3 ;&EN
|
||||
M:SI4,S,]<S$U,FYE>'0Z,S0]*C,S+# L,S([;&EN:V9U;F,Z,S4]*C,V/68S
|
||||
M-"PS,BPS,CMS='5F9CHS-SUA<C$[,#LP.S,X/6%R,3LP.S$[,SD]87(Q.S [
|
||||
M,CLR.2PV-"PQ,34R.SL <U]L:6YK.D<S- !T=5]L:6YK.E0T,#UU,30T;F5X
|
||||
M=#HS-"PP+#,R.VQI;FMF=6YC.C,U+# L,S([<W1U9F8Z,S<L,"PQ,34R.SL
|
||||
M=5]L:6YK.D<T, !P<FEM87)Y.D<T,3UE<F5D.C L9W)E96XZ,2QB;'5E.C(L
|
||||
M.P!C;VQO<G,Z5#0R/65Y96QL;W<Z,"QP=7)P;&4Z,2QP:6YK.C(L.P!N;VYP
|
||||
M<FEM87)Y.D<T,@!C;'5N:V5R.D<T,SUE8VAE=GDZ,"QF;W)D.C$L.P!C87)S
|
||||
M.E0T-#UE8FUW.C L<&]R<V-H93HQ+#L <W!O<G1S8V%R.D<T- !B;V]L96%N
|
||||
M.G0T-3UE1D%,4T4Z,"Q44E5%.C$L.P!B=F%L<SI4-#8]969A;'-E.C L=')U
|
||||
M93HQ+#L 8F]O;&5A;C(Z=#0V &UI<V]R9&5R960Z5#0W/65T=V\Z,BQO;F4Z
|
||||
M,2QZ97)O.C L=&AR964Z,RP[ &UA:6XZ1C$ +6QG %]S8V-S:60 97AI="YO
|
||||
M &9A:V-U+F\ 7V5X:70N;P!C97)R;W(N;P!?96YV:7)O;@!S=&%R= !?;6%I
|
||||
M;@!?97AI= !?;6]N8V]N=')O; !M8V]U;G0 7W9?8VAA<@!?=E]S:6=N961?
|
||||
M8VAA<@!?=E]U;G-I9VYE9%]C:&%R %]V7W-H;W)T %]V7W-I9VYE9%]S:&]R
|
||||
M= !?=E]U;G-I9VYE9%]S:&]R= !?=E]I;G0 7W9?<VEG;F5D7VEN= !?=E]U
|
||||
M;G-I9VYE9%]I;G0 7W9?;&]N9P!?=E]S:6=N961?;&]N9P!?=E]U;G-I9VYE
|
||||
M9%]L;VYG %]V7V9L;V%T %]V7V1O=6)L90!?=E]C:&%R7V%R<F%Y %]V7W-I
|
||||
M9VYE9%]C:&%R7V%R<F%Y %]V7W5N<VEG;F5D7V-H87)?87)R87D 7W9?<VAO
|
||||
M<G1?87)R87D 7W9?<VEG;F5D7W-H;W)T7V%R<F%Y %]V7W5N<VEG;F5D7W-H
|
||||
M;W)T7V%R<F%Y %]V7VEN=%]A<G)A>0!?=E]S:6=N961?:6YT7V%R<F%Y %]V
|
||||
M7W5N<VEG;F5D7VEN=%]A<G)A>0!?=E]L;VYG7V%R<F%Y %]V7W-I9VYE9%]L
|
||||
M;VYG7V%R<F%Y %]V7W5N<VEG;F5D7VQO;F=?87)R87D 7W9?9FQO871?87)R
|
||||
M87D 7W9?9&]U8FQE7V%R<F%Y %]V7V-H87)?<&]I;G1E<@!?=E]S:6=N961?
|
||||
M8VAA<E]P;VEN=&5R %]V7W5N<VEG;F5D7V-H87)?<&]I;G1E<@!?=E]S:&]R
|
||||
M=%]P;VEN=&5R %]V7W-I9VYE9%]S:&]R=%]P;VEN=&5R %]V7W5N<VEG;F5D
|
||||
M7W-H;W)T7W!O:6YT97( 7W9?:6YT7W!O:6YT97( 7W9?<VEG;F5D7VEN=%]P
|
||||
M;VEN=&5R %]V7W5N<VEG;F5D7VEN=%]P;VEN=&5R %]V7VQO;F=?<&]I;G1E
|
||||
M<@!?=E]S:6=N961?;&]N9U]P;VEN=&5R %]V7W5N<VEG;F5D7VQO;F=?<&]I
|
||||
M;G1E<@!?=E]F;&]A=%]P;VEN=&5R %]V7V1O=6)L95]P;VEN=&5R %]V7W-T
|
||||
M<G5C=#$ 7W9?<W1R=6-T,@!?=E]U;FEO;@!?=E]U;FEO;C( 7W9?8VAA<E]F
|
||||
M=6YC %]V7W-I9VYE9%]C:&%R7V9U;F, 7W9?=6YS:6=N961?8VAA<E]F=6YC
|
||||
M %]V7W-H;W)T7V9U;F, 7W9?<VEG;F5D7W-H;W)T7V9U;F, 7W9?=6YS:6=N
|
||||
M961?<VAO<G1?9G5N8P!?=E]I;G1?9G5N8P!?=E]S:6=N961?:6YT7V9U;F,
|
||||
M7W9?=6YS:6=N961?:6YT7V9U;F, 7W9?;&]N9U]F=6YC %]V7W-I9VYE9%]L
|
||||
M;VYG7V9U;F, 7W9?=6YS:6=N961?;&]N9U]F=6YC %]V7V9L;V%T7V9U;F,
|
||||
M7W9?9&]U8FQE7V9U;F, 7W-?;&EN:P!?=5]L:6YK %]P<FEM87)Y %]N;VYP
|
||||
M<FEM87)Y %]C;'5N:V5R %]S<&]R='-C87( 7U]D8F%R9W, 7U]D8G-U8F,
|
||||
M7U]D8G-U8FX 7U]L9U]F;&%G %]?8VQE86YU< !?7V5X:70 8V5R<F]R %]E
|
||||
M<G)N;P
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
%
|
||||
|
||||
end
|
||||
2208
gdb/testsuite/gdb.base/m68k-aout2.u
Normal file
2208
gdb/testsuite/gdb.base/m68k-aout2.u
Normal file
File diff suppressed because it is too large
Load Diff
298
gdb/testsuite/gdb.base/m68k-elf.u
Normal file
298
gdb/testsuite/gdb.base/m68k-elf.u
Normal file
@@ -0,0 +1,298 @@
|
||||
begin 777 m68k-elf
|
||||
M?T5,1@$" 0 " 0 !@ $> #0 #"0 T "
|
||||
M!0 H !4 $0 8 T@ - "@ H 4 P
|
||||
M -0 !, ! ! -( #0 )
|
||||
MC "8P % @ $ G @ IP "4 "6 < "
|
||||
M @ ">2 "GD ' !P O=7-R+VQI8B]L:6)C
|
||||
M+G-O+C$ &$ ,
|
||||
M 4 P !P 0
|
||||
M + ! @
|
||||
M
|
||||
M "@
|
||||
M ( )
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M!@ ! "02 "H +!@
|
||||
M$0#_\0 ^ "G$ !!$ H 8@ )P 1 /_Q 'P
|
||||
M !:$@ ": "I4 !$ __$ M 2 ,H
|
||||
M!-@ $$0 " #\ !( !)@ IR 1 /_Q
|
||||
M7X *>0 $0#_\0!?8VQE86YU< !?96YD %]E;G9I<F]N %]E=&5X= !A
|
||||
M=&5X:70 7V5D871A &5X:70 7VQI8E]V97)S:6]N %]?9G!S=&%R= !?1TQ/
|
||||
M0D%,7T]&1E-%5%]404),15\ 7T193D%-24, +W5S<B]L:6(O;&EB8RYS;RXQ
|
||||
M " "G4 %%0 " "G8 !%0 " "G< )%0 " "G@ '
|
||||
M%0 !.=4YQ+SL!< );9.^P%Q EL@ !.^P%Q EJB\\ &#_
|
||||
M____W$[[ 7$ "6:+SP ,8/_____(3OL!<0 )8HO/ !A@_____[1.
|
||||
M^P%Q E>B\\ )&#_____H"\\@ )O$ZY@ $*%A/(#R 0\9_\ .
|
||||
M+P!.N8 !"A83Y_\ #"Z60>X !"]( 1*F&;\(\B "G$+T@ "$ZY@ $
|
||||
M$$ZY@ $4$ZY@ 'K"Z 3KF 1D3G5.<0 !(#O____Q([P 3R-_
|
||||
M 7 $< !@_P 3R-] 7 $3.\ $3EY.=4@._____$CO
|
||||
M!/(W\ !< 1P &#_ !/(WT !< 1,[P 1.7DYU2 [____\
|
||||
M2.\ $\C?P %P !' 8/\ $\C?0 %P !$SO !$Y>3G5(
|
||||
M#O____Q([P 3R-_ 7 $< !@_P 3R-] 7 $3.\ $
|
||||
M3EY.=4@._____$CO !/(W\ !< 1P &#_ !/(WT !< 1,
|
||||
M[P 1.7DYU2 [____\2.\ $\C?P %P !' 8/\ $\C?0 %P
|
||||
M !$SO !$Y>3G5(#O____Q([P 3R-_ 7 $< !@_P 3R
|
||||
M-] 7 $3.\ $3EY.=4@._____$CO !/(W\ !< 1P &#_
|
||||
M !/(WT !< 1,[P 1.7DYU2 [____\2.\ $\C?P %P
|
||||
M!' 8/\ $\C?0 %P !$SO !$Y>3G5(#O____Q([P 3R-_
|
||||
M 7 $< !@_P 3R-] 7 $3.\ $3EY.=4@._____$CO
|
||||
M!/(W\ !< 1P &#_ !/(WT !< 1,[P 1.7DYU2 [____\
|
||||
M2.\ $\C?P %P !' 8/\ $\C?0 %P !$SO !$Y>3G5(
|
||||
M#O____Q([P 3R-_ 7 $\CQ4 8/\ $\C?0 %P
|
||||
M !$SO !$Y>3G5(#O____Q([P 3R-_ 7 $\CQ4
|
||||
M 8/\ $\C?0 %P !$SO !$Y>3G5(#O____Q([P 3R-_
|
||||
M 7 $0CF "MD$_P 8 *N 3_ "@ JI#/\ . "K8,_P !( *L@S
|
||||
M_ %@ J;"/\ !H *G@C_ > "I8(_P (@ J7"/\ "8
|
||||
M*M0C_ J "ID(_P +@ JY"/\0L@ ( *J@C_$!I " "IP(_P
|
||||
M @ J=!/Y@ K9( *T 3^8 *N" "J@$_F "JD@ J8#/Y@ JV(
|
||||
M*N@S^8 *LB "JT,_F "IL@ J["/Y@ J>( *H0C^8 *EB "KX(_F
|
||||
M "I<@ JO"/Y@ JU( *UPC^8 *F2 "JL(_F "KD@ JS"/Y@ JJ(
|
||||
M*TPC^8 *G" "J0(_F "IT@ JE"/\@ K9( *O C_( *N" "M8(_R
|
||||
M "JD@ J]"/\@ JV( *U0C_( *LB "L((_R "IL@ J:"/\@ J>(
|
||||
M*K@C_( *EB "L (_R "I<@ JQ"/\@ JU( *MPC_( *F2 "M((_R
|
||||
M "KD@ J@"/\@ JJ( *T0C_( *G" "L,(_P "@ JC"/\ H
|
||||
M*GPC_ & "P (_P !@ K:"/Y@ K!( *W S^8 +!" "P(\C?0
|
||||
M %P !$SO !$Y>3G5.=4YQ " "GD " 0P
|
||||
M@ $1( !%B 1L 0 &@ ,@ $$ V F\ !( .@
|
||||
M %@ #9 : *D "@ 'L + $ !4 X
|
||||
M*<@ " , !0 ' %X ^
|
||||
M 0 ! #_\0 " #4 , $
|
||||
M@ Z # " ( J0 P P " -D , 0
|
||||
M @ #X # % ( !! P !@ " 04 ,
|
||||
M < @ $> # ( ( ";P P "0 " "G
|
||||
M , H @ IR # + ( *>0 P # " "I8
|
||||
M , T # . P #P
|
||||
M , ! # 1 P $@
|
||||
M , !, # 4 "@ ! #_
|
||||
M\0 !$ 0 __$ 8 $ /_Q )
|
||||
M! #_\0 "P 0 __$ V $ /_Q /8 !-P
|
||||
M R$@ " $F "I8 !!$ T !6@ J7 01 - 98
|
||||
M";P $@ "0 &N "I@ A$ T "!@ 'K A 2 (
|
||||
MAH *F0 $$0 #0 )2 "IH !!$ T "M@ $/ "02
|
||||
M MH +!@ $0#_\0 +N "IL A$ T #,@ %U@ #(2
|
||||
M ( XH *G ($0 #0 .N "IX !!$ T #Q@ $>
|
||||
M 2 ( ^( *GP $$0 #0 0. "G$ !!$ H $,@ J
|
||||
M@ 01 - !)( *H0 ($0 #0 3" "J, !!$ T $X
|
||||
M@ %#@ #(2 ( !2X *I 0$0 #0 5J G !$ __$
|
||||
M %A@ JH (1 - !=8 *J0 !$0 #0 86 "JH !!$
|
||||
M T &-@ JK @1 - !H8 !"@ !:$@ :B "G$
|
||||
M!"$ H &P@ &G@ #(2 ( !O( !P( R$@ " =& "JT
|
||||
M !!$ T 'F@ JN 01 - !]( *E0 $0#_\0 ?N
|
||||
M 5R ,A( @ ((@ JO @1 - "'8 *L0 $$0 #0
|
||||
M C2 8( ,A( @ (_@ JR (1 - "3H !S0 \$@
|
||||
M" EN 1D !( )@@ JS @1 - "=H *M0 $
|
||||
M$0 #0 GV "K8 A$ T *%@ JW 01 - "E( *N
|
||||
M !$0 #0 J* "KD !!$ T *R@ JZ 01 - "P(
|
||||
M*NP $$0 #0 M> 38 !!$ @ +D@ $U 2 ( "
|
||||
M[( *O $$0 #0 ON "KT !!$ T ,3@ J^ @1 -
|
||||
M #)H !% $@ S" "L !!$ T -%@ K! 01
|
||||
M - #3( *<@ $0#_\0 V* "L( !!$ T -Y@ K#
|
||||
M 01 - #BH *< $$0 "@ YR "L0 &!$ T .F@ K
|
||||
M* !@1 - #L( *T "$0 #0 [V "M$ !!$ T /-
|
||||
M@ K2 01 - #XX !W \$@ " _& 8Z ,A( @
|
||||
M 0#@ IY 1 /_Q $#( *TP ($0 #0 !!J "M4 !!$
|
||||
M T 0J@ &T #(2 ( $/8 *U@ $$0 #0 !%. "M<
|
||||
M"!$ T 1@@ $$ 2 & $9H *V0 !$0 #0 !&V "MH
|
||||
M !!$ T 1U@ %0 #(2 ( $BH *W "0$0 #0 !)&
|
||||
M 6D ,A( @ 2E@ L 01 - $KX + @ ($0 #0
|
||||
M!+B 9L ,A( @ 3,@ L$ @1 - &TV.&LN96QF &-R=#$N
|
||||
M<P!C<G1I+G, =F%L=65S+5AT+F, 9V1B;64N8P!S:%]D871A+F, 8W)T;BYS
|
||||
M '9?8VAA<E]F=6YC '9?<VEG;F5D7VEN= !V7W5N<VEG;F5D7VEN= !?9FEN
|
||||
M:0!V7W5N<VEG;F5D7V-H87)?87)R87D ;6%I;@!V7W-I9VYE9%]L;VYG '9?
|
||||
M=6YS:6=N961?<VAO<G1?<&]I;G1E<@!?8VQE86YU< !?96YD '9?=6YS:6=N
|
||||
M961?<VAO<G0 =E]U;G-I9VYE9%]S:&]R=%]F=6YC '9?9&]U8FQE '9?:6YT
|
||||
M %]S=&%R= !N;VYP<FEM87)Y %]E;G9I<F]N '9?=6YS:6=N961?;&]N9U]P
|
||||
M;VEN=&5R '9?:6YT7V%R<F%Y '!R:6UA<GD =E]S:6=N961?8VAA<E]F=6YC
|
||||
M '9?9&]U8FQE7V%R<F%Y %]E=&5X= !V7W-I9VYE9%]C:&%R7V%R<F%Y '9?
|
||||
M=6YS:6=N961?8VAA<@!V7V9L;V%T '9?<VEG;F5D7VQO;F=?87)R87D 871E
|
||||
M>&ET &5N=FER;VX =E]L;VYG7V9U;F, =E]U;G-I9VYE9%]L;VYG7V9U;F,
|
||||
M=E]S:6=N961?<VAO<G1?87)R87D =E]I;G1?<&]I;G1E<@!?961A=&$ =E]S
|
||||
M:&]R=%]F=6YC '9?=6YS:6=N961?:6YT7V%R<F%Y '9?=6YS:6=N961?:6YT
|
||||
M7W!O:6YT97( =E]I;G1?9G5N8P!V7W-I9VYE9%]S:&]R= !V7V9L;V%T7V9U
|
||||
M;F, 97AI= !V7W5N<VEG;F5D7VQO;F=?87)R87D =E]L;VYG '9?<VAO<G0
|
||||
M=E]L;VYG7W!O:6YT97( =E]S:6=N961?8VAA<@!V7W5N<VEG;F5D7VQO;F<
|
||||
M=E]S:&]R=%]A<G)A>0!V7W5N<VEG;F5D7W-H;W)T7V%R<F%Y %]L:6)?=F5R
|
||||
M<VEO;@!?;6-O=6YT '9?8VAA<E]P;VEN=&5R '9?=6YS:6=N961?8VAA<E]P
|
||||
M;VEN=&5R '9?<VEG;F5D7VEN=%]A<G)A>0!?7V9P<W1A<G0 =E]S:6=N961?
|
||||
M:6YT7W!O:6YT97( <U]L:6YK %]'3$]"04Q?3T9&4T547U1!0DQ%7P!V7W-I
|
||||
M9VYE9%]S:&]R=%]P;VEN=&5R '9?9&]U8FQE7W!O:6YT97( 7U]L;VYG9&]U
|
||||
M8FQE7W5S960 =E]S=')U8W0Q '9?<W1R=6-T,@!V7V-H87)?87)R87D =E]F
|
||||
M;&]A=%]P;VEN=&5R '9?<VEG;F5D7VQO;F=?<&]I;G1E<@!V7V1O=6)L95]F
|
||||
M=6YC '9?<VEG;F5D7VEN=%]F=6YC %]$64Y!34E# '9?9FQO871?87)R87D
|
||||
M=E]S:&]R=%]P;VEN=&5R '9?<VEG;F5D7VQO;F=?9G5N8P!V7W-I9VYE9%]C
|
||||
M:&%R7W!O:6YT97( =E]L;VYG7V%R<F%Y %]I;FET '9?8VAA<@!C;'5N:V5R
|
||||
M '9?=6YS:6=N961?8VAA<E]F=6YC '5?;&EN:P!V7W-I9VYE9%]S:&]R=%]F
|
||||
M=6YC '-P;W)T<V-A<@!V7W5N:6]N,@!V7W5N<VEG;F5D7VEN=%]F=6YC '9?
|
||||
M=6YI;VX "YI;G1E<G +FAA<V@ +F1Y;G-Y;0 N9'EN<W1R "YR96QA+G!L
|
||||
M= N:6YI= N<&QT "YT97AT "YF:6YI "YD871A "YG;W0 +F1Y;F%M:6,
|
||||
M+F)S<P N<WEM=&%B "YS=')T86( +G!E<V5L "YS:'-T<G1A8@ N8V]M;65N
|
||||
M= N9&5B=6< +FQI;F4 0"@C*6QI8F,M;3,R.FTT+F1E9@DQ+C0 0"@C*6QI
|
||||
M8F,M;3,R.F-S=2]C<G0Q+G,),2XQ. ! *",I;&EB8RUM,S(Z;30N9&5F
|
||||
M"3$N- ! *",I;&EB8RUM,S(Z8W-U+V-R=&DN<PDQ+C, 87,Z("A#1%,I(#4N
|
||||
M," Q+S(O.3 0"@C*6QI8F,M;3,R.FTT+F1E9@DQ+C0 0"@C*6QI8F,M
|
||||
M;3,R.F-S=2]C<G1N+G,),2XV "!L9" Z("A#1%,I(#4N," Q+S(O.3
|
||||
M "X $0 2 6< X9V1B;64N8P !-@ $!$8 !-P!(8 ";P!!@
|
||||
M = !, $@ 4X .'1?<W1R=6-T "V & "H #0 2 =0 X=E]C
|
||||
M:&%R7VUE;6)E<@ 50 ! ", !@0 !P "L #0 2 H X=E]S:&]R
|
||||
M=%]M96UB97( %4 ! C 8$ @< I T $@ ,D .'9?:6YT7VUE
|
||||
M;6)E<@ 50 ' ", !@0 $!P "H #0 2 \P X=E]L;VYG7VUE;6)E
|
||||
M<@ 50 * ", !@0 (!P "L #0 2 !'@ X=E]F;&]A=%]M96UB97(
|
||||
M %4 #@ C 8$ # < L T $@ 4H .'9?9&]U8FQE7VUE;6)E<@
|
||||
M50 / ", !@0 0!P 0 ; !, $@ FP .'XP9F%K90 M@ !@
|
||||
M J T $@ 9, .'9?8VAA<E]M96UB97( %4 0 C 8$ < K
|
||||
M T $@ ;X .'9?<VAO<G1?;65M8F5R !5 0 (P &! (' *0 -
|
||||
M !( 'G #AV7VEN=%]M96UB97( %4 !P C 8$ ! < J T $@
|
||||
M A$ .'9?;&]N9U]M96UB97( %4 "@ C 8$ " < K T $@ CP
|
||||
M.'9?9FQO871?;65M8F5R !5 X (P &! P' + - !( )H #AV
|
||||
M7V1O=6)L95]M96UB97( %4 #P C 8$ $ < $ ' 7 !( .+
|
||||
M #AT7W5N:6]N "V " "H #0 2 "L@ X=E]C:&%R7VUE;6)E<@
|
||||
M50 ! ", !@0 !P "L #0 2 "W0 X=E]S:&]R=%]M96UB97( %4
|
||||
M! C 8$ < I T $@ P8 .'9?:6YT7VUE;6)E<@ 50 ' ",
|
||||
M!@0 !P "H #0 2 #, X=E]L;VYG7VUE;6)E<@ 50 * ", !@0
|
||||
M !P "L #0 2 #6P X=E]F;&]A=%]M96UB97( %4 #@ C 8$
|
||||
M < L T $@ X< .'9?9&]U8FQE7VUE;6)E<@ 50 / ", !@0
|
||||
M!P 0 ; !< $@ !*D .'XQ9F%K90 M@ @ J T $@ ]
|
||||
M.'9?8VAA<E]M96UB97( %4 0 C 8$ < K T $@ _L .'9?
|
||||
M<VAO<G1?;65M8F5R !5 0 (P &! ' *0 - !( 0D #AV7VEN
|
||||
M=%]M96UB97( %4 !P C 8$ < J T $@ !$X .'9?;&]N9U]M
|
||||
M96UB97( %4 "@ C 8$ < K T $@ !'D .'9?9FQO871?;65M
|
||||
M8F5R !5 X (P &! ' + - !( 2E #AV7V1O=6)L95]M96UB
|
||||
M97( %4 #P C 8$ < $ *@ & !( 37 #AV7V-H87)?9G5N
|
||||
M8P 50 ! 1& 3< 2& 4. ! #$ !@ 2 %# X=E]S:6=N961?
|
||||
M8VAA<E]F=6YC !5 (!$8 !0X!(8 !4 $ ,P & !( 5# #AV
|
||||
M7W5N<VEG;F5D7V-H87)?9G5N8P 50 # 1& 5 2& 5R ! "L
|
||||
M!@ 2 %<@ X=E]S:&]R=%]F=6YC !5 0!$8 !7(!(8 !:0 $
|
||||
M,@ & !( 6H #AV7W-I9VYE9%]S:&]R=%]F=6YC !5 4!$8 !:0!(8
|
||||
M!=8 $ - & !( 7@ #AV7W5N<VEG;F5D7W-H;W)T7V9U;F, %4
|
||||
M!@$1@ %U@$A@ &" 0 I 8 $@ !@T .'9?:6YT7V9U;F, %4
|
||||
M!P$1@ &" $A@ &.@ 0 P 8 $@ !D$ .'9?<VEG;F5D7VEN=%]F
|
||||
M=6YC !5 @!$8 !CH!(8 !FP $ ,@ & !( 9W #AV7W5N<VEG
|
||||
M;F5D7VEN=%]F=6YC !5 D!$8 !FP!(8 !IX $ *@ & !( :E
|
||||
M #AV7VQO;F=?9G5N8P 50 * 1& :> 2& ;0 ! #$ !@ 2 &
|
||||
MV@ X=E]S:6=N961?;&]N9U]F=6YC !5 L!$8 !M !(8 !P( $
|
||||
M,P & !( <1 #AV7W5N<VEG;F5D7VQO;F=?9G5N8P 50 , 1& <" 2&
|
||||
M <T ! "L !@ 2 '0 X=E]F;&]A=%]F=6YC !5 X!$8 !S0!
|
||||
M(8 !W $ + & !( =P #AV7V1O=6)L95]F=6YC !5 \!$8
|
||||
M!W !(8 !ZP $ %0 5 !( >N (, !0$ ?J %0 % !( >:
|
||||
M (, !0$ ?J $ % !( >J %4 !P 0 \ $ $@ !^H E0
|
||||
M *, * " ( $ @ @@ <@ "X
|
||||
M 9 !, $@ "'L .&QI;FL +8 "8 )@ - !( @I #AN97AT "#
|
||||
M 4! 'Z@ C 8$ < J T $@ "%, .&QI;FMF=6YC "# 4!
|
||||
M '< C 8$ ! < D T $@ "'< .'-T=69F !R 'K@ C 8$
|
||||
M " < $ %0 5 !( BY (, !0$ ?J %0 % !( BE (,
|
||||
M!0$ ?J $ % !( BU %4 !P 0 \ $ $@ "/4 E0 *,
|
||||
M* " ( $ @ @@ <@ "X <
|
||||
M !< $@ "8D .'1U7VQI;FL +8 "0 )@ - !( DW #AN97AT "#
|
||||
M 4! 'Z@ C 8$ < J T $@ "6$ .&QI;FMF=6YC "# 4!
|
||||
M (>P C 8$ < D T $@ "84 .'-T=69F !R (N0 C 8$
|
||||
M < $ .@ $ !( G' #A^,F9A:V4 +8 $ /, &P )B
|
||||
M;'5E %G<F5E;@ <F5D 0 ^ 0 $@ "@D .&-O;&]R
|
||||
M<P M@ 0 \P ? G!I;FL 7!U<G!L90 >65L;&]W
|
||||
M 0 R 0 $@ "C\ .'XS9F%K90 M@ 0 \P 3 69O<F0
|
||||
M &-H979Y 0 Q 0 $@ "G0 .&-A<G, +8 $ /, % %P
|
||||
M;W)S8VAE !B;7< ! #( ! 2 *J@ X?C1F86ME "V
|
||||
M! #S !, !5%)510 1D%,4T4 ! !P %@ 2 *Q@ X8F]O
|
||||
M;&5A;@ <@ "G0 Q 0 $@ "OL .&)V86QS "V ! #S !, !
|
||||
M=')U90 9F%L<V4 ! !T %@ 2 +& X8F]O;&5A;C( '(
|
||||
M K& 1@ $ !( MB #AM:7-O<F1E<F5D "V ! #S ", #=&AR
|
||||
M964 'IE<F\ 6]N90 "='=O 0 C 8 $@ "XD
|
||||
M.&UA:6X %4 !P$1@ 'K $A@ )O 0 G < $@ "[ .'-P;W)T
|
||||
M<V-A<@ <@ "C\ (P % X + E < $@ "]4 .&-L=6YK97( '(
|
||||
M H) ", !0. "MH * ' !( O] #AN;VYP<FEM87)Y !R )QP C
|
||||
M 4#@ J? "4 !P 2 ,(@ X<')I;6%R>0 <@ "8D (P % X *HP
|
||||
M D < $@ #$8 .'5?;&EN:P <@ "/4 (P % X *W G < $@
|
||||
M#&T .'-?;&EN:P @P % 0 !^H (P % X *P0 F < $@ #), .'9?
|
||||
M=6YI;VXR !R #BP C 4#@ L" "4 !P 2 ,N X=E]U;FEO;@
|
||||
M<@ FP (P % X +! G < $@ #-\ .'9?<W1R=6-T,@ <@ 4X
|
||||
M(P % X *R@ G < $@ #08 .'9?<W1R=6-T,0 <@ "X (P % X
|
||||
M*Q O < $@ #34 .'9?9&]U8FQE7W!O:6YT97( &, P$ #P C 4#
|
||||
M@ K# "X !P 2 -8P X=E]F;&]A=%]P;VEN=&5R !C ,! X (P %
|
||||
M X *T0 V < $@ #9D .'9?=6YS:6=N961?;&]N9U]P;VEN=&5R !C
|
||||
M ,! P (P % X *H T < $@ #<T .'9?<VEG;F5D7VQO;F=?<&]I
|
||||
M;G1E<@ 8P # 0 + ", !0. "M( +0 ' !( WZ #AV7VQO;F=?<&]I
|
||||
M;G1E<@ 8P # 0 * ", !0. "K< -0 ' !( XO #AV7W5N<VEG;F5D
|
||||
M7VEN=%]P;VEN=&5R !C ,! D (P % X *L0 S < $@ #F( .'9?
|
||||
M<VEG;F5D7VEN=%]P;VEN=&5R !C ,! @ (P % X *P L < $@
|
||||
M#HX .'9?:6YT7W!O:6YT97( &, P$ !P C 4#@ JN #< !P 2 .
|
||||
MQ0 X=E]U;G-I9VYE9%]S:&]R=%]P;VEN=&5R !C ,! 8 (P % X *F@
|
||||
M U < $@ #OH .'9?<VEG;F5D7W-H;W)T7W!O:6YT97( &, P$ !0 C
|
||||
M 4#@ K" "X !P 2 /* X=E]S:&]R=%]P;VEN=&5R !C ,! 0
|
||||
M(P % X *U0 V < $@ #UX .'9?=6YS:6=N961?8VAA<E]P;VEN=&5R
|
||||
M !C ,! , (P % X *O0 T < $@ #Y( .'9?<VEG;F5D7V-H87)?
|
||||
M<&]I;G1E<@ 8P # 0 " ", !0. "M8 +0 ' !( ^_ #AV7V-H87)?
|
||||
M<&]I;G1E<@ 8P # 0 ! ", !0. "KP ) ! !( _C )4 "C !
|
||||
M @ 0@ 50 / + ' !( ! / #AV7V1O=6)L95]A<G)A>0
|
||||
M<@ #[\ (P % X *I D $ $@ $#, E0 *, $ " !
|
||||
M" !5 X K < $@ $%X .'9?9FQO871?87)R87D '( ! / ", !0.
|
||||
M "M, ) ! !( !"" )4 "C ! @ 0@ 50 , ,P '
|
||||
M !( !"U #AV7W5N<VEG;F5D7VQO;F=?87)R87D '( !!> ", !0. "K,
|
||||
M ) ! !( !#9 )4 "C ! @ 0@ 50 + ,0 ' !(
|
||||
M !$* #AV7W-I9VYE9%]L;VYG7V%R<F%Y !R 0M0 C 4#@ JK "0
|
||||
M 0 2 1+@"5 HP 0 ( $( %4 "@ "H !P 2 16 X
|
||||
M=E]L;VYG7V%R<F%Y !R 1"@ C 4#@ K7 "0 0 2 1? "5
|
||||
MHP 0 ( $( %4 "0 #( !P 2 1K@ X=E]U;G-I9VYE9%]I
|
||||
M;G1?87)R87D '( !%8 ", !0. "J\ ) ! !( !'2 )4 "C !
|
||||
M @ 0@ 50 ( , ' !( !(" #AV7W-I9VYE9%]I;G1?87)R
|
||||
M87D '( !&N ", !0. "KX ) ! !( !(F )4 "C ! @
|
||||
M 0@ 50 ' *0 ' !( !)/ #AV7VEN=%]A<G)A>0 <@ $@( (P %
|
||||
M X *H0 D $ $@ $G, E0 *, $ " !" !5 8 T
|
||||
M < $@ $J< .'9?=6YS:6=N961?<VAO<G1?87)R87D '( !)/ ", !0.
|
||||
M "KL ) ! !( !++ )4 "C ! @ 0@ 50 % ,@ '
|
||||
M !( !+] #AV7W-I9VYE9%]S:&]R=%]A<G)A>0 <@ $J< (P % X *K0
|
||||
M D $ $@ $R$ E0 *, $ " !" !5 0 K < $@
|
||||
M$TP .'9?<VAO<G1?87)R87D '( !+] ", !0. "KH ) ! !( !-P
|
||||
M )4 "C ! @ 0@ 50 # ,P ' !( !.C #AV7W5N<VEG
|
||||
M;F5D7V-H87)?87)R87D '( !-, ", !0. "I@ ) ! !( !/' )4
|
||||
M "C ! @ 0@ 50 " ,0 ' !( !/X #AV7W-I9VYE9%]C
|
||||
M:&%R7V%R<F%Y !R 3HP C 4#@ JH "0 0 2 4' "5 HP 0
|
||||
M ( $( %4 0 "H !P 2 41@ X=E]C:&%R7V%R<F%Y !R
|
||||
M 3^ C 4#@ K0 "0 !P 2 4:@ X=E]D;W5B;&4 %4 #P C 4#
|
||||
M@ J< ", !P 2 4C0 X=E]F;&]A= 50 . ", !0. "JH *P '
|
||||
M !( !2X #AV7W5N<VEG;F5D7VQO;F< %4 # C 4#@ JY "D !P 2
|
||||
M 4X0 X=E]S:6=N961?;&]N9P 50 + ", !0. "ID (@ ' !( !4#
|
||||
M #AV7VQO;F< %4 "@ C 4#@ JU "H !P 2 5+0 X=E]U;G-I9VYE
|
||||
M9%]I;G0 %4 "0 C 4#@ J7 "@ !P 2 550 X=E]S:6=N961?:6YT
|
||||
M !5 @ (P % X *E@ A < $@ %78 .'9?:6YT !5 < (P % X
|
||||
M*G@ L < $@ %:( .'9?=6YS:6=N961?<VAO<G0 %4 !@ C 4#@ J
|
||||
M; "H !P 2 5S X=E]S:6=N961?<VAO<G0 %4 !0 C 4#@ JR
|
||||
M ", !P 2 5[P X=E]S:&]R= 50 $ ", !0. "K8 *P ' !( !8:
|
||||
M #AV7W5N<VEG;F5D7V-H87( %4 P C 4#@ JI "D !P 2 60P X
|
||||
M=E]S:6=N961?8VAA<@ 50 " ", !0. "K@ (@ ' !( !9E #AV7V-H
|
||||
M87( %4 0 C 4#@ K9 0 ' "DH !-P !Y__\
|
||||
M >O__ ,@ 'O__P &0 !]__\ "6 ?O__ R '__
|
||||
M_P /H "!__\ $L @O__ !7@ (/__P 9 "%__\ '"
|
||||
M AO__ !] (?__P B8 ")__\ )8 BO__ "E ++_
|
||||
M_P M "U__\ +F MO__ "[ +?__P O0 "Y__\ +\
|
||||
M NO__ #! +O__P PP "]__\ ,4 OO__ #'@ +__
|
||||
M_P R@ #!__\ ,R PO__ #/ ,/__P T8 #%__\ -0
|
||||
M QO__ #6@ ,G__P VX #*__\ -X R___ #@@ ,W_
|
||||
M_P XP #.__\ .6 S___ #H -'__P ZH #2__\ .T
|
||||
M T___ #O@ -7__P \@ #6__\ /2 U___ #W -G_
|
||||
M_P ^8 #:__\ /P W/__ $! -W__P ! X #>__\ 08
|
||||
M X/__ $(@ .'__P !"P #B__\ 0V Y/__ $0 .7_
|
||||
M_P !$H #F__\ 14 Z/__ $7@ .G__P !&@ #J__\ 1R
|
||||
M [/__ $? .W__P !(8 #O__\ 20 \/__ $F@ /'_
|
||||
M_P !*0 #R__\ 2N ]/__ $N /;__P !,( #W__\ 3,
|
||||
M /__ $X
|
||||
M $ ! H -0 #4 $P 0
|
||||
M ) !0 * #H Z ;P # 0 $
|
||||
M#P L "@ "I J0 # ! $ $ $ !< #
|
||||
M H V0 -D >P 0 ? ! *
|
||||
M /@ #X # # !P 0 , *0 $ &@ $$
|
||||
M!! $ $ "\ ! !H !!0 04
|
||||
M9 ! !0 T 0 : 1X $> !40
|
||||
M 0 .@ $ &@ )O ";P $
|
||||
M $ $ ! X *< G " !
|
||||
M !& 0 . "G( )R !P 0 $
|
||||
M2P 8 #@ IY ">0 !P ! $ " %0 (
|
||||
M X *E@ I8 !P " !9 @
|
||||
M *6 !P / ' 0 0 80 ,
|
||||
M$5@ 34 ! &D # !8L
|
||||
M ! !P P 6+ )
|
||||
M $ >@ $ %KP #/
|
||||
M $ (, ! !>, 6< !
|
||||
J "* 0 M_ I0 0
|
||||
|
||||
end
|
||||
578
gdb/testsuite/gdb.base/maint.exp
Normal file
578
gdb/testsuite/gdb.base/maint.exp
Normal file
@@ -0,0 +1,578 @@
|
||||
# Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# This file was written by Elena Zannoni (ezannoni@cygnus.com)
|
||||
|
||||
# this file tests maintenance commands and help on those.
|
||||
|
||||
# source file used is break.c
|
||||
|
||||
|
||||
#maintenance check-symtabs -- Check consistency of psymtabs and symtabs
|
||||
#maintenance space -- Set the display of space usage
|
||||
#maintenance time -- Set the display of time usage
|
||||
#maintenance demangle -- Demangle a C++ mangled name
|
||||
#maintenance dump-me -- Get fatal error; make debugger dump its core
|
||||
#maintenance print -- Maintenance command for printing GDB internal state
|
||||
#maintenance info -- Commands for showing internal info about the program being debugged
|
||||
#
|
||||
#maintenance print statistics -- Print statistics about internal gdb state
|
||||
#maintenance print objfiles -- Print dump of current object file definitions
|
||||
#maintenance print psymbols -- Print dump of current partial symbol definitions
|
||||
#maintenance print msymbols -- Print dump of current minimal symbol definitions
|
||||
#maintenance print symbols -- Print dump of current symbol definitions
|
||||
#maintenance print type -- Print a type chain for a given symbol
|
||||
#maintenance print unwind -- Print unwind table entry at given address
|
||||
#
|
||||
#
|
||||
#maintenance info sections -- List the BFD sections of the exec and core files
|
||||
#maintenance info breakpoints -- Status of all breakpoints
|
||||
#
|
||||
|
||||
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
global usestubs
|
||||
|
||||
#
|
||||
# test running programs
|
||||
#
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile "break"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != ""
|
||||
} {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
if ![runto_main] then {
|
||||
perror "tests suppressed"
|
||||
}
|
||||
|
||||
|
||||
# The commands we test here produce many lines of output; disable "press
|
||||
# <return> to continue" prompts.
|
||||
send_gdb "set height 0\n"
|
||||
gdb_expect -re "$gdb_prompt $"
|
||||
|
||||
# use a larger expect input buffer for long help outputs.
|
||||
match_max 6000
|
||||
|
||||
#
|
||||
# this command does not produce any output
|
||||
# unless there is some problem with the symtabs and psymtabs
|
||||
# so that branch will really never be covered in this tests here!!
|
||||
#
|
||||
|
||||
send_gdb "maint check-symtabs\n"
|
||||
gdb_expect {
|
||||
-re "^maint check-symtabs.*$gdb_prompt $"\
|
||||
{ pass "maint check-symtabs" }
|
||||
-re ".*$gdb_prompt $" { fail "maint check-symtabs" }
|
||||
timeout { fail "(timeout) maint check-symtabs" }
|
||||
}
|
||||
|
||||
send_gdb "maint space\n"
|
||||
gdb_expect {
|
||||
-re "\"maintenance space\" takes a numeric argument\\..*$gdb_prompt $"\
|
||||
{ pass "maint space" }
|
||||
-re ".*$gdb_prompt $" { fail "maint space" }
|
||||
timeout { fail "(timeout) maint space" }
|
||||
}
|
||||
|
||||
send_gdb "maint space 1\n"
|
||||
gdb_expect {
|
||||
-re "Space used: $decimal \\(\\+$decimal for this command\\).*$gdb_prompt $"\
|
||||
{ pass "maint space 1" }
|
||||
-re ".*$gdb_prompt $" { fail "maint space 1" }
|
||||
timeout { fail "(timeout) maint space 1" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "maint time\n"
|
||||
gdb_expect {
|
||||
-re "\"maintenance time\" takes a numeric argument\\..*Space used: $decimal \\(\\+$decimal for this command\\).*$gdb_prompt $"\
|
||||
{ pass "maint time" }
|
||||
-re ".*$gdb_prompt $" { fail "maint time" }
|
||||
timeout { fail "(timeout) maint time" }
|
||||
}
|
||||
|
||||
send_gdb "maint time 1\n"
|
||||
gdb_expect {
|
||||
-re "Command execution time: $decimal.*Space used: $decimal \\(\\+$decimal for this command\\).*$gdb_prompt $"\
|
||||
{ pass "maint time 1" }
|
||||
-re ".*$gdb_prompt $" { fail "maint time 1" }
|
||||
timeout { fail "(timeout) maint time 1" }
|
||||
}
|
||||
|
||||
send_gdb "maint time 0\n"
|
||||
gdb_expect {
|
||||
-re "Space used: $decimal \\(\\+$decimal for this command\\).*$gdb_prompt $"\
|
||||
{ pass "maint time 0" }
|
||||
-re ".*$gdb_prompt $" { fail "maint time 0" }
|
||||
timeout { fail "(timeout) maint time 0" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "maint space 0\n"
|
||||
gdb_expect {
|
||||
-re "maint space 0\r\n$gdb_prompt $"\
|
||||
{ pass "maint space 0" }
|
||||
-re ".*$gdb_prompt $" { fail "maint space 0" }
|
||||
timeout { fail "(timeout) maint space 0" }
|
||||
}
|
||||
|
||||
send_gdb "maint demangle\n"
|
||||
gdb_expect {
|
||||
-re "\"maintenance demangle\" takes an argument to demangle\\..*$gdb_prompt $"\
|
||||
{ pass "maint demangle" }
|
||||
-re ".*$gdb_prompt $" { fail "maint demangle" }
|
||||
timeout { fail "(timeout) maint demangle" }
|
||||
}
|
||||
|
||||
send_gdb "maint demangle main\n"
|
||||
gdb_expect {
|
||||
-re "Can't demangle \"main\".*$gdb_prompt $"\
|
||||
{ pass "maint demangle" }
|
||||
-re ".*$gdb_prompt $" { fail "maint demangle" }
|
||||
timeout { fail "(timeout) maint demangle" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "maint print statistics\n"
|
||||
gdb_expect {
|
||||
-re "Statistics for.*break.*Number of \"minimal\" symbols read.*Number of \"partial\" symbols read.*Number of \"types\" defined.*Total memory used for psymbol obstack.*Total memory used for psymbol cache.*Total memory used for symbol obstack.*Total memory used for type obstack.*$gdb_prompt $"\
|
||||
{ pass "maint print statistics" }
|
||||
-re ".*$gdb_prompt $" { fail "maint print statistics" }
|
||||
timeout { fail "(timeout) maint print statistics" }
|
||||
}
|
||||
|
||||
send_gdb "maint print objfiles\n"
|
||||
# To avoid timeouts, we avoid expects with many .* patterns that match
|
||||
# many lines.
|
||||
gdb_expect {
|
||||
-re ".*Object file.*break: Objfile at $hex, bfd at $hex, \[0-9\]* minsyms\[\r\t \]+\n"
|
||||
{ pass "maint print objfiles: header" }
|
||||
-re ".*$gdb_prompt $" { fail "maint print objfiles: header" }
|
||||
timeout { fail "(timeout) maint print objfiles: header" }
|
||||
}
|
||||
gdb_expect {
|
||||
-re ".*Psymtabs:\[\r\t \]+\n" { pass "maint print objfiles: psymtabs" }
|
||||
-re ".*$gdb_prompt $" { fail "maint print objfiles: psymtabs" }
|
||||
timeout { fail "(timeout) maint print objfiles: psymtabs" }
|
||||
}
|
||||
gdb_expect {
|
||||
-re ".*Symtabs:\[\r\t \]+\n" { pass "maint print objfiles: symtabs" }
|
||||
-re ".*$gdb_prompt $" { fail "maint print objfiles: symtabs" }
|
||||
timeout { fail "(timeout) maint print objfiles: symtabs" }
|
||||
}
|
||||
gdb_expect {
|
||||
-re ".*$gdb_prompt $" { pass "maint print objfiles: prompt" }
|
||||
timeout { fail "(timeout) maint print objfiles: prompt" }
|
||||
}
|
||||
|
||||
send_gdb "maint print psymbols\n"
|
||||
gdb_expect {
|
||||
-re "print-psymbols takes an output file name and optional symbol file name.*$gdb_prompt $"\
|
||||
{ pass "maint print psymbols w/o args" }
|
||||
-re ".*$gdb_prompt $" { fail "maint print psymbols w/o args" }
|
||||
timeout { fail "(timeout) maint print psymbols w/o args" }
|
||||
}
|
||||
|
||||
send_gdb "maint print psymbols psymbols_output\n"
|
||||
gdb_expect {
|
||||
-re "^maint print psymbols psymbols_output\r\n$gdb_prompt $"\
|
||||
{
|
||||
send_gdb "shell ls psymbols_output\n"
|
||||
gdb_expect {
|
||||
-re "psymbols_output\r\n$gdb_prompt $"\
|
||||
{
|
||||
# We want this grep to be as specific as possible,
|
||||
# so it's less likely to match symbol file names in
|
||||
# psymbols_output. Yes, this actually happened;
|
||||
# poor expect got tons of output, and timed out
|
||||
# trying to match it. --- Jim Blandy <jimb@cygnus.com>
|
||||
send_gdb "shell grep 'main.*function' psymbols_output\n"
|
||||
gdb_expect {
|
||||
-re ".main., function, $hex.*$gdb_prompt $"\
|
||||
{ pass "maint print psymbols" }
|
||||
-re ".*$gdb_prompt $" { fail "maint print psymbols" }
|
||||
timeout { fail "(timeout) maint print psymbols" }
|
||||
}
|
||||
gdb_test "shell rm -f psymbols_output" ""
|
||||
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "maint print psymbols" }
|
||||
timeout { fail "(timeout) maint print psymbols" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "maint print psymbols" }
|
||||
timeout { fail "(timeout) maint print psymbols" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "maint print msymbols\n"
|
||||
gdb_expect {
|
||||
-re "print-msymbols takes an output file name and optional symbol file name.*$gdb_prompt $"\
|
||||
{ pass "maint print msymbols w/o args" }
|
||||
-re ".*$gdb_prompt $" { fail "maint print msymbols w/o args" }
|
||||
timeout { fail "(timeout) maint print msymbols w/o args" }
|
||||
}
|
||||
|
||||
send_gdb "maint print msymbols msymbols_output\n"
|
||||
gdb_expect {
|
||||
-re "^maint print msymbols msymbols_output\r\n$gdb_prompt $"\
|
||||
{
|
||||
send_gdb "shell ls msymbols_output\n"
|
||||
gdb_expect {
|
||||
-re "msymbols_output\r\n$gdb_prompt $"\
|
||||
{
|
||||
send_gdb "shell grep factorial msymbols_output\n"
|
||||
gdb_expect {
|
||||
-re "\\\[ *$decimal\\\] T\[ \t\]+$hex factorial.*$gdb_prompt $"\
|
||||
{ pass "maint print msymbols" }
|
||||
-re ".*$gdb_prompt $" { fail "maint print msymbols" }
|
||||
timeout { fail "(timeout) maint print msymbols" }
|
||||
}
|
||||
gdb_test "shell rm -f msymbols_output" ""
|
||||
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "maint print msymbols" }
|
||||
timeout { fail "(timeout) maint print msymbols" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "maint print msymbols" }
|
||||
timeout { fail "(timeout) maint print msymbols" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "maint print symbols\n"
|
||||
gdb_expect {
|
||||
-re "Arguments missing: an output file name and an optional symbol file name.*$gdb_prompt $"\
|
||||
{ pass "maint print symbols w/o args" }
|
||||
-re ".*$gdb_prompt $" { fail "maint print symbols w/o args" }
|
||||
timeout { fail "(timeout) maint print symbols w/o args" }
|
||||
}
|
||||
|
||||
send_gdb "maint print symbols symbols_output\n"
|
||||
gdb_expect {
|
||||
-re "^maint print symbols symbols_output\r\n$gdb_prompt $"\
|
||||
{
|
||||
send_gdb "shell ls symbols_output\n"
|
||||
gdb_expect {
|
||||
-re "symbols_output\r\n$gdb_prompt $"\
|
||||
{
|
||||
# See comments for `maint print psymbols'.
|
||||
send_gdb "shell grep 'main.*block' symbols_output\n"
|
||||
gdb_expect {
|
||||
-re "int main\\(int, char \\*\\*, char \\*\\*\\); block.*$gdb_prompt $"\
|
||||
{ pass "maint print symbols" }
|
||||
-re ".*$gdb_prompt $" { fail "maint print symbols" }
|
||||
timeout { fail "(timeout) maint print symbols" }
|
||||
}
|
||||
gdb_test "shell rm -f symbols_output" ""
|
||||
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "maint print symbols" }
|
||||
timeout { fail "(timeout) maint print symbols" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "maint print symbols" }
|
||||
timeout { fail "(timeout) maint print symbols" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "maint print type argc\n"
|
||||
gdb_expect {
|
||||
-re "type node $hex\r\nname .int. \\($hex\\)\r\ncode $hex \\(TYPE_CODE_INT\\)\r\nlength 4\r\nobjfile $hex\r\ntarget_type $hex\r\npointer_type $hex\r\nreference_type $hex\r\nflags $hex\r\nnfields 0 $hex\r\nvptr_basetype $hex\r\nvptr_fieldno -1\r\ntype_specific $hex\r\n$gdb_prompt $"\
|
||||
{ pass "maint print type" }
|
||||
-re ".*$gdb_prompt $" { fail "maint print type" }
|
||||
timeout { fail "(timeout) maint print type" }
|
||||
}
|
||||
|
||||
#send_gdb "maint print unwind &main\n"
|
||||
#gdb_expect {
|
||||
# -re ".*unwind_table_entry \\($hex\\):\r\n\tregion_start = $hex <main>\r\n\tregion_end = $hex <main\\+220>\r\n\tflags = Args_stored Save_RP\r\n\tRegion_description = $hex\r\n\tEntry_FR = $hex\r\n\tEntry_GR = $hex\r\n\tTotal_frame_size = $hex\r\n$gdb_prompt $"\
|
||||
# { pass "maint print unwind" }
|
||||
# -re ".*$gdb_prompt $" { fail "maint print unwind" }
|
||||
# timeout { fail "(timeout) maint print unwind" }
|
||||
# }
|
||||
|
||||
set oldtimeout $timeout
|
||||
set timeout [expr $timeout + 300]
|
||||
|
||||
# It'd be nice to check for every possible section. However, that's
|
||||
# problematic, since the relative ordering wanders from release to
|
||||
# release of the compilers. Instead, we'll just check for two
|
||||
# sections which appear to always come out in the same relative
|
||||
# order. (If that changes, then we should just check for one
|
||||
# section.)
|
||||
#
|
||||
# And by the way: This testpoint will break for PA64, where a.out's
|
||||
# are ELF files.
|
||||
#
|
||||
send_gdb "maint info sections\n"
|
||||
gdb_expect {
|
||||
-re "Exec file:\r\n.*break., file type.*$gdb_prompt $"\
|
||||
{ pass "maint info sections" }
|
||||
-re ".*$gdb_prompt $" { fail "maint info sections" }
|
||||
timeout { fail "(timeout) maint info sections" }
|
||||
}
|
||||
|
||||
send_gdb "maint info breakpoints\n"
|
||||
gdb_expect {
|
||||
-re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex in main at.*break.c:60\r\n\[ \t\]+breakpoint already hit 1 time\r\n.*$gdb_prompt $"\
|
||||
{ pass "maint info breakpoints" }
|
||||
-re ".*$gdb_prompt $" { fail "maint info breakpoints" }
|
||||
timeout { fail "(timeout) maint info breakpoints" }
|
||||
}
|
||||
|
||||
# Try it again, and check for shlib event info. Not supported everywhere.
|
||||
if {! [istarget "hppa*-*-hpux*"]} then {
|
||||
setup_xfail "*-*-*"
|
||||
}
|
||||
send_gdb "maint info breakpoints\n"
|
||||
gdb_expect {
|
||||
-re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex in main at.*break.c:60\r\n\[ \t\]+breakpoint already hit 1 time\r\n-1\[ \t\]+shlib events\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex.*breakpoint already hit.*$gdb_prompt $"\
|
||||
{ pass "maint info breakpoints: shlib events" }
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "maint info breakpoints: shlib events"
|
||||
}
|
||||
timeout {
|
||||
fail "(timeout) maint info breakpoints: shlib events"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
send_gdb "maint print\n"
|
||||
gdb_expect {
|
||||
-re "\"maintenance print\" must be followed by the name of a print command\\.\r\nList.*unambiguous\\..*$gdb_prompt $"\
|
||||
{ pass "maint print w/o args" }
|
||||
-re ".*$gdb_prompt $" { fail "maint print w/o args" }
|
||||
timeout { fail "(timeout) maint print w/o args" }
|
||||
}
|
||||
|
||||
send_gdb "maint info\n"
|
||||
gdb_expect {
|
||||
-re "\"maintenance info\" must be followed by the name of an info command\\.\r\nList.*unambiguous\\..*$gdb_prompt $"\
|
||||
{ pass "maint info w/o args" }
|
||||
-re ".*$gdb_prompt $" { fail "maint info w/o args" }
|
||||
timeout { fail "(timeout) maint info w/o args" }
|
||||
}
|
||||
|
||||
send_gdb "maint\n"
|
||||
gdb_expect {
|
||||
-re "\"maintenance\" must be followed by the name of a maintenance command\\.\r\nList.*unambiguous\\..*$gdb_prompt $"\
|
||||
{ pass "maint w/o args" }
|
||||
-re ".*$gdb_prompt $" { fail "maint w/o args" }
|
||||
timeout { fail "(timeout) maint w/o args" }
|
||||
}
|
||||
|
||||
|
||||
set timeout $oldtimeout
|
||||
|
||||
#============test help on maint commands
|
||||
|
||||
send_gdb "help maint\n"
|
||||
gdb_expect {
|
||||
-re "Commands for use by GDB maintainers\\..*Includes commands to dump specific internal GDB structures in.*a human readable form, to cause GDB to deliberately dump core,.*to test internal functions such as the C.. demangler, etc\\..*List of maintenance subcommands:.*maintenance check-symtabs.*maintenance demangle.*maintenance dump-me.*maintenance info.*maintenance print.*maintenance space.*maintenance time.*Type.*help maintenance.*followed by maintenance subcommand name for full documentation\\..*Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
|
||||
{ pass "help maint" }
|
||||
-re ".*$gdb_prompt $" { fail "help maint" }
|
||||
timeout { fail "(timeout) help maint" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "help maint check-symtabs\n"
|
||||
gdb_expect {
|
||||
-re "Check consistency of psymtabs and symtabs\\..*$gdb_prompt $"\
|
||||
{ pass "help maint check-symtabs" }
|
||||
-re ".*$gdb_prompt $" { fail "help maint check-symtabs" }
|
||||
timeout { fail "(timeout) help maint check-symtabs" }
|
||||
}
|
||||
|
||||
send_gdb "help maint space\n"
|
||||
gdb_expect {
|
||||
-re "Set the display of space usage\\.\r\nIf nonzero, will cause the execution space for each command to be\r\ndisplayed, following the command's output\\..*$gdb_prompt $"\
|
||||
{ pass "help maint space" }
|
||||
-re ".*$gdb_prompt $" { fail "help maint space" }
|
||||
timeout { fail "(timeout) help maint space" }
|
||||
}
|
||||
|
||||
send_gdb "help maint time\n"
|
||||
gdb_expect {
|
||||
-re "Set the display of time usage\\.\r\nIf nonzero, will cause the execution time for each command to be\r\ndisplayed, following the command's output\\..*$gdb_prompt $"\
|
||||
{ pass "help maint time" }
|
||||
-re ".*$gdb_prompt $" { fail "help maint time" }
|
||||
timeout { fail "(timeout) help maint time" }
|
||||
}
|
||||
|
||||
send_gdb "help maint demangle\n"
|
||||
gdb_expect {
|
||||
-re "Demangle a C\\+\\+ mangled name\\.\r\nCall internal GDB demangler routine to demangle a C\\+\\+ link name\r\nand prints the result\\..*$gdb_prompt $"\
|
||||
{ pass "help maint demangle" }
|
||||
-re ".*$gdb_prompt $" { fail "help maint demangle" }
|
||||
timeout { fail "(timeout) help maint demangle" }
|
||||
}
|
||||
|
||||
send_gdb "help maint dump-me\n"
|
||||
gdb_expect {
|
||||
-re "Get fatal error; make debugger dump its core\\.\r\nGDB sets it's handling of SIGQUIT back to SIG_DFL and then sends\r\nitself a SIGQUIT signal\\..*$gdb_prompt $"\
|
||||
{ pass "help maint dump-me" }
|
||||
-re ".*$gdb_prompt $" { fail "help maint dump-me" }
|
||||
timeout { fail "(timeout) help maint dump-me" }
|
||||
}
|
||||
|
||||
send_gdb "help maint print statistics\n"
|
||||
gdb_expect {
|
||||
-re "Print statistics about internal gdb state\\..*$gdb_prompt $"\
|
||||
{ pass "help maint print statistics" }
|
||||
-re ".*$gdb_prompt $" { fail "help maint print statistics" }
|
||||
timeout { fail "(timeout) help maint print statistics" }
|
||||
}
|
||||
|
||||
send_gdb "help maint print objfiles\n"
|
||||
gdb_expect {
|
||||
-re "Print dump of current object file definitions\\..*$gdb_prompt $"\
|
||||
{ pass "help maint print objfiles" }
|
||||
-re ".*$gdb_prompt $" { fail "help maint print objfiles" }
|
||||
timeout { fail "(timeout) help maint print objfiles" }
|
||||
}
|
||||
|
||||
send_gdb "help maint print psymbols\n"
|
||||
gdb_expect {
|
||||
-re "Print dump of current partial symbol definitions\\.\r\nEntries in the partial symbol table are dumped to file OUTFILE\\.\r\nIf a SOURCE file is specified, dump only that file's partial symbols\\..*$gdb_prompt $"\
|
||||
{ pass "help maint print psymbols" }
|
||||
-re ".*$gdb_prompt $" { fail "help maint print psymbols" }
|
||||
timeout { fail "(timeout) help maint print psymbols" }
|
||||
}
|
||||
|
||||
send_gdb "help maint print msymbols\n"
|
||||
gdb_expect {
|
||||
-re "Print dump of current minimal symbol definitions\\.\r\nEntries in the minimal symbol table are dumped to file OUTFILE\\.\r\nIf a SOURCE file is specified, dump only that file's minimal symbols\\..*$gdb_prompt $"\
|
||||
{ pass "help maint print msymbols" }
|
||||
-re ".*$gdb_prompt $" { fail "help maint print msymbols" }
|
||||
timeout { fail "(timeout) help maint print msymbols" }
|
||||
}
|
||||
|
||||
send_gdb "help maint print symbols\n"
|
||||
gdb_expect {
|
||||
-re "Print dump of current symbol definitions\\.\r\nEntries in the full symbol table are dumped to file OUTFILE\\.\r\nIf a SOURCE file is specified, dump only that file's symbols\\..*$gdb_prompt $"\
|
||||
{ pass "help maint print symbols" }
|
||||
-re ".*$gdb_prompt $" { fail "help maint print symbols" }
|
||||
timeout { fail "(timeout) help maint print symbols" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "help maint print type\n"
|
||||
gdb_expect {
|
||||
-re "Print a type chain for a given symbol\\.\r\nFor each node in a type chain, print the raw data for each member of\r\nthe type structure, and the interpretation of the data\\..*$gdb_prompt $"\
|
||||
{ pass "help maint print type" }
|
||||
-re ".*$gdb_prompt $" { fail "help maint print type" }
|
||||
timeout { fail "(timeout) help maint print type" }
|
||||
}
|
||||
|
||||
#send_gdb "help maint print unwind\n"
|
||||
#gdb_expect {
|
||||
# -re "Print unwind table entry at given address\\..*$gdb_prompt $"\
|
||||
# { pass "help maint print unwind" }
|
||||
# -re ".*$gdb_prompt $" { fail "help maint print unwind" }
|
||||
# timeout { fail "(timeout) help maint print unwind" }
|
||||
# }
|
||||
|
||||
send_gdb "help maint info sections\n"
|
||||
gdb_expect {
|
||||
-re "List the BFD sections of the exec and core files\\..*$gdb_prompt $"\
|
||||
{ pass "help maint info sections" }
|
||||
-re ".*$gdb_prompt $" { fail "help maint info sections" }
|
||||
timeout { fail "(timeout) help maint info sections" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "help maint info breakpoints\n"
|
||||
gdb_expect {
|
||||
-re "Status of all breakpoints, or breakpoint number NUMBER.*$gdb_prompt $" { pass "help maint info breakpoints" }
|
||||
-re ".*$gdb_prompt $" { fail "help maint info breakpoints" }
|
||||
timeout { fail "(timeout) help maint info breakpoints" }
|
||||
}
|
||||
|
||||
#send_gdb "help maint info breakpoints\n"
|
||||
#expect {
|
||||
# -re "Status of all breakpoints, or breakpoint number NUMBER\\.\[ \r\n\t\]+The \"Type\" column indicates one of:\[ \r\n\t\]+breakpoint\[ \t\]+- normal breakpoint\[ \r\n\t\]+watchpoint\[ \t\]+- watchpoint\[ \r\n\t\]+longjmp\[ \t\]+- internal breakpoint used to step through longjmp\\(\\)\[ \r\n\t\]+longjmp resume - internal breakpoint at the target of longjmp\\(\\)\[ \r\n\t\]+until\[ \t\]+- internal breakpoint used by the \"until\" command\[ \r\n\t\]+finish\[ \t\]+- internal breakpoint used by the \"finish\" command\[ \r\n\t\]+The \"Disp\" column contains one of \"keep\", \"del\", or \"dis\" to indicate\[ \r\n\t\]+the disposition of the breakpoint after it gets hit\\. \"dis\" means that the\[ \r\n\t\]+breakpoint will be disabled\\. The \"Address\" and \"What\" columns indicate the\[ \r\n\t\]+address and file.line number respectively\\.\[ \r\n\t\]+Convenience variable \".*\" and default examine address for \"x\"\[ \r\n\t\]+are set to the address of the last breakpoint listed\\.\[ \r\n\t\]+Convenience variable \".bpnum\" contains the number of the last\[ \r\n\t\]+breakpoint set\\..*$gdb_prompt $"\
|
||||
# { pass "help maint info breakpoints" }
|
||||
# -re ".*$gdb_prompt $" { fail "help maint info breakpoints" }
|
||||
# timeout { fail "(timeout) help maint info breakpoints" }
|
||||
# }
|
||||
|
||||
send_gdb "help maint info\n"
|
||||
gdb_expect {
|
||||
-re "Commands for showing internal info about the program being debugged.*unambiguous\\..*$gdb_prompt $"\
|
||||
{ pass "help maint info" }
|
||||
-re ".*$gdb_prompt $" { fail "help maint info" }
|
||||
timeout { fail "(timeout) help maint info" }
|
||||
}
|
||||
|
||||
send_gdb "help maint print\n"
|
||||
gdb_expect {
|
||||
-re "Maintenance command for printing GDB internal state\\.\[\r\n\]+List of maintenance print subcommands:\[\r\n\]+maintenance print msymbols -- Print dump of current minimal symbol definitions.*maintenance print objfiles -- Print dump of current object file definitions.*maintenance print psymbols -- Print dump of current partial symbol definitions.*maintenance print statistics -- Print statistics about internal gdb state.*maintenance print symbols -- Print dump of current symbol definitions.*maintenance print type -- Print a type chain for a given symbol.*Type .help maintenance print. followed by maintenance print subcommand name for full documentation\\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
|
||||
{ pass "help maint print" }
|
||||
-re ".*$gdb_prompt $" { fail "help maint print" }
|
||||
timeout { fail "(timeout) help maint print" }
|
||||
}
|
||||
|
||||
send_gdb "help maint\n"
|
||||
gdb_expect {
|
||||
-re "Commands for use by GDB maintainers\\.\[\r\n\]+Includes commands to dump specific internal GDB structures in\[\r\n\]+a human readable form, to cause GDB to deliberately dump core,\[\r\n\]+to test internal functions such as the C\\+\\+ demangler, etc\\..*Type.*help maintenance.*followed by maintenance subcommand name for full documentation\\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
|
||||
{ pass "help maint" }
|
||||
-re ".*$gdb_prompt $" { fail "help maint" }
|
||||
timeout { fail "(timeout) help maint" }
|
||||
}
|
||||
|
||||
#set oldtimeout $timeout
|
||||
#set timeout [expr $timeout + 300]
|
||||
|
||||
send_gdb "maint dump-me\n"
|
||||
gdb_expect {
|
||||
-re "Should GDB dump core.*\\(y or n\\) $"\
|
||||
{ send_gdb "n\n"
|
||||
gdb_expect {
|
||||
-re ".*$gdb_prompt $" { pass "maint dump-me" }
|
||||
timeout { fail "(timeout) maint dump-me" }
|
||||
}
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "maint dump-me" }
|
||||
timeout { fail "(timeout) maint dump-me" }
|
||||
}
|
||||
|
||||
#set timeout $oldtimeout
|
||||
|
||||
|
||||
gdb_exit
|
||||
return 0
|
||||
671
gdb/testsuite/gdb.base/mips-ecoff.u
Normal file
671
gdb/testsuite/gdb.base/mips-ecoff.u
Normal file
@@ -0,0 +1,671 @@
|
||||
begin 777 mips-ecoff
|
||||
M 6 "2G<_%0 # 8 X <!"P(* @ $ )= $ !P ! 0
|
||||
M $ 0 //___X -T $ "*@"YT97AT $ !P !
|
||||
M < !E0 !P " N:6YI= ! &Q 0!L0
|
||||
M( &Q " +F1A=&$ 0 $ "I "
|
||||
M 0"YL:70X $ *D! "I 0 JD
|
||||
M @ N;&ET- ! "J 0 J@ $ *J
|
||||
M 0 +G-D871A 0 JP$ *L & "JP , "
|
||||
M "YS8G-S $ +$! "Q % # ! N8G-S
|
||||
M ! #% 0 Q0 ":\ " <G-R8P
|
||||
M " (^D
|
||||
M \'! !)Z4 !"><BH DI@ $ 00@*^%@90 PC A)[W_Z*^&@#"OH 4 #P
|
||||
M(0P0!L>OA(&0#! !9 ,$ %H @(8^$@9"/A8&4CX: , P0 .L
|
||||
M#! !I ! ("$ - ^ " GO0 ( ^ " @^"$#X (
|
||||
M /@ @ ! A ^ " #X ( /@ @ ! A ^ "
|
||||
M #X ( /@ @ ! A ^ " #X ( /@ @ ! A ^
|
||||
M" #X ( /@ @ ! A ^ " #X ( /@ @ ! A
|
||||
M ^ " #X ( /@ @ ! A ^ " #X ( /@ @
|
||||
M ! A ^ " #X ( /@ @ ! A ^ " #X ( /@
|
||||
M @ ! A ^ " #X ( /@ @ ! A ^ " #X (
|
||||
M /@ @ ! A ^ " #X ( $2 #X ( /@ @
|
||||
M ^ " !$@ 1( ( /@ @ ^ " #X ( *. @) D
|
||||
M#@ !HXZ D20/ *CCX"2)!@ Z>8@)0D&0 $IYF EB0( 6GB("8) D !J^)
|
||||
M@)PD"@ 'KXJ H"0+ BOBX"D) P ":^,@*@D#0 *KXV K"0. NOCH"PQX2
|
||||
M( #GA("TQX> $,>&@!3GAX"XYX: O)./@) HX^ P).8@)$
|
||||
MHYB PI.9@)( HYF Q(>(@)0 IXB R(>)@)8 IXF S)>*@)@
|
||||
M IXJ T(^+@)P KXN V(^,@* KXR X(^-@*0 KXV Z(^.
|
||||
M@*@ KXZ \(^/@*P KX^ ^(^8@+ KYB! ,>(@+0 YXB!
|
||||
M",>+@+C'BH"\/ $0 .0K8_#D*F/T)YF D*^9@1 GB("1KXB!%">)@)*OB8$8
|
||||
M)XJ E*^*@1PGBX"6KXN!(">,@)BOC($D)XV G*^-@2@GCH"@KXZ!+">/@*2O
|
||||
MCX$P)YB J*^8@30GF8"LKYF!.">(@+"OB($\)XF M*^)@4 GBH"XKXJ!1"0+
|
||||
M *OBX%<) P J^,@6 D#0 !KXV!:"0. &OCH%DCX^!6#P!$ "L+V,PAYB!
|
||||
M2 "GF(%0 ^ " $"$#X ( #X (
|
||||
M)[W]4 " &"$D#O__K[\ '!1@ !&OK@ D/ 00 P0 ;0DA ($$$ !0! &"&0
|
||||
M3P !7@ @ DYB 0 3 # ! ", ! A)X. 1#P%
|
||||
M$ "C@(! )*4"$">D C ,$ 'TKZ,"L(^C K GI (^#! !] !@*"$GI (P#! "
|
||||
M( *"$$0 1 $ @(2>E "PD!@("#! "**^D "@D 0("%$$ "(^D "@\!!
|
||||
M)(0 ">E "P,$ (P) 8" J^@ "2/I H#! "] "/H@ D (^_ !PG
|
||||
MO0*P ^ " )[W_X*^_ !P,$ ,.KZ0 ( P0 R@ CZ0 ( P0
|
||||
M!4P C[\ '">] " #X ( ">]_^"/@H PK[$
|
||||
M&*^P !0 @(@AK[\ '!1 , 0( A$ %0 $"&/CH P (W/
|
||||
M$> #P $"&.!0 (@("$,$ '7)A !!! , 0!@A$ !@!@$"&.
|
||||
M!0 !2@__<"(" A 0(8^_ !R/L 4C[$ & /@ @GO0 @D*( )"#
|
||||
M DI0 !$$, !"0& #T0 ,) 8 /20& #T 8! A%$8 R2$ $#X ( * 0
|
||||
M(9"B "0@P )*4 1!#__@ 8! A%& " $"&0KO__ !3. 0 ! A
|
||||
M ^ " "@$"$ ! A ^ " @! A@*@ #2- ,1 D :1P(H"I $
|
||||
MKG@@$2 'P " J@ " !% !J(K @*L YBL ,18 4J(P "&D
|
||||
M__V!Z !(>\ !!$ !,@A $@>G__@ 1( . ('J__\ $4
|
||||
M"8GL__V!ZP F>P !5@__&LC ^ " #X (N(P Z"* *@B0 !
|
||||
M ^ "*"( "0" ^T ,$. P ($ 50 /@ @
|
||||
M ) (#ZP P0X # @0!5 ^ " 0P : ( X(1"D
|
||||
M !@ A0@J%" ""C! ! IA @ (((*A @ 0HP0 0$ 6RC! ! HP0 0%"
|
||||
M!0 PH@ #,(, Q!# L $, !P IA@A@*( "2E $DA !
|
||||
M%*/__*""__\#X ( . 0(1! !@D 0 !$$$ #R0! (000 ' ("B D
|
||||
MI0 !)(0 23&__\0 .H(+__X2B DI0 ")(0 B3&__X0 (I(+__H"B
|
||||
M "$HP !H(( "2E ,DA #),;__:2#__XHP0 @%" %BC! !",H@ C*,
|
||||
M!(RH B,J0 ,C*H $(RK !2,K 8C*T '*R" "L@P $K(@ "*R) RLB@ 0
|
||||
MK(L %*R, !@DI0 @)(0 ("3&_^ 0 /_JK(W__"C! ! 4( .*,$ !(RB ",
|
||||
MHP $C*@ "(RI RL@@ K(, !*R( @DI0 0)(0 $"3&__ 0 /_RK(G__"C!
|
||||
M 04(/^U (RB DI0 $)(0 !"3&__P0 /_XK(+__"C! ! IB@@%"
|
||||
M!0"&(" PH@ #,(, Q!# T $,#_K0 DI?__)(3__P"F&". H@
|
||||
M)*7__R2$__\4H__\H(( 0/@ @ X! A$$ &"0! ,000 /) $ A!! <
|
||||
M @*+__R2E__\DA/__),;__Q Z@@@ A*+__B2E__XDA/_^),;__A
|
||||
M BD@@ @*+__X2C__V@@O__)*7__22$__TDQO_]I(, "C! " 4( 6*,$
|
||||
M$(RB__R,H__XC*C_](RI__",JO_LC*O_Z(RL_^2,K?_@K(+__*R#__BLB/_T
|
||||
MK(G_\*R*_^RLB__HK(S_Y"2E_^ DA/_@),;_X! _^JLC0 *,$ $!0@ XH
|
||||
MP0 $C*+__(RC__B,J/_TC*G_\*R"__RL@__XK(C_]"2E__ DA/_P),;_\!
|
||||
M__*LB0 *,$ !!0@_[, C*+__"2E__PDA/_\),;__! __BL@@
|
||||
M ) (#[@ P0X # @0!5 ^ " $"$0@ /
|
||||
M) ( 8^#@& *&$ (! @ HD @ ! -P@#P!$ +@@A)&, :PD B"O
|
||||
M@X!@ ^ " $"$D @ ! ^ " "/@X!@)[W_X*^_ !ROL0 8K[ %!A@
|
||||
M \D8O__/ \0 "7O B G" /!$0 "8Q B !SX ACA@ # /@)
|
||||
M "80__P"$0@K$"#_^0 "/OP <C[ %(^Q !@#X ()[T ((^.@' GO?_@
|
||||
M/ \0 *^P !@E[P0U/! 0 '/""NOOP <%" $280!#0\&! CQ@+ 3
|
||||
M % P0 W8" " A$ P ,$ -& @ @(8^9@' F$ 0 AD(*Q0@
|
||||
M__$ C[\ '(^P !@#X ()[T (">]_]BOL 8 (" (:^_ !P6 #) /_
|
||||
M_Q "4D O__D@( # P3@"#$< %#!8 @P3P &) $ A7A 8 !@A
|
||||
M#! #=@( ("$0 " $ 8(0 &"&2! -#! "]*^C "2/HP D!$$ @ D
|
||||
M ___D@( # P6 ($P !@ ".! (#! &&J^C "2/HP DK@ "(X9
|
||||
M BB ,K@ !@$"&N&0 $C[\ '(^P !@#X ()[T *">]_^"OL 8 ("
|
||||
M(18 !.OOP <CXZ <#P/$ E[P0U/! 0 '/""L4( *)A $-!( ,
|
||||
M#! #=@( ("&/F(!P)A $ (8""L4(/_X ! #@ ! AD@, # P
|
||||
M8@ "%$ ##!H 2.!0 D@0 #20& $,$ 9P 4H(XX9 BN 0(1
|
||||
M "FN&0 $,&@ !!4 " P;0 @$$ 'C!M "". @ ( !! !HP;0 @C@D
|
||||
M! 20@K$" %3!M " ,$ 14 @ @(9(# P ,&H !!5 XP;0 @
|
||||
M,&L A%@ LP;0 @C@( " 00 ',&T ((X, 0 $P(*Q0@_^X
|
||||
M ,&T (!&@ 0 !@A$ B0#__\ !@A & 0(8^_ !R/L 8 ^ "">]
|
||||
M " GO?^PK[ '*^_ "ROLP H *" (:^R "2OL0 @KZ0 4)(# PD$0!")!(
|
||||
M!B03 (P;@!2%BX )3!L !:2#P -/!D0 /P( #.,@ACSD"H(X" 0
|
||||
M %D(*Q @ $\ CZ@ 4"0! J@2 C@D ! E*@ !K@H !).K %,
|
||||
M $6$ ! "/H@!0$ 8(^_ "P,$ 14 @ @(20!__\400 $CZ, 4!
|
||||
M ,D ___CZ, 4 0 !4 & 0(3!L !863 4,'@ $H^M % GI0!,HZT
|
||||
M3)($ VN #! &>"0& $D 0 !%$$ ! "/H@!0$ 18^_ "R2#@ ,
|
||||
M) +__S7/ " 0 _H@\ ##!X !(6> 0 (X" @ $$ # ".
|
||||
M&0 $ !19 P C@@ 5 ( #!I $05( & 8(0P0
|
||||
M!)H" " A$ @! &"$ !@A$& P 0 D) +__Y(# P ,&H
|
||||
M1!5 _Z<P;@!2#! $5 ( ("&. @ "1"__\$00 &K@( ).D %,,$ /(
|
||||
M @ H(1 J2#P ,CZL 4(X, 0 H8L (X- 0 ):X :X. 22
|
||||
M#P , #'X " 3 $CZ, 4! ,D ___CZ, 4 8! AC[\ +(^P
|
||||
M !R/L0 @C[( )(^S "@#X ()[T 4">]_^"OOP 4 ( X(8SC B0[P ,C.X
|
||||
M! !@*"$Q^ !$K.4 !!, @!Q3 CD/D #3P)$ E*0*@ !E @ $)("$0 *
|
||||
MK. )#J T\#! )8P"H *6( !;" AC(T !HQ CK.( (SB
|
||||
M !$$ ! ! &"$0 " 8(0! &"&,C@ C.\ ! !S\ C P,(*A @
|
||||
M H KZ4 '*^F !@ X" A#! %-J^G ""/I0 <CZ8 &(^G " &,
|
||||
M#P $"&0Y -KZ< ( P0!GBOI@ 8CZ8 &(^G " 0P@ ' 0(9#Y PD O__
|
||||
M-R@ (! *@Z , 0(8^_ !0GO0 @ ^ " GO?_HK[\ %)"" PD
|
||||
M 0 ",$X $A'! P ,$\ @A7@ 8D ?_O#! &@R0$ D0 R) +__R0!
|
||||
M_^\ 0< D-QD J"9 R,@P ( !1@ < #! $W:^D !B/I 8
|
||||
M (R# @ C(@ ! 4: @ 0(9") P ,2H 1!5 !L ! A
|
||||
MD(L #3P-$ EK0*@ M@@ &-*"&,K@ '#>".LCP C(( $
|
||||
M00 $ $ 8(1 ( !@A $ 8(8RX ",F0 $ ,90",! P@J$" !
|
||||
M$"$,$ 4V $"&/OP 4)[T & /@ @ )[W_X*^_ !0 @"@AD*X
|
||||
M#)"C TQSP $$> # !@,"$\&1 )SE@" &P, #&1 A -(@#P!$ *0@A
|
||||
MK*( ""1( @0 TK"@"H"C! (0( 3 !3 8 / ,0 "1C$ "L
|
||||
MHP ($ !0!@$"$\ Q )&- *RC @ 8! AD*L #3P!$ "V" "P((21*
|
||||
M( 0 ?K"H"H*^E " D!" (#! %5*^F !R/I0 @CZ8 '!! RLH@ (D*T
|
||||
M#)"Y V,KP (/ $0 #6N @ &4" H*X # H""$E^" $ #*PX J \"Q
|
||||
MD*P #25K8 @ !DC 2L0(3P!$ #&B "T((:RB @D2@ (K"H"H(RN @
|
||||
MP" AK*X ! P0!HBOI0 @CZ4 (!! F/OP 4D*( # P3P $%> !(^_
|
||||
M !0T60! H+D #(^_ !0GO0 @ ^ " "0C@ -/ ,0 .>( ;Q@AC&,"
|
||||
MH(R8 0 '@0(P1! , ^ "*R# 2,F0 !9""H0( "
|
||||
M *R" #X ( ) (#Z0 P#X ( #P!$ "L
|
||||
M(@P8 ^ ""0"__\GO?^HK[8 +*^R !ROOP TK[< ,*^U "B/CH%PK[0 )*^S
|
||||
M ""OL0 8 ("0(:^P !01P $ "P(8^%@800 +)Y6!<">"@70GE8%PKX*!
|
||||
M?#1/ &OCX%P-K@ 0*@."&OF(%T $ H(:^'@7B/AX%X)!?__R04__X X(@A
|
||||
M P(8XC & 0(3!9 $7( = B" (0!@@"&. @ )D0 !P $(((P
|
||||
M2 !%0 #@ $(( "(#@AKX>!>!2P *N(@ B H(8XC &" (8X"
|
||||
M ,$D 1$@__8 B00(0("""L4( # %$(*Q @ &H & 0
|
||||
M(0(@@"$ 5(@D A$(*Q0@_]L CXJ!? 2"@ # ! 2OA8&$
|
||||
M$C4 !23& &OA8&$$ :P $"$DQ@ !+,$ A0@_\P )D, !P #&(*O
|
||||
MHP X *"((0 ("$,$ :@KX6!A(^+@7R/HP X)6P !!!, P 0( A)&8'_P &
|
||||
M,L(P1 #$( $ &,T D#0 $ :08(P!@L"$ 0X A$ "@#6,"&/A8&$CXZ!
|
||||
M? !Q7@C _ @P!X,",DQ@@ 8RP@ &,T "!L@A S (*Q @ 0\ 7__
|
||||
M$ 00 $"$\ 7__-"'@ 0#!""L4( - ,"8(3P$?_\TA. #! &H*^F $B/
|
||||
MI@!(%%< !#P!@ 0 S 0(3P!@ T(2 ,$P(0P0!J P" A%%< !0
|
||||
M ,$ :L @ @(1 "@ ! ACXB!? (32"$!-E C)4O__*T0 "N"P CXR!
|
||||
M? ( *"$EC0 $$@T !3:B &-C@ #7/ &MCP CA@ "OF(%\
|
||||
MCYF!?! _W>O(@ $ X(0#P""L0( &-.D 8SH KXB!@*SC T
|
||||
MZ0 !$+$ !*XI "OAX%X$ !*^%@80 X"@AKX6!A*^'@7@F(@ $C[\ -(^P
|
||||
M !2/L0 8C[( '(^S ""/M DC[4 *(^V "R/MP P ^ "">] %@0@ - ( 0
|
||||
M(22"__RO@H%XC$X "0!__X!P7@DK$\ (Q9 "/F(%\ !<9 (
|
||||
MKX*!A /@ @ )[W_R*^P !@ @( A$@ .*^_ !R. O_\ #!. $1
|
||||
MP ( % 8(P( ("$,$ 8:KZ4 /(^E #R. O_\ !0&", QB#KZ, ) "@
|
||||
M("$,$ 54KZ4 /(^C "2/I0 \$$ !0! ("$04 # !2@ 0DIP #$
|
||||
M(0" $"$DIP # <X@@#C""L0( " #@&"&OI T @ H(0 #,( ,$ (P
|
||||
MKZ< ((^D #2/IP @ % (*Q @ ! =X@ !/&"$ < @K%" "P
|
||||
M<,@C !E @X^8@8 "$B $E0(1 2M6 #! %5 "@("$ 0" A ( 0(8^_
|
||||
M !R/L 8 ^ "">] #@ "0" _L ,$. P ($ 50
|
||||
M /@ @ ) (#[ P0X # @0!5 ^ " "/@H&8
|
||||
M ^ " "OA(&8 ^ " " $"$ ">]_["OOP <#! &@*^D %"/
|
||||
MI !0KZ( )"0%5 @,$ :\)Z8 * 1! <D @ !CZ0 ) P0!H, $ @
|
||||
M$"$D @ !C[\ '">] % #X ( #P#$ ",8PJ$) (#
|
||||
M^0"#("$ ,%. !#P!$ 8! A ^ "*PD"H0($ 50 #P"$ ",0@J
|
||||
M """"L0( " ! ("$D @/Y #!3@__0\ 1 K"0*A /@ @
|
||||
M ! A D @0> #!#@ , "! %4 #X (
|
||||
M #X (
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M (" @(" @(" @*"@H*"@@(" @(" @(" @(" @(" @("!($! 0$! 0$! 0
|
||||
M$! 0$! 0A(2$A(2$A(2$A! 0$! 0$!"!@8&!@8$! 0$! 0$! 0$! 0$! 0$!
|
||||
M 0$! 1 0$! 0$(*"@H*"@@(" @(" @(" @(" @(" @(" @("$! 0$"
|
||||
M
|
||||
M
|
||||
M 0(#! 4&!P@)
|
||||
M"@L,#0X/$!$2$Q05%A<8&1H;'!T>'R A(B,D)28G*"DJ*RPM+B\P,3(S-#4V
|
||||
M-S@Y.CL\/3X_0&%B8V1E9F=H:6IK;&UN;W!Q<G-T=79W>'EZ6UQ=7E]@04)#
|
||||
M1$5&1TA)2DM,34Y/4%%24U155E=865I[?'U^?P
|
||||
M
|
||||
M
|
||||
M !#2%)#3$%34P O;&EB+V-H<F-L
|
||||
M87-S+P
|
||||
M
|
||||
M
|
||||
M ! 8"
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M $ " 0 ! 8!@0 & 8!@(
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M 0 *= $ "G0
|
||||
M 0&D $+(
|
||||
M 0 &%S8VEI
|
||||
M $ *=
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M
|
||||
M < D""@ !D + P8 - ,R $Y ]L
|
||||
M "$P 3%P A, !4J !B0 %ST '@ 8Q@ !< !K
|
||||
MB (< &SX,/ @X# 00-! T$ 0(*"! !9 \# 0$!%@P% A(! 0(04%!04%
|
||||
M!04%!04%!08',!$1(1$1(1$1(1$1(A,R$A(B$A(B$A(B$A(B%"$1$2$1$2$1
|
||||
M$2$1$2$1(1$1$2(B$P$!,-" BP6(, "1$0,/ 4$A0F5! B)0& Z __*!
|
||||
M \2$P4PX#$7%!$8 !<2$1@!$1)08! 0$! 0$! 0$! 0$! 0$! P$! 0$! 0
|
||||
M$! 0$! 0$! 0$! P$" 0$! $!$1$0 0$1$10/ A,A 2$8( "A 0$7$0(! @
|
||||
M$.! \($ "A(2,! @$!#0<! @$!#0<! @\# 0X(( #! 0$! 0$! 0(! 0$! 0
|
||||
M$)" D0$-!R$! 0$" 0$-!0$!#0<A 0(! 0T( $,! T$ 0$7$0$! @$" 0
|
||||
MX$#P@0 *$A(P$" 0$-!P$" 0$-!P$"#P,!#@@@ ,$! 0$! 0$! @$! 0$! 0
|
||||
MD( "1 0T'(0$! 0(! 0T% 0$-!R$! @$!#0 ! 1$2$6%!(B!"<7%##0,- R
|
||||
MT#&$ H3,103 T#0010C$R 5$"$2$Q! X! @\!,",-!V$R8T)"#P(?!(!!@(
|
||||
M !@!" )2& H 1(8 3(0(. @\!02$!#P$/!H" 81%#$8""@' D @X2#P$. H
|
||||
M!A@(!!@ $!#P$/ T 102$1$C(Q48&!@&) ) T#'02!#P,B@(-R 2\!#P$1#P
|
||||
M. $@$/ 8 !$3. 1%! 1 !)A</ %<)1PT#0PX1 @X# 10A 5&$#P$!<6(! 0
|
||||
M$B@A$Q% \!(0\!'P<1'P(A PX" W(Q%#\"81(B,1$4!"P$ 0D'(3$A @X$ B
|
||||
M$A @(. E& ) T'$S%3$"@ )@/_WA +%1$5(. C$200%A<4$/ R% 0$1$1
|
||||
M ! 1$1%"0"$!0,!0\!0B$20A(/ @$2#P$2$3$" 0$1$1 ! 1$1$
|
||||
M @ /____\ !@ '0 . &<
|
||||
M : 0 : #_____ !T 'P ((
|
||||
M "$ &@ ' & ' _____P =
|
||||
M !\ "/ DP !L !\ " !\ /____\
|
||||
M '0 ? G@ * > "$ #_____
|
||||
M !T 'P 'D !Y !@ E !@
|
||||
M _____P = !\ !Z >@ $ P *0
|
||||
M P /____\ '0 ? >P 'L "
|
||||
M2 "T 2 #_____ !T 'P 'T !]
|
||||
M P & Q & _____P = !\
|
||||
M !^ ?@ 0 !X -0 !X /____\
|
||||
M '0 ? ?P '\ % D #D D #_____
|
||||
M !T 'P ($ "! !@ *@ ] *@
|
||||
M_____P = !\ "" @@ < # 00 #
|
||||
M /____\ '0 ? @P (, ( V
|
||||
M $4 V #_____ !T 'P (4 "%
|
||||
M"0 / !) / _____P = !\ "&
|
||||
M A@ H $( 30 $( /____\
|
||||
M'0 ? AP (< + !( %$ !( #_____
|
||||
M !T 'P (D ") # 3P !5 3P ____
|
||||
M_P = !\ "* B@ T %< A0 %<
|
||||
M /____\ '0 ? L@ /< . $
|
||||
M #_____ !T 'P ( "
|
||||
M " ( #___UL_____P "L = !\ !?
|
||||
M@P 0 " _____/____\ " '0 ?
|
||||
M '0 "X $ @ , /____S_____
|
||||
M @ !T 'P !X F (P # (P _____P
|
||||
M = !\ S .0 D 0
|
||||
M /____\ '0 ? 8@ )H $
|
||||
M #_____ !T 'P X 2
|
||||
M ! _____P = !\ . $@
|
||||
M 0 /____\ '0 ?
|
||||
M* 2X $ #_____
|
||||
M !T 'P X 3 # _____P
|
||||
M = !\ 7 ' !( !0 !* P _____/__
|
||||
M__\ " '0 ? (0 "4 $ $ @ $
|
||||
M /____S_____ @ !T 'P "H ] '@ #
|
||||
M 'H ! #____T_____P * = !\ !. 90 X
|
||||
M $X !0 $Z 0 _____/____\ " '0 ? <@
|
||||
M (D B "@ < "@@ \ /___]S_____ !0 !T
|
||||
M'P )H "Z -0 !+ ) !+( #____T_____P
|
||||
M ( = !\ #2 W@ %8 7( "P 7* _____/____\
|
||||
M !@ '0 ? Z@ /@ !K &U T &U@ /__
|
||||
M__3_____ @ !T 'P 0, $; > "#@ / "
|
||||
M#@ _____P = !\ $I !, )4
|
||||
M 0 /____\ '0 ? #@ \
|
||||
M $ #_____ !T 'P
|
||||
M !$ > & (#_ #____<_____P
|
||||
M6 = !\ !D Q0 ,8 " ,< /____\
|
||||
M '0 ? S -L !. #6 H #7@ $ /___^3_
|
||||
M____ X !T 'P .8 $! 5 !
|
||||
M _____P = !\ . $@
|
||||
M 0 /____\ '0 ? #@ !(
|
||||
M $ #_____ !T 'P !\
|
||||
M C P # P _____P =
|
||||
M !\ J , $ 0 " ____S/____\
|
||||
M % '0 ? '@ "@ $ #_____
|
||||
M !T 'P !< ? # $ "P
|
||||
M _____P = !\ E +P @ 0
|
||||
M /____\ '0 ? #@ !(
|
||||
M 0 L( + # (K___ %0! < 8( " %0 &@@( "
|
||||
M '0! B@8( & '0 @@( $ *0! C 8( * *0 P@
|
||||
M( & ,0! CP8( . ,0 @@( ( 0 @( 0
|
||||
M L( " 0 @( 0 L( " 0 @(
|
||||
M 0 L( " 0 @( 0 L( "* 0@ !AI8 )
|
||||
M 2P E8 ( 60 ! E8 # : " E8 $ =0 $ E
|
||||
M8 % @P & E8 & D@ ( E8 ' A8 ! H@
|
||||
M !AI8 1 IP E8 ( M0 ! E8 # Q " E8 $
|
||||
MT0 $ E8 % WP & E8 & [@ ( E8 ' A8 )
|
||||
M _@ AM8 9 !!@ E8 ( !% E8 # !(P E
|
||||
M8 $ !, E8 % !/@ E8 & !30 E8 '
|
||||
M A8 1 !70 AM8 A !8@ E8 ( !< E8 # !
|
||||
M?P E8 $ !C E8 % !F@ E8 & !J0 E8 '
|
||||
M A8 9 !N0! E 8( "' <( D @@
|
||||
M( B !N0 !@@( A !Q0! F@8( ") <( H
|
||||
M @@( F !Q0 !@@( E !V ! H 8( "+ <( L
|
||||
M @@( J !V !@@( I ![0! I@8( "- <( P
|
||||
M @@( N ![0 !@@( M !^@! K 8( "/ <
|
||||
M( T @@( R !^@ !@@( Q "#@! L@8( "1
|
||||
M <( X @@( V "#@ !@@( U ") ! N 8( "3
|
||||
M <( \ @@( Z ") !@@( Y "+P! O@8( "5
|
||||
M <( ! @@( ^ "+P !@@( ] "00! Q 8
|
||||
M( "7 <( !$ @@( !" "00 !@@( !! "50!
|
||||
M R@8( "9 <( !( @@( !& "50 !@@( !% "
|
||||
M80! T 8( "; <( !, @@( !* "80 !@@( !)
|
||||
M "= ! U@8( "= <( !0 @@( !. "= !@@
|
||||
M( !- "B0! W 8( "? <( !4 P@( !2 "B0
|
||||
M !P@( !1 "E@! XP8( "A <( !8 ! @( !6 "
|
||||
ME@ " @( !5 "I )AI8 !> "J0 E8 "F "K@ " E8 "I
|
||||
M "MP $ E8 "L A8 !9 "O0 )!M8 !C "Q0 E
|
||||
M8 #$ "R@ E8 #' "TP E8 #* A8 !> "V0
|
||||
M 1Q8 !H "W@ E8 #B "X@ $E8 #C "Z (E8 #D
|
||||
M A8 !C "[0 1Q8 !M "] E8 #K "^P $E8 #L
|
||||
M # @ (E8 #M A8 !H #!P 1Q8 !Q ## E
|
||||
M8 #T #$@ $E8 #U A8 !M #%P 1Q8 !U #'
|
||||
M E8 #\ #( $E8 #] A8 !Q #* 1Q8 !Y #
|
||||
M+0 E8 $$ #,P $E8 $% A8 !U #. I8 $&
|
||||
M #0 1Q8 !^ #1@ E8 $, #3 $E8 $- A
|
||||
M8 !Z #40 I8 $. #6@ 1Q8 "% #90 (E8 $4 #:0
|
||||
M $E8 $5 #;0 E8 $6 #<@ ,E8 $7 A8 !_ #
|
||||
M> ! ZP8( $8 <( "( = @( "& #> > @( "%
|
||||
M 0 @( 0 L( $ % ! !9 8( - % @@
|
||||
M( ! 0 @( 0 L( % "1 "L )K___ % !
|
||||
M!: 8( - % .P@( " 0 @( 0 L( $
|
||||
M#@! !I 8( - #@ #0@( ! 0 @( 0 L( &
|
||||
M "@! !M 8( - "@ (P@( ! $0! !UPX( / $0 '0@
|
||||
M( # 0 @( 0 L( ) #@! !] 8( " %0!
|
||||
M"!@4+___ (@! "& 4+___ *0! "&@4+___ , ! "&P4+___
|
||||
M-P! "' 4+___ #@ *@@( ! 0 @( 0 L( %
|
||||
M #0! "( 8( " $P! ")@4+___ #0 " @( ! 0 @
|
||||
M( 0 L( " 0 @( 0 L( " 0
|
||||
M @( 0 L( % #0! "* 8( " $P! "+@4+___
|
||||
M#0 " @( ! 0 @( 0 L( 9 #0! ", 8( "
|
||||
M % ! "/ 4+___ 'P! "0P4+___ ,0! "1@4+___ /P! "2P4
|
||||
M+___ 0P! "304+___ 40! "604+___ 7 ! "7P4+___ 9P!
|
||||
M"9@4+___ < ! "9@4+___ ? ! "?04+___ B ! "C 4+___
|
||||
MDP! "E04+___ GP! "G04+___ L@! "H@4+___ P ! "J04+___
|
||||
M S@! "M04+___ V0! "NP4+___ Y ! "P@4+___ [@! "P@4
|
||||
M+___ ^P! "V04+___ !" ! "Z 4+___ #0 P0@( ! 0
|
||||
M @( 0 L( % #@! "] 8( " %0! "^@4+___
|
||||
M#@ " @( ! 0 @( 0 L( ( "A "N )K___
|
||||
M $Q B (3___ '@! "_ 8( - '@ $@@( # )0! ##@8
|
||||
M( / )0 &@@( % 0 @( 0 L( 2 "@!
|
||||
M#* 8( - "@ '@@( ! $P! #1@8( / $P , @( #
|
||||
M&@! #=@8( 1 &@ 4@@( % (0! #R 8( 3 (0 C @( '
|
||||
M *0! $5 8( 5 *0 1@@( ) ,@! $F@8( 7 ,@ 0P@
|
||||
M( + .@! $W08( 9 .@ 60@( - 0P! %-@8( ; 0P
|
||||
M % @( / 0 @( 0 L( $ # ! %3 8( "
|
||||
M# ! @( ! 0 @( 0 L( $ #@! %4 8( "
|
||||
M #@ ! @( ! 0 @( 0 L( " 0 @
|
||||
M( 0 L( " 0 @( 0 L( - "A
|
||||
M"_ )S___ $1 "_@)S___ &! "_P)S___ 'Q # )S___
|
||||
M)A # 0)S___ +P! %5 8( - +P Q@@( & -@! &&@8( /
|
||||
M -@ $ @( ( .P! &*@8( 1 .P 1 @( * 0 @
|
||||
M( 0 L( % #@! &< 8( " %0! &=@4+___ #@
|
||||
M " @( ! 0 @( 0 L( % #@! &> 8( "
|
||||
M%0! &?@4+___ #@ " @( ! 0 @( 0 L( &
|
||||
M # ! &@ 8( - # P@( ! %0! &@P8( / %0 P@
|
||||
M( # 0 @( 0 L( $ "P! &B 8( - "P
|
||||
M %0@( ! 0 @( 0 L( ( #0! &H 8( "
|
||||
M#0 "@@( ! $P! &J@4+___ %P! &K 8( & ' ! &LP4+___
|
||||
M %P #@@( $ 0 @( 0 L( % #@! &O 8
|
||||
M( " %0! &P@4+___ #@ " @( ! 0 @( 0
|
||||
M L( " 0 @( _____P $ /____\
|
||||
M!@ #_____ @ _____P * &
|
||||
M @ 0 & " H + P 4 ' "0 !H #
|
||||
M # __ ! 0 @# # __ ! 0
|
||||
M @# # __ ! 0 @$ # __ !
|
||||
M 0 ! $ # __ ! 0 ! % # __ !
|
||||
M 0 ! & # __ ! 0 " & # __ !
|
||||
M 0 " ' # __ ! 0 " ( # __ !
|
||||
M 0 " ( # __ ! 0 " ) # __
|
||||
M! 0 " * # __ ! 0 " + #
|
||||
M__ ! 0 $ # ! P 0 , $ $ ! ! 0 4 $ &
|
||||
M ! !@ 0 < $ ( ! " 0 D $ * ! "P 0 P #__________PP
|
||||
M #_\ ! P #__________PP #_\ ) T #_________
|
||||
M_PT #_\ 1 T #__________PT #_\ 9 "4#
|
||||
M *0, M P #$$ -00 Y!0 #T&
|
||||
M 008 !%!P $D( 30@ !1"0
|
||||
M %4* 60L , __________\, ! __ 60 , !(0__
|
||||
M60 , #,P__ 0 #_\ $ " P/_P 0
|
||||
M $ ) __ ! !( , ! __ 60 -
|
||||
M __________\, ! __ 60 , !(0__ 60 , #,P__ 0
|
||||
M #_\ $ " P/_P 0 $ ) __
|
||||
M! !( - __ 7@ . __________\
|
||||
M . __ 8P . __________\ .
|
||||
M __ : . __________\ X #_\ !M X
|
||||
M #__________P #@ /_P '$ #@ /__________
|
||||
M . __ =0 . __________\ X #_\ !Z
|
||||
M X #__________P ")!@ &
|
||||
M @ 0 & " H + P 4 ' "0 !H
|
||||
M #!@ & @ 0 & " H + P
|
||||
M 4 ' "0 !H $!@ & @ 0 &
|
||||
M" H + P 4 ' "0 !H #!@ &
|
||||
M @ 0 & " H + P 4 ' "0 !H
|
||||
M # P 0 4# ! _____P ( /____\
|
||||
M! #_____ 0 _____P 8 /____\
|
||||
M ! !@ ( $ !@ @ * "P , %
|
||||
M !P D : !08 '&@ & @ 0
|
||||
M & " H + P 4 ' "0 !H #&@
|
||||
M 4& !P8 )!@ L& #08 /
|
||||
M!@ !$& _____P # /____\ P
|
||||
M !@ ( $ !@ @ * "P , % !P D
|
||||
M : 8 " ! 8 ( "@ L # !0
|
||||
M < ) &@ & @ 0 & " H +
|
||||
M P 4 ' "0 !H (&@ 0 H: #!H $ #_
|
||||
M____ 0 _____P $ & @ 0
|
||||
M & " H + P 4 ' "0 !H #!@
|
||||
M 4& 8 " ! 8 ( "@ L #
|
||||
M!0 < ) &@ ,& _____P # /____\
|
||||
M !P #_____ 0 &-R=#%T97AT+G, 4U1!4E1&
|
||||
M4DT 7U]S=&%R= !?;6]N8V]N=')O; !?;6-O=6YT %]S<')O8VUO;G-T87)T
|
||||
M O8F%B82]C>7!R97-S+W5S<B]I;F-L=61E+W)E9V1E9BYH O8F%B82]C
|
||||
M>7!R97-S+W5S<B]I;F-L=61E+V%S;2YH !C<G0Q=&EN:70N<P 9V1B;64N
|
||||
M8P \+S1$96)U9R\^ '!U<&EL.B]C>6=I;G0O<&QA>2]F;F8O9V1B;64N8P W
|
||||
M,#(S-#@S-CD -3,X-@!T7W-T<G5C= !V7V-H87)?;65M8F5R '9?<VAO<G1?
|
||||
M;65M8F5R '9?:6YT7VUE;6)E<@!V7VQO;F=?;65M8F5R '9?9FQO871?;65M
|
||||
M8F5R '9?9&]U8FQE7VUE;6)E<@ N1C$Q '9?8VAA<E]M96UB97( =E]S:&]R
|
||||
M=%]M96UB97( =E]I;G1?;65M8F5R '9?;&]N9U]M96UB97( =E]F;&]A=%]M
|
||||
M96UB97( =E]D;W5B;&5?;65M8F5R '1?=6YI;VX =E]C:&%R7VUE;6)E<@!V
|
||||
M7W-H;W)T7VUE;6)E<@!V7VEN=%]M96UB97( =E]L;VYG7VUE;6)E<@!V7V9L
|
||||
M;V%T7VUE;6)E<@!V7V1O=6)L95]M96UB97( +D8Q,P!V7V-H87)?;65M8F5R
|
||||
M '9?<VAO<G1?;65M8F5R '9?:6YT7VUE;6)E<@!V7VQO;F=?;65M8F5R '9?
|
||||
M9FQO871?;65M8F5R '9?9&]U8FQE7VUE;6)E<@!V7V-H87)?9G5N8P!V7W-I
|
||||
M9VYE9%]C:&%R7V9U;F, =E]U;G-I9VYE9%]C:&%R7V9U;F, =E]S:&]R=%]F
|
||||
M=6YC '9?<VEG;F5D7W-H;W)T7V9U;F, =E]U;G-I9VYE9%]S:&]R=%]F=6YC
|
||||
M '9?:6YT7V9U;F, =E]S:6=N961?:6YT7V9U;F, =E]U;G-I9VYE9%]I;G1?
|
||||
M9G5N8P!V7VQO;F=?9G5N8P!V7W-I9VYE9%]L;VYG7V9U;F, =E]U;G-I9VYE
|
||||
M9%]L;VYG7V9U;F, =E]F;&]A=%]F=6YC '9?9&]U8FQE7V9U;F, ;&EN:P!N
|
||||
M97AT &QI;FMF=6YC '-T=69F '1U7VQI;FL ;F5X= !L:6YK9G5N8P!S='5F
|
||||
M9@ N1C(Y ')E9 !G<F5E;@!B;'5E &-O;&]R<P!Y96QL;W< <'5R<&QE '!I
|
||||
M;FL +D8S,0!C:&5V>0!F;W)D &-A<G, 8FUW '!O<G-C:&4 +D8S,P!&04Q3
|
||||
M10!44E5% &)O;VQE86X 8G9A;', 9F%L<V4 =')U90!B;V]L96%N,@!M:7-O
|
||||
M<F1E<F5D '1W;P!O;F4 >F5R;P!T:')E90!M86EN !G96XO<W1U8F9P97-T
|
||||
M87)T+F, 7U]R96%D96YV7W-I9V9P90 8W1Y<&4N8P!F:7)S=%]C86QL %]S
|
||||
M971C:')C;&%S<P 9V5N+V-U97AI="YC &5X:70 &=E=&5N=BYC &=E=&5N
|
||||
M=@!N=FUA=&-H !G96XO<W1R8W!Y+G, <W1R8W!Y #$D,# P,# P,# P, D
|
||||
M9&]C:#, )&1O8V@R "1D;V-H,0 D9&]C:# '-Y<R]?;W!E;BYS %]O<&5N
|
||||
M #DD,# P,# P,# P, +V)A8F$O8WEP<F5S<R]U<W(O:6YC;'5D92]S>7,N
|
||||
M<P +V)A8F$O8WEP<F5S<R]U<W(O:6YC;'5D92]S>7,O<WES8V%L;"YH !S
|
||||
M>7,O7W)E860N<P!?<F5A9 Y)# P,# P,# P,# &=E;B]B8V]P>2YS &UE
|
||||
M;6-P>0!G;V9O<G=A<F1S &9O<G=A<F1S7V)Y=&5C;W!Y #DY)# P,# P,# P
|
||||
M,# <F5T &9O<G=A;&EG;F%B;&4 9F]R=U]C;W!Y,@!F;W)W7V-O<'DS &9O
|
||||
M<G=A<F1S &9O<G=A<F1S7S,R &9O<G=A<F1S7S$V &9O<G=A<F1S7S0 9V]B
|
||||
M86-K=V%R9', 8F%C:W=A<F1S7V)Y=&5C;W!Y #DY)# P,# P,# P,#$ 8F%C
|
||||
M:V%L:6=N86)L90!B86-K7V-O<'DR &)A8VM?8V]P>3, 8F%C:W=A<F1S &)A
|
||||
M8VMW87)D<U\S,@!B86-K=V%R9'-?,38 8F%C:W=A<F1S7S0 '-Y<R]?8VQO
|
||||
M<V4N<P!?8VQO<V4 .20P,# P,# P,# P !A=&5X:70N8P!?7VYE>'1F;@!?
|
||||
M7V5X:71?9FYS &%T97AI= !?7V-A;&Q?97AI=&9N<P 9FQS8G5F+F, 7V-L
|
||||
M96%N=7 9F-L;W-E &9F;'5S: !?9FQS8G5F %]X9FQS8G5F %]W<G1C:&L
|
||||
M7V9I;F1B=68 7V)U9G-Y;F, '-Y<R]E>&ET+G, 7V5X:70 &-R="]C97)R
|
||||
M;W(N<P!?8V5R<F]R !D871A+F, &UP7V1E9BYC !M86QL;V,N8P!A;&QO
|
||||
M8W, 86QL;V-P &%L;&]C= !A;&QO8W@ 86QL;V-E;F0 ;6%L;&]C &9R964
|
||||
M<F5A;&QO8P <WES+U]L<V5E:RYS %]L<V5E:P Y)# P,# P,# P,# '-Y
|
||||
M<R]?=W)I=&4N<P!?=W)I=&4 .20P,# P,# P,# P !?;W-E<G)O<BYC %]O
|
||||
M<V5R<F]R %]S971O<V5R<F]R !?:7-A='1Y+F, 7VES871T>0 <WES+U]S
|
||||
M8G)K+G, 7W-B<FL 97)R %]B<FL ,20P,# P,# P,# P !S>7,O7VEO8W1L
|
||||
M+G, 7VEO8W1L #DD,# P,# P,# P, 8W)T;FEN:70N<P 7V5N=FER;VX
|
||||
M96YV:7)O;@!?7T%R9V, 7U]!<F=V &5R<FYO %]?<W1A<G0 7V=P %]?:7-T
|
||||
M87)T %]?<F5A9&5N=E]S:6=F<&4 7W-E=&-H<F-L87-S &UA:6X 97AI= !?
|
||||
M;6]N8V]N=')O; !?;6-O=6YT %]S<')O8VUO;G-T87)T '9?8VAA<@!V7W-I
|
||||
M9VYE9%]C:&%R '9?=6YS:6=N961?8VAA<@!V7W-H;W)T '9?<VEG;F5D7W-H
|
||||
M;W)T '9?=6YS:6=N961?<VAO<G0 =E]I;G0 =E]S:6=N961?:6YT '9?=6YS
|
||||
M:6=N961?:6YT '9?;&]N9P!V7W-I9VYE9%]L;VYG '9?=6YS:6=N961?;&]N
|
||||
M9P!V7V9L;V%T '9?9&]U8FQE '9?8VAA<E]A<G)A>0!V7W-I9VYE9%]C:&%R
|
||||
M7V%R<F%Y '9?=6YS:6=N961?8VAA<E]A<G)A>0!V7W-H;W)T7V%R<F%Y '9?
|
||||
M<VEG;F5D7W-H;W)T7V%R<F%Y '9?=6YS:6=N961?<VAO<G1?87)R87D =E]I
|
||||
M;G1?87)R87D =E]S:6=N961?:6YT7V%R<F%Y '9?=6YS:6=N961?:6YT7V%R
|
||||
M<F%Y '9?;&]N9U]A<G)A>0!V7W-I9VYE9%]L;VYG7V%R<F%Y '9?=6YS:6=N
|
||||
M961?;&]N9U]A<G)A>0!V7V9L;V%T7V%R<F%Y '9?9&]U8FQE7V%R<F%Y '9?
|
||||
M8VAA<E]P;VEN=&5R '9?<VEG;F5D7V-H87)?<&]I;G1E<@!V7W5N<VEG;F5D
|
||||
M7V-H87)?<&]I;G1E<@!V7W-H;W)T7W!O:6YT97( =E]S:6=N961?<VAO<G1?
|
||||
M<&]I;G1E<@!V7W5N<VEG;F5D7W-H;W)T7W!O:6YT97( =E]I;G1?<&]I;G1E
|
||||
M<@!V7W-I9VYE9%]I;G1?<&]I;G1E<@!V7W5N<VEG;F5D7VEN=%]P;VEN=&5R
|
||||
M '9?;&]N9U]P;VEN=&5R '9?<VEG;F5D7VQO;F=?<&]I;G1E<@!V7W5N<VEG
|
||||
M;F5D7VQO;F=?<&]I;G1E<@!V7V9L;V%T7W!O:6YT97( =E]D;W5B;&5?<&]I
|
||||
M;G1E<@!V7W-T<G5C=#$ =E]S=')U8W0R '9?=6YI;VX =E]U;FEO;C( =E]C
|
||||
M:&%R7V9U;F, =E]S:6=N961?8VAA<E]F=6YC '9?=6YS:6=N961?8VAA<E]F
|
||||
M=6YC '9?<VAO<G1?9G5N8P!V7W-I9VYE9%]S:&]R=%]F=6YC '9?=6YS:6=N
|
||||
M961?<VAO<G1?9G5N8P!V7VEN=%]F=6YC '9?<VEG;F5D7VEN=%]F=6YC '9?
|
||||
M=6YS:6=N961?:6YT7V9U;F, =E]L;VYG7V9U;F, =E]S:6=N961?;&]N9U]F
|
||||
M=6YC '9?=6YS:6=N961?;&]N9U]F=6YC '9?9FQO871?9G5N8P!V7V1O=6)L
|
||||
M95]F=6YC '-?;&EN:P!U7VQI;FL <')I;6%R>0!N;VYP<FEM87)Y &-L=6YK
|
||||
M97( <W!O<G1S8V%R %]C='EP90!G971E;G8 <W1R8W!Y %]O<&5N %]R96%D
|
||||
M &UE;6-P>0!?8VQO<V4 7U]T<F%P7V9P95]O=F5R<FED90!?7V-A;&Q?97AI
|
||||
M=&9N<P!?8VQE86YU< !?97AI= !?8V5R<F]R &%T97AI= !?8G5F96YD=&%B
|
||||
M %]I;V( 7W-P<F]C960 7VQA<W1B=68 7W-I8G5F %]S;V)U9@!?<VUB=68
|
||||
M9F9L=7-H &9C;&]S90!F<F5E %]L<V5E:P!?>&9L<V)U9@!?9FQS8G5F %]W
|
||||
M<FET90!?=W)T8VAK %]B=69S>6YC %]S971O<V5R<F]R %]F:6YD8G5F &UA
|
||||
M;&QO8P!?:7-A='1Y %]L;V-K %]U;&]C:P!?;FQO8VL 7VEL;V-K %]F;&]C
|
||||
M:P!?=VQO8VL 7V-L;V-K %]T;&]C:P!?8W1L;V-K %]D;&]C:P!?8V%S %]U
|
||||
M<U]R<W1H<F5A9%]S=&1I;P!?<V)R:P!?8G)K ')E86QL;V, 7V]S97)R;W(
|
||||
M7VEO8W1L &5N9 !?;6EN8G)K %]C=7)B<FL 7V5N9 $ !P $
|
||||
M 0 + "$ 0 $
|
||||
M %&8 ? $ !P $ ! ) L "
|
||||
M $ 0 4 %'8 $ !
|
||||
MP $ !D (0 T " $ 0
|
||||
M H %'8 $ !P $ "% #0 \
|
||||
M " \ !'8
|
||||
M $ "4 $ "2 #?0 !$ "* (0 ,\
|
||||
M $ \ 0 !&@ ! ! 0 !\ _ $ %D $ 0/
|
||||
M )0 )L $ \ ( 3 $ $J #P !$
|
||||
M ! 8 %X ! $ %H $ 0T (0 )\ % \@
|
||||
M #L 4 $ $Y #P !( ! 8 %\ 7 $ &
|
||||
MD $ 15 $P *0 $ !+0 T 5 $ %(
|
||||
M #P !, ! 8 '8 , $ &T $ 1H &0 *@
|
||||
M & !.@ $ 6 ( %7 $0 !0 ! 8
|
||||
M (( 0 $ 'T $ 2! /@ *X ) !>@ "H
|
||||
M 8 $ %H ! !4 %&8 )( J $ (@ $ 2_
|
||||
M ( +< % !I @ 9 $ %L ! !H
|
||||
M %&8 +P % $ (@ $ 3? (0 +P "
|
||||
M ! $ !\ %'8 $ (
|
||||
M@ $ 4 *0 +X " ! $
|
||||
M "0 %'8 $ (H $ 4I ( ,
|
||||
M % !K @ : $ %P ! "D %&8
|
||||
M ,$ % $ (P $ 5) !% ,4 9 !M ,8
|
||||
M ; $ %T ! "X %&8 ,8 "T $ +T $ 9=
|
||||
M (@ -X % ">@ @ < $ %X ! #,
|
||||
M %&8 7H % $ +\ $ 9_ - ., ( "@@
|
||||
M "P = ( %\ $0 #@ ! 8 7\ ( $ ,
|
||||
MH $ :S 3 .L 2 "K@ B( ? @ &-
|
||||
M '0 #D ! 8 8< "; $ 5, $ ;_ $@ /T
|
||||
M $ $T 0 G $ &J ! #H %&8
|
||||
M B( " $ 50 $ <1 %@ 0$ $ $U 0
|
||||
M H $ &N ! #\ #&8 B0 # $ 54 $ <G
|
||||
M " 04 " &R #0 $(
|
||||
M ! 8 $ 54 $ <O "@ 0< "
|
||||
M &_ #0 $, ! 8 $ 5
|
||||
M4 $ <Y 0P 0D - $V 1L I , ',
|
||||
M $P $0 ! 8 B< !N $ 9P $ =\ (@ 18
|
||||
M % %\P @ L $ '? ! $4 %&8
|
||||
M I4 % $ 9X $ >> (@ 1L % %^P @
|
||||
M M $ 'C ! $H %&8 IH % $ : $ ?
|
||||
M (0 2 & & P 8 N ( 'G $0 $\
|
||||
M ! 8 I\ # $ :( $ ?A $P 28 $ &"0
|
||||
M !4 P $ 'X #P % ! 8 J( ) $ :
|
||||
M@ $ ?T *0 2H ( &'@ !H Q ( ('
|
||||
M " %$ %&8 JL 0 $ :\ $ @= (@ 3(
|
||||
M % &. @ S $ (/ ! %8 %&8
|
||||
M KL %$$ ;$ $ @_ # 3< "
|
||||
M %L !'8 $ !
|
||||
M @ ( 0 $ " @ ! 0 (
|
||||
M " P 0 % !@ < ( "0 ( " 0
|
||||
M $ * 0 ( + # H ! @ L ,
|
||||
M"@ $ " "P P - 0 ( + # X "
|
||||
M @ $ ! #P $ " "P P 0 $0 !(
|
||||
M ! @ L , $P $ " % !4 6 %P
|
||||
M $ " "P P 8 0 ( + # !D :
|
||||
M&P $ " "P P < 0 ( + # !T
|
||||
M ! "K %K___ D0 JP!:___P 1$ ,$ 7/__\
|
||||
M &! #!0%S___ !\0 P8!<___P E $ !P!@@
|
||||
M ( +1 BH 4K___ P #$ 0!L<%L___P 4 Z $ %
|
||||
MD!@@ $ & 2P! !: 8( " ! %@ 0 .L&" A0 < !=
|
||||
M $ &D!@@ $ 8@! B@8( $ &X 0 (P&" !@
|
||||
M !V $ "/!@@ @ $ A1 "Q %P ( ! (P0 L1!< "
|
||||
M 0 ":$ +$@7 @ $ JA "Q0%P # ! +(0 L6!<
|
||||
M P 0 #!$ +& 7 D $ TA "QP%P $ ! -@0 L@
|
||||
M!< ! 0 #E$ +) 7 H $ ]! "R@%P % ! /L0
|
||||
M LL!< !0 0 $)$ +, 7 L $ !&1 "S0%P & !
|
||||
M 2$0 LX!< !P 0 $J$ +0 7 T $ !-Q "T(%P 3
|
||||
M! 4L0 M$!< &0 0 %A$ +2 7 !\ $ !;Q "TP%P E
|
||||
M ! 800 M0!< *P 0 &;$ +6 7 #$ $ !IQ "V %
|
||||
MP W ! ;H0 MH!< /0 0 '/$ +< 7 $, $ !W!
|
||||
M"W@%P !) ! ? 0 N !< 3P 0 (&$ +B 7 %4 $ "
|
||||
M%! 8_ $8 !; ! B,0 N0!< 80 0 (R$ +E 7 &( $
|
||||
M "2! "Y@%P !C ! F 0 N<!< 9 0 )P$ +H 7 &4
|
||||
M $ "AQ "Z0%P !F ! J 0 NH!< 9P 0 *N$ +K 7
|
||||
M &@ $ "PQ "[ %P !I ! MH0 NT!< :@ 0 +I$ +
|
||||
MN 7 &L $ "_Q "[P%P !L ! Q<0 O !< ;0 0 ,G
|
||||
M$ +Q 7 &X $ #.! 8\ $8 !R ! T(0 &/8!& > 0
|
||||
M -,$ +R 7 'X $ #5! "] %P "$ ! UT 0 )0&" (0
|
||||
M 0 -I $ ":!@@ "4 $ #? ! H 8( I ! Y$ 0 *8&"
|
||||
M+0 0 .> $ "L!@@ #$ $ #L@! L@8( U ! \@ 0 +@
|
||||
M&" .0 0 /3 $ "^!@@ #T $ #Y0! Q 8( !! ! _D
|
||||
M0 ,H&" 10 0 0% $ #0!@@ $D $ $& ! U@8( !- !
|
||||
M!"T 0 -P&" 40 0 0Z $ #C!@@ %4 $ $2! "]@%P "^
|
||||
M! !$\0 &,P!& W 0 16$ +W 7 .4 $ $7A "^ %P #N
|
||||
M ! !&D0 OD!< ]@ 0 1Q$ +Z 7 /X & $>Q $
|
||||
M3___ " !(( 0 ;0&" 0 D 2) $ 'T!@@ $ * $D !
|
||||
M"( 8( ! #0 !)8 0 B@&" 0 X 2< $ (P!@@ $ / $
|
||||
MHP! "] 8( ! !P !*H0 K0!:___P ! 2^ $ ,.!@@ 4 1
|
||||
M $S0! #* 8( ! $@ !-8 0!4P&" 0 !, 3< $ 50!@@ $
|
||||
M 0 $Y ! "_ 8( # % !.L0 *@!$___P !0 3V$ $- 1/
|
||||
M__\ 5 $^Q "P %K___ % !000 KP!:___P !0 4-$ 0
|
||||
M 1O__\ 4 %%! 0 $;___ % !1L0 & (!&___P !$ 4B
|
||||
M $ -V!@@ 4 1 %*0! #1@8( # %@ !3 0!AH&" " !<
|
||||
M 4U $ 9P!@@ $ 1 %/ ! $5 8( ) $0 !44 0 \@&" !P
|
||||
M !@ 5- $ 9X!@@ $ 1 %5 ! $F@8( + $0 !5P 0!38&"
|
||||
M#P !D 5E $ :#!@@ , 1 %<0! $W08( - %@ !7H 0!50
|
||||
M&" !@ !H 6! $ :(!@@ $ 5 %B1 #!P%S___ %0 !8\0
|
||||
M P@!<___P !4 66$ ,) 7/__\ 5 %G1 #"@%S___ %0
|
||||
M!:00 PL!<___P !4 6K$ ,, 7/__\ 5 %LA ##0%S___
|
||||
M%0 !;D0 PX!<___P !4 7 $ ,/ 7/__\ 5 %R! #$ %S___
|
||||
M %0 !<\0 Q$!<___P !4 74$ +! 6O__\ ; %YP! &H 8
|
||||
M( ! &P !>T 0!JP&" ! !8 7R $ 8J!@@ H 9 %^@!
|
||||
M&@ 8( ! ' !@, 0!KP&" 0 !L 8*$ "G0!1O__\ ; &
|
||||
I#A "H $3___ &P !A80 J$!$___P __\ 8>$ "G0!1O__\;
|
||||
|
||||
end
|
||||
35
gdb/testsuite/gdb.base/mips_pro.c
Normal file
35
gdb/testsuite/gdb.base/mips_pro.c
Normal file
@@ -0,0 +1,35 @@
|
||||
/* Tests regarding examination of prologues. */
|
||||
|
||||
int
|
||||
inner (z)
|
||||
int z;
|
||||
{
|
||||
return 2 * z;
|
||||
}
|
||||
|
||||
int
|
||||
middle (x)
|
||||
int x;
|
||||
{
|
||||
if (x == 0)
|
||||
return inner (5);
|
||||
else
|
||||
return inner (6);
|
||||
}
|
||||
|
||||
int
|
||||
top (y)
|
||||
int y;
|
||||
{
|
||||
return middle (y + 1);
|
||||
}
|
||||
|
||||
int
|
||||
main (argc, argv)
|
||||
{
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
breakpoint();
|
||||
#endif
|
||||
return top (-1) + top (1);
|
||||
}
|
||||
62
gdb/testsuite/gdb.base/mips_pro.exp
Normal file
62
gdb/testsuite/gdb.base/mips_pro.exp
Normal file
@@ -0,0 +1,62 @@
|
||||
# Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile mips_pro
|
||||
set srcfile ${srcdir}/$subdir/${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
# Create and source the file that provides information about the compiler
|
||||
# used to compile the test case.
|
||||
if [get_compiler_info ${binfile}] {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
# This test must be compiled with -O2 if using gcc.
|
||||
|
||||
if {$gcc_compiled} then {
|
||||
if { [gdb_compile "${srcfile}" "${binfile}" executable {debug additional_flags=-O2}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
} else {
|
||||
if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
}
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
if [runto middle] then {
|
||||
# PR 3016
|
||||
if {$gcc_compiled} then {
|
||||
setup_xfail "hppa*-*-*" "mips*-sgi-irix4*" "mips64*-*-elf"
|
||||
}
|
||||
gdb_test "backtrace" "#0.*middle.*#1.*top.*#2.*main.*"
|
||||
}
|
||||
return 0
|
||||
165
gdb/testsuite/gdb.base/miscexprs.c
Normal file
165
gdb/testsuite/gdb.base/miscexprs.c
Normal file
@@ -0,0 +1,165 @@
|
||||
void marker1 ()
|
||||
{
|
||||
|
||||
}
|
||||
/*
|
||||
static struct {
|
||||
char c[100];
|
||||
} cbig;
|
||||
|
||||
|
||||
static struct {
|
||||
int i[800];
|
||||
} ibig;
|
||||
|
||||
|
||||
static struct {
|
||||
long l[900];
|
||||
} lbig;
|
||||
|
||||
static struct {
|
||||
float f[200];
|
||||
} fbig;
|
||||
|
||||
static struct {
|
||||
double d[300];
|
||||
} dbig;
|
||||
|
||||
static struct {
|
||||
short s[400];
|
||||
} sbig;*/
|
||||
|
||||
/*struct {
|
||||
long l[900];
|
||||
} lbig;*/
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
struct {
|
||||
char c[100];
|
||||
} cbig;
|
||||
|
||||
|
||||
struct {
|
||||
int i[800];
|
||||
} ibig;
|
||||
|
||||
|
||||
struct {
|
||||
long l[900];
|
||||
} lbig;
|
||||
|
||||
struct {
|
||||
float f[200];
|
||||
} fbig;
|
||||
|
||||
struct {
|
||||
double d[300];
|
||||
} dbig;
|
||||
|
||||
struct {
|
||||
short s[400];
|
||||
} sbig;
|
||||
ibig.i[100] = 5;
|
||||
cbig.c[100] = 'A';
|
||||
fbig.f[100] = 11.99999;
|
||||
dbig.d[202] = 9.99999999;
|
||||
sbig.s[90] = 255;
|
||||
lbig.l[333] = 999999999;
|
||||
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
breakpoint();
|
||||
#endif
|
||||
marker1();
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
283
gdb/testsuite/gdb.base/miscexprs.exp
Normal file
283
gdb/testsuite/gdb.base/miscexprs.exp
Normal file
@@ -0,0 +1,283 @@
|
||||
# Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
|
||||
# This file is part of the gdb testsuite
|
||||
# file written by Elena Zannoni (ezannoni@cygnus.com)
|
||||
|
||||
#
|
||||
# tests for expressions with struct/array elements and mixed operator types
|
||||
# with elementary types
|
||||
#
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
#
|
||||
# test running programs
|
||||
#
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile "miscexprs"
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
|
||||
#
|
||||
# set it up at a breakpoint so we can play with the variable values
|
||||
#
|
||||
if ![runto_main] then {
|
||||
perror "couldn't run to breakpoint"
|
||||
continue
|
||||
}
|
||||
|
||||
send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
|
||||
|
||||
send_gdb "cont\n"
|
||||
gdb_expect {
|
||||
-re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
|
||||
send_gdb "up\n"
|
||||
gdb_expect {
|
||||
-re ".*$gdb_prompt $" {}
|
||||
timeout { fail "up from marker1" }
|
||||
}
|
||||
}
|
||||
-re "$gdb_prompt $" { fail "continue to marker1" }
|
||||
timeout { fail "(timeout) continue to marker1" }
|
||||
}
|
||||
|
||||
global hex
|
||||
|
||||
send_gdb "print &ibig.i\[0\]\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = \\(int \\*\\) $hex.*$gdb_prompt $" {
|
||||
pass "print value of &ibig.i\[0\]"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of &ibig.i\[0\]" }
|
||||
timeout { fail "(timeout) print value of &ibig.i\[0\]" }
|
||||
}
|
||||
|
||||
send_gdb "print &cbig.c\[0\]\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = $hex \"\".*$gdb_prompt $" {
|
||||
pass "print value of &cbig.c\[0\]"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of &cbig.c\[0\]" }
|
||||
timeout { fail "(timeout) print value of &cbig.c\[0\]" }
|
||||
}
|
||||
|
||||
send_gdb "print &fbig.f\[0\]\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = \\(float \\*\\) $hex.*$gdb_prompt $" {
|
||||
pass "print value of &fbig.f\[0\]"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of &fbig.f\[0\]" }
|
||||
timeout { fail "(timeout) print value of &fbig.f\[0\]" }
|
||||
}
|
||||
|
||||
send_gdb "print &dbig.d\[0\]\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = \\(double \\*\\) $hex.*$gdb_prompt $" {
|
||||
pass "print value of &dbig.d\[0\]"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of &dbig.d\[0\]" }
|
||||
timeout { fail "(timeout) print value of &dbig.d\[0\]" }
|
||||
}
|
||||
|
||||
send_gdb "print &sbig.s\[0\]\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = \\(short int \\*\\) $hex.*$gdb_prompt $" {
|
||||
pass "print value of &sbig.s\[0\]"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of &sbig.s\[0\]" }
|
||||
timeout { fail "(timeout) print value of &sbig.s\[0\]" }
|
||||
}
|
||||
|
||||
send_gdb "print &lbig.l\[0\]\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = \\(long int \\*\\) $hex.*$gdb_prompt $" {
|
||||
pass "print value of &lbig.l\[0\]"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of &lbig.l\[0\]" }
|
||||
timeout { fail "(timeout) print value of &lbig.l\[0\]" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print ibig.i\[100\] | 1\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 5.*$gdb_prompt $" {
|
||||
pass "print value of ibig.i\[100\] | 1"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of ibig.i\[100\] | 1" }
|
||||
timeout { fail "(timeout) print value of ibig.i\[100\] | 1" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print sbig.s\[90\] & 127\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 127.*$gdb_prompt $" {
|
||||
pass "print value of sbig.s\[90\] & 127"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of sbig.s\[90\] & 127" }
|
||||
timeout { fail "(timeout) print value of sbig.s\[90\] & 127" }
|
||||
}
|
||||
|
||||
send_gdb "print !ibig.i\[100\]\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of !ibig.i\[100\]"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !ibig.i\[100\]" }
|
||||
timeout { fail "(timeout) print value of !ibig.i\[100\]" }
|
||||
}
|
||||
|
||||
send_gdb "print !sbig.s\[90\]\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of !sbig.s\[90\]"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !sbig.s\[90\]" }
|
||||
timeout { fail "(timeout) print value of !sbig.s\[90\]" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print !fbig.f\[100\]\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of !ibig.i\[100\]"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !ibig.i\[100\]" }
|
||||
timeout { fail "(timeout) print value of !ibig.i\[100\]" }
|
||||
}
|
||||
|
||||
send_gdb "print !dbig.d\[202\]\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of !ibig.i\[100\]"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !ibig.i\[100\]" }
|
||||
timeout { fail "(timeout) print value of !ibig.i\[100\]" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
send_gdb "print sbig.s\[90\] * 10\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 2550.*$gdb_prompt $" {
|
||||
pass "print value of !sbig.s\[90\] * 10"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !sbig.s\[90\] * 10" }
|
||||
timeout { fail "(timeout) print value of !sbig.s\[90\] * 10" }
|
||||
}
|
||||
|
||||
send_gdb "print ibig.i\[100\] * sbig.s\[90\]\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 1275.*$gdb_prompt $" {
|
||||
pass "print value of ibig.i\[100\] * sbig.s\[90\]"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of ibig.i\[100\] * sbig.s\[90\]" }
|
||||
timeout { fail "(timeout) print value of ibig.i\[100\] * sbig.s\[90\]" }
|
||||
}
|
||||
|
||||
send_gdb "print fbig.f\[100\] * dbig.d\[202\]\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 119.99\[0-9\]*.*$gdb_prompt $" {
|
||||
pass "print value of fbig.f\[100\] * dbig.d\[202\]"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of fbig.f\[100\] * dbig.d\[202\]" }
|
||||
timeout { fail "(timeout) print value of fbig.f\[100\] * dbig.d\[202\]" }
|
||||
}
|
||||
|
||||
send_gdb "print !(sbig.s\[90\] * 2)\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 0.*$gdb_prompt $" {
|
||||
pass "print value of !(sbig.s\[90\] * 2)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of !(sbig.s\[90\] * 2)" }
|
||||
timeout { fail "(timeout) print value of !(sbig.s\[90\] * 2)" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print sizeof(sbig)\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 800.*$gdb_prompt $" {
|
||||
pass "print value of sizeof(sbig)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of sizeof(sbig)" }
|
||||
timeout { fail "(timeout) print value of sizeof(sbig)" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print sizeof(cbig)\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 100.*$gdb_prompt $" {
|
||||
pass "print value of sizeof(cbig)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of sizeof(cbig)" }
|
||||
timeout { fail "(timeout) print value of sizeof(cbig)" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print sizeof(lbig)\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 3600.*$gdb_prompt $" {
|
||||
pass "print value of sizeof(lbig)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of sizeof(lbig)" }
|
||||
timeout { fail "(timeout) print value of sizeof(lbig)" }
|
||||
}
|
||||
|
||||
send_gdb "print ibig.i\[100\] << 2\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 20.*$gdb_prompt $" {
|
||||
pass "print value of ibig.i\[100\] << 2"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of ibig.i\[100\] << 2" }
|
||||
timeout { fail "(timeout) print value of ibig.i\[100\] << 2" }
|
||||
}
|
||||
|
||||
send_gdb "print sbig.s\[90\] >> 4\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 15.*$gdb_prompt $" {
|
||||
pass "print value of sbig.s\[90\] >> 4"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of sbig.s\[90\] >> 4" }
|
||||
timeout { fail "(timeout) print value of sbig.s\[90\] >> 4" }
|
||||
}
|
||||
|
||||
send_gdb "print lbig.l\[333\] >> 6\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 15624999.*$gdb_prompt $" {
|
||||
pass "print value of lbig.l\[333\] >> 6"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of lbig.l\[333\] >> 6" }
|
||||
timeout { fail "(timeout) print value of lbig.l\[333\] >> 6" }
|
||||
}
|
||||
58
gdb/testsuite/gdb.base/nodebug.c
Normal file
58
gdb/testsuite/gdb.base/nodebug.c
Normal file
@@ -0,0 +1,58 @@
|
||||
/* Test that things still (sort of) work when compiled without -g. */
|
||||
|
||||
int dataglobal = 3; /* Should go in global data */
|
||||
static int datalocal = 4; /* Should go in local data */
|
||||
int bssglobal; /* Should go in global bss */
|
||||
static int bsslocal; /* Should go in local bss */
|
||||
|
||||
int
|
||||
inner (x)
|
||||
int x;
|
||||
{
|
||||
return x + dataglobal + datalocal + bssglobal + bsslocal;
|
||||
}
|
||||
|
||||
static short
|
||||
middle (x)
|
||||
int x;
|
||||
{
|
||||
return 2 * inner (x);
|
||||
}
|
||||
|
||||
short
|
||||
top (x)
|
||||
int x;
|
||||
{
|
||||
return 2 * middle (x);
|
||||
}
|
||||
|
||||
int
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
breakpoint();
|
||||
#endif
|
||||
return top (argc);
|
||||
}
|
||||
|
||||
char *malloc ();
|
||||
|
||||
int *x;
|
||||
|
||||
int
|
||||
array_index (arr, i)
|
||||
char *arr;
|
||||
int i;
|
||||
{
|
||||
/* The basic concept is just "return arr[i];". But call malloc so that gdb
|
||||
will be able to call functions. */
|
||||
char retval;
|
||||
x = (int *) malloc (sizeof (int));
|
||||
*x = i;
|
||||
retval = arr[*x];
|
||||
free (x);
|
||||
return retval;
|
||||
}
|
||||
163
gdb/testsuite/gdb.base/nodebug.exp
Normal file
163
gdb/testsuite/gdb.base/nodebug.exp
Normal file
@@ -0,0 +1,163 @@
|
||||
# Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# Test that things still (sort of) work when compiled without -g.
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
set testfile nodebug
|
||||
set srcfile ${testfile}.c
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ""] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
# Create and source the file that provides information about the compiler
|
||||
# used to compile the test case.
|
||||
if [get_compiler_info ${binfile}] {
|
||||
return -1;
|
||||
}
|
||||
|
||||
source ${binfile}.ci
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load $binfile
|
||||
|
||||
if [runto inner] then {
|
||||
|
||||
# Expect to find global/local symbols in each of text/data/bss.
|
||||
|
||||
# The exact format for some of this output is not necessarily
|
||||
# ideal, particularly interpreting "p top" requires a fair bit of
|
||||
# savvy about gdb's workings and the meaning of the "{}"
|
||||
# construct. So the details maybe could be tweaked. But the
|
||||
# basic purpose should be maintained, which is (a) users should be
|
||||
# able to interact with these variables with some care (they have
|
||||
# to know how to interpret them according to their real type,
|
||||
# since gdb doesn't know the type), but (b) users should be able
|
||||
# to detect that gdb does not know the type, rather than just
|
||||
# being told they are ints or functions returning int like old
|
||||
# versions of gdb used to do.
|
||||
|
||||
# On alpha (and other ecoff systems) the native compilers put
|
||||
# out debugging info for non-aggregate return values of functions
|
||||
# even without -g, which should be accepted.
|
||||
# Irix5, even though it is ELF, counts as "ecoff" because it
|
||||
# encapsulates ecoff debugging info in a .mdebug section.
|
||||
# Irix6 gcc omits no debug info at all for static functions and
|
||||
# variables, so all tests involving statics fail.
|
||||
|
||||
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix5*" "mips-sgi-irix6*" }
|
||||
gdb_test "p top" \
|
||||
"{(<(text variable|function), no debug info>|short \\(\\))} \[0-9a-fx]* <top>"
|
||||
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix5*" "mips-sgi-irix6*" }
|
||||
gdb_test "whatis top" \
|
||||
"(<(text variable|function), no debug info>|short \\(\\))"
|
||||
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
|
||||
gdb_test "ptype top" "(short|int) \\((|<non-float parameter>|<non-float parameter>, <non-float parameter>)\\)"
|
||||
|
||||
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix5*" }
|
||||
setup_xfail "mips-sgi-irix6*"
|
||||
gdb_test "p middle" \
|
||||
"{(<(text variable|function), no debug info>|short \\(\\))} \[0-9a-fx]* <middle>"
|
||||
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix5*" }
|
||||
setup_xfail "mips-sgi-irix6*"
|
||||
gdb_test "whatis middle" \
|
||||
"(<(text variable|function), no debug info>|short \\(\\))"
|
||||
setup_xfail "mips-sgi-irix6*"
|
||||
gdb_test "ptype middle" "(short|int) \\((|<non-float parameter>|<non-float parameter>, <non-float parameter>)\\)"
|
||||
|
||||
gdb_test "p dataglobal" "= 3"
|
||||
gdb_test "whatis dataglobal" \
|
||||
"<(data variable|variable), no debug info>"
|
||||
gdb_test "ptype dataglobal" "<(data variable|variable), no debug info>"
|
||||
|
||||
# The only symbol xcoff puts out for statics is for the TOC entry.
|
||||
# Possible, but hairy, for gdb to deal. Right now it doesn't, it
|
||||
# doesn't know the variables exist at all.
|
||||
setup_xfail "rs6000*-*-aix*"
|
||||
setup_xfail "powerpc*-*-aix*"
|
||||
if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
|
||||
if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
|
||||
gdb_test "p datalocal" "= 4"
|
||||
setup_xfail "rs6000*-*-aix*"
|
||||
setup_xfail "powerpc*-*-aix*"
|
||||
if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
|
||||
if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
|
||||
gdb_test "whatis datalocal" "<(data variable|variable), no debug info>"
|
||||
setup_xfail "rs6000*-*-aix*"
|
||||
setup_xfail "powerpc*-*-aix*"
|
||||
if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
|
||||
if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
|
||||
gdb_test "ptype datalocal" "<(data variable|variable), no debug info>"
|
||||
|
||||
gdb_test "p bssglobal" "= 0"
|
||||
gdb_test "whatis bssglobal" "<(data variable|variable), no debug info>"
|
||||
gdb_test "ptype bssglobal" "<(data variable|variable), no debug info>"
|
||||
|
||||
setup_xfail "rs6000*-*-aix*"
|
||||
setup_xfail "powerpc*-*-aix*"
|
||||
if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
|
||||
if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
|
||||
gdb_test "p bsslocal" "= 0"
|
||||
setup_xfail "rs6000*-*-aix*"
|
||||
setup_xfail "powerpc*-*-aix*"
|
||||
if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
|
||||
if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
|
||||
gdb_test "whatis bsslocal" "<(data variable|variable), no debug info>"
|
||||
setup_xfail "rs6000*-*-aix*"
|
||||
setup_xfail "powerpc*-*-aix*"
|
||||
if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
|
||||
if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
|
||||
gdb_test "ptype bsslocal" "<(data variable|variable), no debug info>"
|
||||
|
||||
if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
|
||||
gdb_test "backtrace 10" "#0.*inner.*#1.*middle.*#2.*top.*#3.*main.*" \
|
||||
"backtrace from inner in nodebug.exp"
|
||||
# Or if that doesn't work, at least hope for the external symbols
|
||||
# Commented out because if we aren't going to xfail the above test
|
||||
# ever, why bother with a weaker test?
|
||||
#gdb_test "backtrace 10" "#0.*inner.*#1.*#2.*top.*#3.*main.*" \
|
||||
# "backtrace from inner in nodebug.exp for externals"
|
||||
|
||||
# This test is not as obscure as it might look. `p getenv ("TERM")'
|
||||
# is a real-world example, at least on many systems.
|
||||
if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" "mips-sgi-irix6*" }
|
||||
if [target_info exists gdb,cannot_call_functions] {
|
||||
setup_xfail "*-*-*" 2416
|
||||
fail "p/c array_index(\"abcdef\",2)"
|
||||
} else {
|
||||
gdb_test {p/c array_index("abcdef",2)} " = 99 'c'"
|
||||
}
|
||||
|
||||
# Now, try that we can give names of file-local symbols which happen
|
||||
# to be unique, and have it still work
|
||||
if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
|
||||
if [runto middle] then {
|
||||
gdb_test "backtrace 10" "#0.*middle.*#1.*top.*#2.*main.*" \
|
||||
"backtrace from middle in nodebug.exp"
|
||||
}
|
||||
}
|
||||
244
gdb/testsuite/gdb.base/opaque.exp
Normal file
244
gdb/testsuite/gdb.base/opaque.exp
Normal file
@@ -0,0 +1,244 @@
|
||||
# Copyright (C) 1992, 1994, 1997 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# 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
|
||||
|
||||
set testfile "opaque"
|
||||
set binfile ${objdir}/${subdir}/opaque
|
||||
|
||||
#if { [gdb_compile "${srcdir}/${subdir}/opaque0.c ${srcdir}/${subdir}/opaque1.c" "${binfile}" executable {debug}] != "" } {
|
||||
# gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
#}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/opaque0.c" "${binfile}0.o" object {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/opaque1.c" "${binfile}1.o" object {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
if { [gdb_compile "${binfile}0.o ${binfile}1.o" ${binfile} executable {debug}] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
|
||||
# Create and source the file that provides information about the compiler
|
||||
# used to compile the test case.
|
||||
if [get_compiler_info ${binfile}] {
|
||||
return -1;
|
||||
}
|
||||
|
||||
# Start with a fresh gdb.
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
#
|
||||
# Test basic opaque structure handling (statically).
|
||||
# The ordering of the tests is significant. We first try the things that
|
||||
# might fail if gdb fails to connect the uses of opaque structures to
|
||||
# the actual opaque structure definition.
|
||||
|
||||
# When we start up, gdb sets the file containing main() as the current
|
||||
# source file. The actual structure foo is defined in a different file.
|
||||
# A pointer (foop) to an instance of the opaque struct is defined in the same
|
||||
# source file as main(). Ensure that gdb correctly "connected" the definition
|
||||
# in the other file with the pointer to the opaque struct in the file containing
|
||||
# "foop".
|
||||
|
||||
# Define a procedure to set up an xfail for all targets that do not support
|
||||
# this sort of cross reference.
|
||||
# Any target gcc that has a DBX_NO_XREFS definition in its config file will
|
||||
# not support it (FIXME: Is this still true; I suspect maybe not).
|
||||
|
||||
# Native alpha ecoff doesn't support it either.
|
||||
# I don't think this type of cross reference works for any COFF target
|
||||
# either.
|
||||
|
||||
proc setup_xfail_on_opaque_pointer {} {
|
||||
global gcc_compiled
|
||||
|
||||
setup_xfail "a29k-*-udi" "vax-*-*" "i*86-sequent-bsd*"
|
||||
if {!$gcc_compiled} then {
|
||||
setup_xfail "alpha-*-*" "mips-sgi-irix5*"
|
||||
}
|
||||
}
|
||||
|
||||
# This seems easier than trying to track different versions of xlc; I'm
|
||||
# not sure there is much rhyme or reason regarding which tests it fails
|
||||
# and which ones it passes.
|
||||
if {[istarget "rs6000-*-aix*"] && !$gcc_compiled} then {
|
||||
warning "xfails in opaque.exp may not be set up correctly for xlc"
|
||||
}
|
||||
|
||||
setup_xfail_on_opaque_pointer
|
||||
gdb_test "whatis foop" \
|
||||
"type = struct foo \[*\]+" \
|
||||
"whatis on opaque struct pointer (statically)"
|
||||
|
||||
|
||||
# Ensure that we know the form of the structure that foop points to.
|
||||
|
||||
setup_xfail_on_opaque_pointer
|
||||
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "hppa*-*-hpux*" }
|
||||
gdb_test "ptype foop" \
|
||||
"type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\} \[*\]+" \
|
||||
"ptype on opaque struct pointer (statically)"
|
||||
|
||||
|
||||
# An instance of the opaque structure (afoo) is defined in a different file.
|
||||
# Ensure that we can locate afoo and the structure definition.
|
||||
|
||||
gdb_test "whatis afoo" \
|
||||
"type = struct foo" \
|
||||
"whatis on opaque struct instance (statically)"
|
||||
|
||||
|
||||
# Ensure that we know the form of "afoo".
|
||||
|
||||
gdb_test "ptype afoo" \
|
||||
"type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\}" \
|
||||
"ptype on opaque struct instance (statically)"
|
||||
|
||||
|
||||
# Ensure that we know what a struct foo looks like.
|
||||
|
||||
gdb_test "ptype struct foo" \
|
||||
"type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\}" \
|
||||
"ptype on opaque struct tagname (statically)"
|
||||
|
||||
|
||||
#
|
||||
# Done with static tests, now test dynamic opaque structure handling.
|
||||
# We reload the symbol table so we forget about anything we might
|
||||
# have learned during the static tests.
|
||||
#
|
||||
|
||||
if [istarget "mips-idt-*"] then {
|
||||
# Restart because IDT/SIM runs out of file descriptors.
|
||||
gdb_exit
|
||||
gdb_start
|
||||
}
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
# Run to main, where struct foo is incomplete.
|
||||
if ![runto_main] {
|
||||
perror "cannot run to breakpoint at main"
|
||||
}
|
||||
|
||||
|
||||
# The current source file is now the one containing main(). The structure foo
|
||||
# is defined in a different file, but we have a pointer to an instance of
|
||||
# the opaque structure in the current file. Ensure we know it's type.
|
||||
|
||||
setup_xfail_on_opaque_pointer
|
||||
gdb_test "whatis foop" \
|
||||
"type = struct foo \[*\]+" \
|
||||
"whatis on opaque struct pointer (dynamically)"
|
||||
|
||||
|
||||
# Ensure that we know the form of the thing foop points to.
|
||||
|
||||
setup_xfail_on_opaque_pointer
|
||||
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "hppa*-*-hpux*" }
|
||||
gdb_test "ptype foop" \
|
||||
"type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\} \[*\]+" \
|
||||
"ptype on opaque struct pointer (dynamically) 1"
|
||||
|
||||
gdb_test "whatis afoo" \
|
||||
"type = struct foo" \
|
||||
"whatis on opaque struct instance (dynamically) 1"
|
||||
|
||||
|
||||
# Ensure that we know the form of afoo, an instance of a struct foo.
|
||||
|
||||
gdb_test "ptype afoo" \
|
||||
"type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\}" \
|
||||
"ptype on opaque struct instance (dynamically) 1"
|
||||
|
||||
|
||||
# Ensure that we know the form of an explicit struct foo.
|
||||
|
||||
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
|
||||
gdb_test "ptype struct foo" \
|
||||
"type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\}" \
|
||||
"ptype on opaque struct tagname (dynamically) 1"
|
||||
|
||||
|
||||
# Now reload the symbols again so we forget about anything we might
|
||||
# have learned reading the symbols during the previous tests.
|
||||
|
||||
if [istarget "mips-idt-*"] then {
|
||||
# Restart because IDT/SIM runs out of file descriptors.
|
||||
gdb_exit
|
||||
gdb_start
|
||||
}
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
# Run to getfoo, where struct foo is complete.
|
||||
if ![runto getfoo] {
|
||||
perror "cannot run to breakpoint at getfoo"
|
||||
}
|
||||
|
||||
|
||||
# Ensure that we know what foop is.
|
||||
|
||||
setup_xfail_on_opaque_pointer
|
||||
gdb_test "whatis foop" \
|
||||
"type = struct foo \[*\]+" \
|
||||
"whatis on opaque struct pointer (dynamically) 1"
|
||||
|
||||
|
||||
# Ensure that we know the form of the thing foop points to.
|
||||
|
||||
setup_xfail_on_opaque_pointer
|
||||
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "hppa*-*-hpux*" }
|
||||
gdb_test "ptype foop" \
|
||||
"type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\} \[*\]+" \
|
||||
"ptype on opaque struct pointer (dynamically) 2"
|
||||
|
||||
gdb_test "whatis afoo" \
|
||||
"type = struct foo" \
|
||||
"whatis on opaque struct instance (dynamically) 2"
|
||||
|
||||
|
||||
# Ensure that we know the form of afoo, an instance of a struct foo.
|
||||
|
||||
gdb_test "ptype afoo" \
|
||||
"type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\}" \
|
||||
"ptype on opaque struct instance (dynamically) 2"
|
||||
|
||||
|
||||
# Ensure that we know the form of an explicit struct foo.
|
||||
|
||||
gdb_test "ptype struct foo" \
|
||||
"type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\}" \
|
||||
"ptype on opaque struct tagname (dynamically) 2"
|
||||
20
gdb/testsuite/gdb.base/opaque0.c
Normal file
20
gdb/testsuite/gdb.base/opaque0.c
Normal file
@@ -0,0 +1,20 @@
|
||||
/* Note that struct foo is opaque (never defined) in this file. This
|
||||
is allowed by C since this file does not reference any members of
|
||||
the structure. The debugger needs to be able to associate this
|
||||
opaque structure definition with the full definition in another
|
||||
file.
|
||||
*/
|
||||
|
||||
struct foo *foop;
|
||||
extern struct foo *getfoo ();
|
||||
|
||||
int main ()
|
||||
{
|
||||
#ifdef usestubs
|
||||
set_debug_traps();
|
||||
breakpoint();
|
||||
#endif
|
||||
foop = getfoo ();
|
||||
putfoo (foop);
|
||||
return 0;
|
||||
}
|
||||
18
gdb/testsuite/gdb.base/opaque1.c
Normal file
18
gdb/testsuite/gdb.base/opaque1.c
Normal file
@@ -0,0 +1,18 @@
|
||||
struct foo {
|
||||
int a;
|
||||
int b;
|
||||
} afoo = { 1, 2};
|
||||
|
||||
struct foo *getfoo ()
|
||||
{
|
||||
return (&afoo);
|
||||
}
|
||||
|
||||
#ifdef __STDC__
|
||||
void putfoo (struct foo *foop)
|
||||
#else
|
||||
void putfoo (foop)
|
||||
struct foo *foop;
|
||||
#endif
|
||||
{
|
||||
}
|
||||
34
gdb/testsuite/gdb.base/overlays.c
Normal file
34
gdb/testsuite/gdb.base/overlays.c
Normal file
@@ -0,0 +1,34 @@
|
||||
/* Support program for testing gdb's ability to debug overlays
|
||||
in the inferior. */
|
||||
|
||||
#include "ovlymgr.h"
|
||||
|
||||
extern int foo PARAMS((int));
|
||||
extern int bar PARAMS((int));
|
||||
extern int baz PARAMS((int));
|
||||
extern int grbx PARAMS((int));
|
||||
|
||||
int main ()
|
||||
{
|
||||
int a, b, c, d, e;
|
||||
|
||||
OverlayLoad (0);
|
||||
OverlayLoad (4);
|
||||
a = foo (1);
|
||||
OverlayLoad (1);
|
||||
OverlayLoad (5);
|
||||
b = bar (1);
|
||||
OverlayLoad (2);
|
||||
OverlayLoad (6);
|
||||
c = baz (1);
|
||||
OverlayLoad (3);
|
||||
OverlayLoad (7);
|
||||
d = grbx (1);
|
||||
e = a + b + c + d;
|
||||
return (e != ('f' + 'o' +'o'
|
||||
+ 'b' + 'a' + 'r'
|
||||
+ 'b' + 'a' + 'z'
|
||||
+ 'g' + 'r' + 'b' + 'x'));
|
||||
|
||||
}
|
||||
|
||||
246
gdb/testsuite/gdb.base/overlays.exp
Normal file
246
gdb/testsuite/gdb.base/overlays.exp
Normal file
@@ -0,0 +1,246 @@
|
||||
# Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
#
|
||||
# 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
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
#
|
||||
# This file was written by Michael Snyder (msnyder@cygnus.com)
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
#
|
||||
# test running programs
|
||||
#
|
||||
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
if [istarget "d10v-*-*"] then {
|
||||
set linker_script "${srcdir}/${subdir}/d10v.ld";
|
||||
} elseif [istarget "m32r-*-*"] then {
|
||||
set linker_script "${srcdir}/${subdir}/m32r.ld";
|
||||
} else {
|
||||
verbose "Skipping overlay test -- not implemented for this target."
|
||||
return
|
||||
}
|
||||
|
||||
set testfile "overlays"
|
||||
set binfile ${objdir}/${subdir}/${testfile}
|
||||
set srcfile ${srcdir}/${subdir}/${testfile}.c
|
||||
set foo ${srcdir}/${subdir}/foo.c
|
||||
set bar ${srcdir}/${subdir}/bar.c
|
||||
set baz ${srcdir}/${subdir}/baz.c
|
||||
set grbx ${srcdir}/${subdir}/grbx.c
|
||||
|
||||
if {[gdb_compile "${srcfile}" "${testfile}.o" object {debug}] != ""} then {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
if {[gdb_compile "${srcdir}/${subdir}/ovlymgr.c" ovlymgr.o object {debug}] != ""} then {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
if {[gdb_compile "${foo}" foo.o object {debug} ] != ""} then {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
if {[gdb_compile "${bar}" bar.o object {debug}] != ""} then {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
if {[gdb_compile "${baz}" baz.o object {debug}] != ""} then {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
if {[gdb_compile "${grbx}" grbx.o object {debug}] != ""} then {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
if {[gdb_compile "${testfile}.o ovlymgr.o foo.o bar.o baz.o grbx.o" ${binfile} executable "ldscript=-Wl,-T$linker_script"] != "" } {
|
||||
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
}
|
||||
|
||||
remote_exec build "mv ${testfile}.o foo.o bar.o baz.o grbx.o ovlymgr.o ${objdir}/${subdir}"
|
||||
|
||||
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
#
|
||||
# set it up at a breakpoint so we can play with the variable values
|
||||
#
|
||||
|
||||
if ![runto_main] then {
|
||||
gdb_suppress_tests;
|
||||
}
|
||||
|
||||
# couple of convenience variables
|
||||
set fptrcast [string_to_regexp "(int (*)(int))"]
|
||||
set iptrcast [string_to_regexp "(int *)"]
|
||||
|
||||
gdb_test "overlay manual" ""
|
||||
gdb_test "overlay list" "No sections are mapped." "List with none mapped"
|
||||
|
||||
# capture the LMA addresses of [foo bar baz grbx foox barx bazx grbxx]
|
||||
|
||||
gdb_test "print \$foo_lma = &foo" \
|
||||
".* $fptrcast 0x.* <\\*foo\\*>" "foo load addr"
|
||||
gdb_test "print \$bar_lma = &bar" \
|
||||
".* $fptrcast 0x.* <\\*bar\\*>" "bar load addr"
|
||||
gdb_test "print \$baz_lma = &baz" \
|
||||
".* $fptrcast 0x.* <\\*baz\\*>" "baz load addr"
|
||||
gdb_test "print \$grbx_lma = &grbx" \
|
||||
".* $fptrcast 0x.* <\\*grbx\\*>" "grbx load addr"
|
||||
gdb_test "print \$foox_lma = &foox" \
|
||||
".* $iptrcast 0x.*" "foox load addr"
|
||||
gdb_test "print \$barx_lma = &barx" \
|
||||
".* $iptrcast 0x.*" "barx load addr"
|
||||
gdb_test "print \$bazx_lma = &bazx" \
|
||||
".* $iptrcast 0x.*" "bazx load addr"
|
||||
gdb_test "print \$grbxx_lma = &grbxx" \
|
||||
".* $iptrcast 0x.*" "grbxx load addr"
|
||||
|
||||
# map each overlay successively, and
|
||||
# capture the VMA addresses of [foo bar baz grbx foox barx bazx grbxx]
|
||||
|
||||
gdb_test "overlay map .ovly0" ""
|
||||
gdb_test "overlay list" "Section .ovly0, loaded at.*, mapped at.*" "List ovly0"
|
||||
gdb_test "print \$foo_vma = &foo" \
|
||||
".* $fptrcast 0x.* <foo>" "foo runtime addr"
|
||||
|
||||
gdb_test "overlay map .ovly1" ""
|
||||
gdb_test "overlay list" "Section .ovly1, loaded at.*, mapped at.*" "List ovly1"
|
||||
gdb_test "print \$bar_vma = &bar" \
|
||||
".* $fptrcast 0x.* <bar>" "bar runtime addr"
|
||||
|
||||
gdb_test "overlay map .ovly2" ""
|
||||
gdb_test "overlay list" "Section .ovly2, loaded at.*, mapped at.*" "List ovly2"
|
||||
gdb_test "print \$baz_vma = &baz" \
|
||||
".* $fptrcast 0x.* <baz>" "baz runtime addr"
|
||||
|
||||
gdb_test "overlay map .ovly3" ""
|
||||
gdb_test "overlay list" "Section .ovly3, loaded at.*, mapped at.*" "List ovly3"
|
||||
gdb_test "print \$grbx_vma = &grbx" \
|
||||
".* $fptrcast 0x.* <grbx>" "grbx runtime addr"
|
||||
|
||||
gdb_test "overlay map .data00" ""
|
||||
gdb_test "overlay list" "Section .data00, loaded .*, mapped .*" "List data00"
|
||||
gdb_test "print \$foox_vma = &foox" \
|
||||
".* $iptrcast 0x.*" "foox runtime addr"
|
||||
|
||||
gdb_test "overlay map .data01" ""
|
||||
gdb_test "overlay list" "Section .data01, loaded .*, mapped .*" "List data01"
|
||||
gdb_test "print \$barx_vma = &barx" \
|
||||
".* $iptrcast 0x.*" "barx runtime addr"
|
||||
|
||||
gdb_test "overlay map .data02" ""
|
||||
gdb_test "overlay list" "Section .data02, loaded .*, mapped .*" "List data02"
|
||||
gdb_test "print \$bazx_vma = &bazx" \
|
||||
".* $iptrcast 0x.*" "bazx runtime addr"
|
||||
|
||||
gdb_test "overlay map .data03" ""
|
||||
gdb_test "overlay list" "Section .data03, loaded .*, mapped .*" "List data03"
|
||||
gdb_test "print \$grbxx_vma = &grbxx" \
|
||||
".* $iptrcast 0x.*" "grbxx runtime addr"
|
||||
|
||||
# Verify that LMA != VMA
|
||||
|
||||
gdb_test "print \$foo_lma != \$foo_vma" ".* = 1" "foo's LMA != VMA"
|
||||
gdb_test "print \$bar_lma != \$bar_vma" ".* = 1" "bar's LMA != VMA"
|
||||
gdb_test "print \$baz_lma != \$baz_vma" ".* = 1" "baz's LMA != VMA"
|
||||
gdb_test "print \$grbx_lma != \$grbx_vma" ".* = 1" "grbx's LMA != VMA"
|
||||
gdb_test "print \$foox_lma != \$foox_vma" ".* = 1" "foox's LMA != VMA"
|
||||
gdb_test "print \$barx_lma != \$barx_vma" ".* = 1" "barx's LMA != VMA"
|
||||
gdb_test "print \$bazx_lma != \$bazx_vma" ".* = 1" "bazx's LMA != VMA"
|
||||
gdb_test "print \$grbxx_lma != \$grbxx_vma" ".* = 1" "grbxx's LMA != VMA"
|
||||
|
||||
# Verify that early-mapped overlays have been bumped out
|
||||
# by later-mapped overlays layed over in the same VMA range.
|
||||
|
||||
send_gdb "overlay list\n"
|
||||
gdb_expect {
|
||||
-re ".*ovly0, " { fail ".ovly0 not unmapped by .ovly1" }
|
||||
-re ".*ovly2, " { fail ".ovly2 not unmapped by .ovly3" }
|
||||
-re ".*data00," { fail ".data00 not unmapped by .data01" }
|
||||
-re ".*data02," { fail ".data02 not unmapped by .data03" }
|
||||
-re ".*$gdb_prompt $" { pass "Automatic unmapping" }
|
||||
timeout { fail "(timeout) Automatic unmapping" }
|
||||
}
|
||||
|
||||
# test automatic mode
|
||||
|
||||
gdb_test "overlay auto" ""
|
||||
gdb_test "overlay list" "No sections are mapped." "List none mapped (auto)"
|
||||
gdb_test "break foo" "Breakpoint .*at .*file .*foo.c.*" "break foo"
|
||||
gdb_test "break bar" "Breakpoint .*at .*file .*bar.c.*" "break bar"
|
||||
gdb_test "break baz" "Breakpoint .*at .*file .*baz.c.*" "break baz"
|
||||
gdb_test "break grbx" "Breakpoint .*at .*file .*grbx.c.*" "break grbx"
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint .* foo .x=1. at .*$gdb_prompt $" { pass "hit foo" }
|
||||
-re ".*$gdb_prompt $" { fail "hit foo" }
|
||||
timeout { fail "(timeout) hit foo" }
|
||||
}
|
||||
|
||||
send_gdb "backtrace\n"
|
||||
gdb_expect {
|
||||
-re "#0 .*foo .*#1 .*main .*$gdb_prompt $" { pass "BT foo" }
|
||||
-re ".*$gdb_prompt $" { fail "BT foo" }
|
||||
timeout { fail "(timeout) BT foo" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint .* bar .x=1. at .*$gdb_prompt $" { pass "hit bar" }
|
||||
-re ".*$gdb_prompt $" { fail "hit bar" }
|
||||
timeout { fail "(timeout) hit bar" }
|
||||
}
|
||||
|
||||
send_gdb "backtrace\n"
|
||||
gdb_expect {
|
||||
-re "#0 .*bar .*#1 .*main .*$gdb_prompt $" { pass "BT bar" }
|
||||
-re ".*$gdb_prompt $" { fail "BT bar" }
|
||||
timeout { fail "(timeout) BT bar" }
|
||||
}
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint .* baz .x=1. at .*$gdb_prompt $" { pass "hit baz" }
|
||||
-re ".*$gdb_prompt $" { fail "hit baz" }
|
||||
timeout { fail "(timeout) hit baz" }
|
||||
}
|
||||
|
||||
send_gdb "backtrace\n"
|
||||
gdb_expect {
|
||||
-re "#0 .*baz .*#1 .*main .*$gdb_prompt $" { pass "BT baz" }
|
||||
-re ".*$gdb_prompt $" { fail "BT baz" }
|
||||
timeout { fail "(timeout) BT baz" }
|
||||
}
|
||||
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re "Breakpoint .* grbx .x=1. at .*$gdb_prompt $" { pass "hit grbx" }
|
||||
-re ".*$gdb_prompt $" { fail "hit grbx" }
|
||||
timeout { fail "(timeout) hit grbx" }
|
||||
}
|
||||
|
||||
send_gdb "backtrace\n"
|
||||
gdb_expect {
|
||||
-re "#0 .*grbx .*#1 .*main .*$gdb_prompt $" { pass "BT grbx" }
|
||||
-re ".*$gdb_prompt $" { fail "BT grbx" }
|
||||
timeout { fail "(timeout) BT grbx" }
|
||||
}
|
||||
|
||||
225
gdb/testsuite/gdb.base/ovlymgr.c
Normal file
225
gdb/testsuite/gdb.base/ovlymgr.c
Normal file
@@ -0,0 +1,225 @@
|
||||
|
||||
/*
|
||||
* Ovlymgr.c -- Runtime Overlay Manager for the GDB testsuite.
|
||||
*/
|
||||
|
||||
#include "ovlymgr.h"
|
||||
|
||||
/* Local functions and data: */
|
||||
|
||||
extern unsigned long _ovly_table[][4];
|
||||
extern unsigned long _novlys __attribute__ ((section (".data")));
|
||||
enum ovly_index { VMA, SIZE, LMA, MAPPED};
|
||||
|
||||
static void ovly_copy (unsigned long dst, unsigned long src, long size);
|
||||
|
||||
/* Flush the data and instruction caches at address START for SIZE bytes.
|
||||
Support for each new port must be added here. */
|
||||
/* FIXME: Might be better to have a standard libgloss function that
|
||||
ports provide that we can then use. Use libgloss instead of newlib
|
||||
since libgloss is the one intended to handle low level system issues.
|
||||
I would suggest something like _flush_cache to avoid the user's namespace
|
||||
but not be completely obscure as other things may need this facility. */
|
||||
|
||||
static void
|
||||
FlushCache (void)
|
||||
{
|
||||
#ifdef __M32R__
|
||||
volatile char *mspr = (char *) 0xfffffff7;
|
||||
*mspr = 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* OverlayLoad:
|
||||
* Copy the overlay into its runtime region,
|
||||
* and mark the overlay as "mapped".
|
||||
*/
|
||||
|
||||
bool
|
||||
OverlayLoad (unsigned long ovlyno)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
if (ovlyno < 0 || ovlyno >= _novlys)
|
||||
exit (-1); /* fail, bad ovly number */
|
||||
|
||||
if (_ovly_table[ovlyno][MAPPED])
|
||||
return TRUE; /* this overlay already mapped -- nothing to do! */
|
||||
|
||||
for (i = 0; i < _novlys; i++)
|
||||
if (i == ovlyno)
|
||||
_ovly_table[i][MAPPED] = 1; /* this one now mapped */
|
||||
else if (_ovly_table[i][VMA] == _ovly_table[ovlyno][VMA])
|
||||
_ovly_table[i][MAPPED] = 0; /* this one now un-mapped */
|
||||
|
||||
ovly_copy (_ovly_table[ovlyno][VMA],
|
||||
_ovly_table[ovlyno][LMA],
|
||||
_ovly_table[ovlyno][SIZE]);
|
||||
|
||||
FlushCache ();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* OverlayUnload:
|
||||
* Copy the overlay back into its "load" region.
|
||||
* Does NOT mark overlay as "unmapped", therefore may be called
|
||||
* more than once for the same mapped overlay.
|
||||
*/
|
||||
|
||||
bool
|
||||
OverlayUnload (unsigned long ovlyno)
|
||||
{
|
||||
if (ovlyno < 0 || ovlyno >= _novlys)
|
||||
exit (-1); /* fail, bad ovly number */
|
||||
|
||||
if (!_ovly_table[ovlyno][MAPPED])
|
||||
exit (-1); /* error, can't copy out a segment that's not "in" */
|
||||
|
||||
ovly_copy (_ovly_table[ovlyno][LMA],
|
||||
_ovly_table[ovlyno][VMA],
|
||||
_ovly_table[ovlyno][SIZE]);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef __D10V__
|
||||
#define IMAP0 (*(short *)(0xff00))
|
||||
#define IMAP1 (*(short *)(0xff02))
|
||||
#define DMAP (*(short *)(0xff04))
|
||||
|
||||
static void
|
||||
D10VTranslate (unsigned long logical,
|
||||
short *dmap,
|
||||
unsigned long **addr)
|
||||
{
|
||||
unsigned long physical;
|
||||
unsigned long seg;
|
||||
unsigned long off;
|
||||
|
||||
/* to access data, we use the following mapping
|
||||
0x00xxxxxx: Logical data address segment (DMAP translated memory)
|
||||
0x01xxxxxx: Logical instruction address segment (IMAP translated memory)
|
||||
0x10xxxxxx: Physical data memory segment (On-chip data memory)
|
||||
0x11xxxxxx: Physical instruction memory segment (On-chip insn memory)
|
||||
0x12xxxxxx: Phisical unified memory segment (Unified memory)
|
||||
*/
|
||||
|
||||
/* Addresses must be correctly aligned */
|
||||
if (logical & (sizeof (**addr) - 1))
|
||||
exit (-1);
|
||||
|
||||
/* If the address is in one of the two logical address spaces, it is
|
||||
first translated into a physical address */
|
||||
seg = (logical >> 24);
|
||||
off = (logical & 0xffffffL);
|
||||
switch (seg)
|
||||
{
|
||||
case 0x00: /* in logical data address segment */
|
||||
if (off <= 0x7fffL)
|
||||
physical = (0x10L << 24) + off;
|
||||
else
|
||||
/* Logical address out side of on-chip segment, not
|
||||
supported */
|
||||
exit (-1);
|
||||
break;
|
||||
case 0x01: /* in logical instruction address segment */
|
||||
{
|
||||
short map;
|
||||
if (off <= 0x1ffffL)
|
||||
map = IMAP0;
|
||||
else if (off <= 0x3ffffL)
|
||||
map = IMAP1;
|
||||
else
|
||||
/* Logical address outside of IMAP[01] segment, not
|
||||
supported */
|
||||
exit (-1);
|
||||
if (map & 0x1000L)
|
||||
{
|
||||
/* Instruction memory */
|
||||
physical = (0x11L << 24) | off;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Unified memory */
|
||||
physical = ((map & 0x7fL) << 17) + (off & 0x1ffffL);
|
||||
if (physical > 0xffffffL)
|
||||
/* Address outside of unified address segment */
|
||||
exit (-1);
|
||||
physical |= (0x12L << 24);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0x10:
|
||||
case 0x11:
|
||||
case 0x12:
|
||||
physical = logical;
|
||||
break;
|
||||
default:
|
||||
exit (-1); /* error */
|
||||
}
|
||||
|
||||
seg = (physical >> 24);
|
||||
off = (physical & 0xffffffL);
|
||||
switch (seg)
|
||||
{
|
||||
case 0x10: /* dst is a 15 bit offset into the on-chip memory */
|
||||
*dmap = 0;
|
||||
*addr = (long *) (0x0000 + ((short)off & 0x7fff));
|
||||
break;
|
||||
case 0x11: /* dst is an 18-bit offset into the on-chip
|
||||
instruction memory */
|
||||
*dmap = 0x1000L | ((off & 0x3ffffL) >> 14);
|
||||
*addr = (long *) (0x8000 + ((short)off & 0x3fff));
|
||||
break;
|
||||
case 0x12: /* dst is a 24-bit offset into unified memory */
|
||||
*dmap = off >> 14;
|
||||
*addr = (long *) (0x8000 + ((short)off & 0x3fff));
|
||||
break;
|
||||
default:
|
||||
exit (-1); /* error */
|
||||
}
|
||||
}
|
||||
#endif /* __D10V__ */
|
||||
|
||||
static void
|
||||
ovly_copy (unsigned long dst, unsigned long src, long size)
|
||||
{
|
||||
#ifdef __M32R__
|
||||
memcpy ((void *) dst, (void *) src, size);
|
||||
return;
|
||||
#endif /* M32R */
|
||||
|
||||
#ifdef __D10V__
|
||||
unsigned long *s, *d, tmp;
|
||||
short dmap_src, dmap_dst;
|
||||
short dmap_save;
|
||||
|
||||
/* all section sizes should by multiples of 4 bytes */
|
||||
dmap_save = DMAP;
|
||||
|
||||
D10VTranslate (src, &dmap_src, &s);
|
||||
D10VTranslate (dst, &dmap_dst, &d);
|
||||
|
||||
while (size > 0)
|
||||
{
|
||||
/* NB: Transfer 4 byte (long) quantites, problems occure
|
||||
when only two bytes are transfered */
|
||||
DMAP = dmap_src;
|
||||
tmp = *s;
|
||||
DMAP = dmap_dst;
|
||||
*d = tmp;
|
||||
d++;
|
||||
s++;
|
||||
size -= sizeof (tmp);
|
||||
src += sizeof (tmp);
|
||||
dst += sizeof (tmp);
|
||||
if ((src & 0x3fff) == 0)
|
||||
D10VTranslate (src, &dmap_src, &s);
|
||||
if ((dst & 0x3fff) == 0)
|
||||
D10VTranslate (dst, &dmap_dst, &d);
|
||||
}
|
||||
DMAP = dmap_save;
|
||||
#endif /* D10V */
|
||||
}
|
||||
|
||||
17
gdb/testsuite/gdb.base/ovlymgr.h
Normal file
17
gdb/testsuite/gdb.base/ovlymgr.h
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Sample runtime overlay manager.
|
||||
*/
|
||||
|
||||
#ifdef NO_PROTOTYPES
|
||||
#define PARAMS(paramlist) ()
|
||||
#else
|
||||
#define PARAMS(paramlist) paramlist
|
||||
#endif
|
||||
|
||||
typedef enum { FALSE, TRUE } bool;
|
||||
|
||||
/* Entry Points: */
|
||||
|
||||
bool OverlayLoad PARAMS((unsigned long ovlyno));
|
||||
bool OverlayUnload PARAMS((unsigned long ovlyno));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user