* gdb.base/Makefile.in: Add action to .c.o transformation

rule that generates a .ci file for each .o file and remove
	explicit .c.o rules except for callfuncs.o.
	* gdb.c++/Makefile.in:  Add .cc.o transformation rule that
	generates a .ci file for each .o file and remove explicit
	.cc.o rules.
	(clean): Remove *.tmp *.ci files.
	(EXECUTABLES): Remove templ-info.exp.
	* gdb.base/compiler.c: New file.
	* gdb.c++/compiler.cc: New file
	* gdb.base/scope.exp: Source gdb.base/scope.ci.
	Change rs6000-*-* xfail for
	"print 'scope0.c'::filelocal_ro" and
	"print 'scope1.c'::filelocal" and
	"print 'scope1.c'::filelocal_bss" and
	"print 'scope1.c'::filelocal_ro" and
	"print 'scope1.c'::foo::funclocal" and
	"print 'scope1.c'::foo::funclocal_ro" and
	"print 'scope1.c'::bar::funclocal" and
	"print 'scope0.c'::filelocal_ro" and
	"print 'scope1.c'::filelocal at foo" and
	"print 'scope1.c'::filelocal_bss at foo" and
	"print 'scope1.c'::filelocal_ro at foo" and
	"print 'scope1.c'::foo::funclocal at foo" and
	"print 'scope1.c'::foo::funclocal_bss at foo" and
	"print 'scope1.c'::foo::funclocal_ro at foo" and
	"print 'scope1.c'::bar::funclocal at foo" and
	"print 'scope0.c'::filelocal_ro" and
	"print 'scope1.c'::filelocal" and
	"print 'scope1.c'::filelocal_bss" and
	"print 'scope1.c'::filelocal_ro" and
	"print 'scope1.c'::foo::funclocal" and
	"print 'scope1.c'::foo::funclocal_bss" and
	"print 'scope1.c'::foo::funclocal_ro" and
	"print 'scope1.c'::bar::funclocal" and
	"print 'scope1.c'::bar::funclocal_bss"
	to only be xfail'd when not compiled with gcc.
	Add rs6000-*-* xfail for
	"print 'scope0.c'::filelocal_bss before run"
	when compiled with gcc.
	(test_at_main): Add rs6000-*-* xfail for
	"print filelocal_ro in test_at_main"
	when compiled with gcc.
	* gdb.base/ptype.exp: Source gdb.base/ptype.ci.
 	Add rs6000-*-aix* xfail for
	"whatis unnamed typedef'd enum (compiler bug in IBM's xlc)" and
	"ptype t_char_array",  not compiled with gcc.
	* gdb.base/list.exp (test_list_function):  Add rs6000-*-*
	xfail for "list foo (in include file)" when gcc	compiled.
	* gdb.base/funcargs.exp: Source gdb.base/funcargs.ci
 	(integral_args): Add rs6000-*-* xfail for
	"run to call0a" if not compiled with gcc.
	(unsigned_integral_args): Add rs6000-*-* xfail for
	"run to call1a" if not compiled with gcc.
	(float_and_integral_args):  Add rs6000-*-* xfail for
	"run to call2a" if not compiled with gcc and for
	"continue to call2b" for any compiler.
	Add rs6000-*-* xfail to
	"print f1 after run to call2a" for gcc compiled.
	(discard_and_shuffle): Add rs6000-*-* xfail for
	"run to call6a".
	(shuffle_round_robin): Add rs6000-*-* xfail for
	"backtrace from call7a" if not compiled with gcc.
	Add rs6000-*-* xfail for
	"backtrace from call7b" if compiled with gcc.
	(call_after_alloca): Add rs6000-*-* xfail for
	"print c in call_after_alloca" and
	"print s in call_after_alloca" and
	"backtrace from call_after_alloca_subr"
	if not compiled with gcc.
	(localvars_in_indirect_call): Add rs6000-*-* xfail for
	"print c in localvars_in_indirect_call" and
	"print c in localvars_in_indirect_call" and
	"backtrace in indirectly called function" and
	"stepping into indirectly called function"
	if not compiled with gcc.
	(localvars_after_alloca): Add rs6000-*-* xfail for
	"print c after runto localvars_after_alloca" and
	"print s after runto localvars_after_alloca" and
	"print i after runto localvars_after_alloca" and
	"print l after runto localvars_after_alloca"
	for all compilers.
	* gdb.base/whatis.exp: Source gdb.base/whatis.ci rather
	than whatis-info.exp.
	* gdb.base/opaque.exp: Source gdb.base/opaque0.ci rather
	than opaque-info.exp.
	Setup rs6000-*-* xfail for
	"ptype on opaque struct pointer (statically)" and
	"ptype on opaque struct pointer (dynamically)" when
	not compiled with gcc.
	* gdb.base/callfuncs.exp: Source gdb.base/callfuncs.ci
	rather than callf-info.exp.
	(do_function_calls):  Add clear_xfail for rs6000-*-* for
	"p t_float_values2(3.14159,float_val2)".  Seems to work
	fine there, both with xlc and gcc.  Need to find out what
	it is doing right and fix other platforms.
	* gdb.base/callfuncs.exp: Add rs6000-*-* xfail for
	"call inferior func with struct - returns int",
	"call inferior func with struct - returns long",
	"call inferior func with struct - returns float",
	"call inferior func with struct - returns double",
	"call inferior func with struct - returns char *",
	but only if not gcc compiled (presumes xlc compiled).
	Change rs6000-*-* xfails for
	"call inferior func with struct - returns char" and
	" call inferior func with struct -  returns short" to only
	xfail if not using gcc.
	(clean mostlyclean):  Remove *.ci and *.tmp files.
	* gdb.c++/templates.exp: Source gdb.c++/templates.ci rather
	than templ-info.exp.
	* gdb.base/langs.exp:  Source gdb.base/langs.ci.
	Add rs6000-*-* xfail for "up to foo in langs.exp"
	"up to cppsub_ in langs.exp" and "up to fsub in langs.exp"
 	when not gcc compiled.
This commit is contained in:
Fred Fish 1995-08-16 07:37:19 +00:00
parent 54b8ecb5f1
commit ce102e96e6
12 changed files with 406 additions and 312 deletions

View file

@ -1,3 +1,120 @@
Tue Aug 15 09:42:44 1995 Fred Fish <fnf@cygnus.com>
* gdb.base/Makefile.in: Add action to .c.o transformation
rule that generates a .ci file for each .o file and remove
explicit .c.o rules except for callfuncs.o.
* gdb.c++/Makefile.in: Add .cc.o transformation rule that
generates a .ci file for each .o file and remove explicit
.cc.o rules.
(clean): Remove *.tmp *.ci files.
(EXECUTABLES): Remove templ-info.exp.
* gdb.base/compiler.c: New file.
* gdb.c++/compiler.cc: New file
* gdb.base/scope.exp: Source gdb.base/scope.ci.
Change rs6000-*-* xfail for
"print 'scope0.c'::filelocal_ro" and
"print 'scope1.c'::filelocal" and
"print 'scope1.c'::filelocal_bss" and
"print 'scope1.c'::filelocal_ro" and
"print 'scope1.c'::foo::funclocal" and
"print 'scope1.c'::foo::funclocal_ro" and
"print 'scope1.c'::bar::funclocal" and
"print 'scope0.c'::filelocal_ro" and
"print 'scope1.c'::filelocal at foo" and
"print 'scope1.c'::filelocal_bss at foo" and
"print 'scope1.c'::filelocal_ro at foo" and
"print 'scope1.c'::foo::funclocal at foo" and
"print 'scope1.c'::foo::funclocal_bss at foo" and
"print 'scope1.c'::foo::funclocal_ro at foo" and
"print 'scope1.c'::bar::funclocal at foo" and
"print 'scope0.c'::filelocal_ro" and
"print 'scope1.c'::filelocal" and
"print 'scope1.c'::filelocal_bss" and
"print 'scope1.c'::filelocal_ro" and
"print 'scope1.c'::foo::funclocal" and
"print 'scope1.c'::foo::funclocal_bss" and
"print 'scope1.c'::foo::funclocal_ro" and
"print 'scope1.c'::bar::funclocal" and
"print 'scope1.c'::bar::funclocal_bss"
to only be xfail'd when not compiled with gcc.
Add rs6000-*-* xfail for
"print 'scope0.c'::filelocal_bss before run"
when compiled with gcc.
(test_at_main): Add rs6000-*-* xfail for
"print filelocal_ro in test_at_main"
when compiled with gcc.
* gdb.base/ptype.exp: Source gdb.base/ptype.ci.
Add rs6000-*-aix* xfail for
"whatis unnamed typedef'd enum (compiler bug in IBM's xlc)" and
"ptype t_char_array", not compiled with gcc.
* gdb.base/list.exp (test_list_function): Add rs6000-*-*
xfail for "list foo (in include file)" when gcc compiled.
* gdb.base/funcargs.exp: Source gdb.base/funcargs.ci
(integral_args): Add rs6000-*-* xfail for
"run to call0a" if not compiled with gcc.
(unsigned_integral_args): Add rs6000-*-* xfail for
"run to call1a" if not compiled with gcc.
(float_and_integral_args): Add rs6000-*-* xfail for
"run to call2a" if not compiled with gcc and for
"continue to call2b" for any compiler.
Add rs6000-*-* xfail to
"print f1 after run to call2a" for gcc compiled.
(discard_and_shuffle): Add rs6000-*-* xfail for
"run to call6a".
(shuffle_round_robin): Add rs6000-*-* xfail for
"backtrace from call7a" if not compiled with gcc.
Add rs6000-*-* xfail for
"backtrace from call7b" if compiled with gcc.
(call_after_alloca): Add rs6000-*-* xfail for
"print c in call_after_alloca" and
"print s in call_after_alloca" and
"backtrace from call_after_alloca_subr"
if not compiled with gcc.
(localvars_in_indirect_call): Add rs6000-*-* xfail for
"print c in localvars_in_indirect_call" and
"print c in localvars_in_indirect_call" and
"backtrace in indirectly called function" and
"stepping into indirectly called function"
if not compiled with gcc.
(localvars_after_alloca): Add rs6000-*-* xfail for
"print c after runto localvars_after_alloca" and
"print s after runto localvars_after_alloca" and
"print i after runto localvars_after_alloca" and
"print l after runto localvars_after_alloca"
for all compilers.
* gdb.base/whatis.exp: Source gdb.base/whatis.ci rather
than whatis-info.exp.
* gdb.base/opaque.exp: Source gdb.base/opaque0.ci rather
than opaque-info.exp.
Setup rs6000-*-* xfail for
"ptype on opaque struct pointer (statically)" and
"ptype on opaque struct pointer (dynamically)" when
not compiled with gcc.
* gdb.base/callfuncs.exp: Source gdb.base/callfuncs.ci
rather than callf-info.exp.
(do_function_calls): Add clear_xfail for rs6000-*-* for
"p t_float_values2(3.14159,float_val2)". Seems to work
fine there, both with xlc and gcc. Need to find out what
it is doing right and fix other platforms.
* gdb.base/callfuncs.exp: Add rs6000-*-* xfail for
"call inferior func with struct - returns int",
"call inferior func with struct - returns long",
"call inferior func with struct - returns float",
"call inferior func with struct - returns double",
"call inferior func with struct - returns char *",
but only if not gcc compiled (presumes xlc compiled).
Change rs6000-*-* xfails for
"call inferior func with struct - returns char" and
" call inferior func with struct - returns short" to only
xfail if not using gcc.
(clean mostlyclean): Remove *.ci and *.tmp files.
* gdb.c++/templates.exp: Source gdb.c++/templates.ci rather
than templ-info.exp.
* gdb.base/langs.exp: Source gdb.base/langs.ci.
Add rs6000-*-* xfail for "up to foo in langs.exp"
"up to cppsub_ in langs.exp" and "up to fsub in langs.exp"
when not gcc compiled.
Sat Aug 12 15:05:36 1995 Jeffrey A. Law <law@rtl.cygnus.com>
* gdb.base/callfuncs.exp: Add xfails for the powerpc.
@ -17,6 +134,24 @@ Fri Aug 11 13:36:20 1995 Jeff Law (law@snake.cs.utah.edu)
failure (opcode table has been fixed to match reality).
end-sanitize-sh3e
Mon Aug 14 09:01:59 1995 Fred Fish <fnf@rtl.cygnus.com>
* gdb.base/callfuncs.exp: Add rs6000-*-* xfails for
"call inferior func with struct - returns char",
"call inferior func with struct - returns short"
* gdb.base/scope.exp: Remove rs6000-*-* xfails for
"print 'scope0.c'::filelocal at main",
"print 'scope0.c'::filelocal_bss in test_at_main",
"print 'scope0.c'::filelocal at foo",
"print 'scope0.c'::filelocal_bss in test_at_foo",
"print 'scope0.c'::filelocal at bar",
"print 'scope0.c'::filelocal_bss in test_at_bar"
* gdb.base/list.exp: Remove rs6000-*-* xfail for "list function
in source file 1". This bug seems to have been fixed with both
gcc and native cc (was native assembler bug?).
Wed Aug 9 08:04:12 1995 Fred Fish (fnf@cygnus.com)
* gdb.base/a1-selftest.exp: Change "i*86-*-sysv4" xfail for

View file

@ -34,6 +34,7 @@ break.exp
callfuncs.c
callfuncs.exp
commands.exp
compiler.c
configure.in
corefile.exp
coremaker.c
@ -68,7 +69,6 @@ mips_pro.c
mips_pro.exp
nodebug.c
nodebug.exp
opaque-info.c
opaque.exp
opaque0.c
opaque1.c
@ -99,7 +99,6 @@ twice.c
twice.exp
watchpoint.c
watchpoint.exp
whatis-info.c
whatis.c
whatis.exp

View file

@ -14,8 +14,8 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
srcdir = .
prefix = /usr/local
@ -99,7 +99,6 @@ EXECUTABLES = \
mips_pro \
nodebug \
opaque \
opaque-info.exp \
printcmds \
ptype \
recurse \
@ -112,7 +111,6 @@ EXECUTABLES = \
twice \
watchpoint \
whatis \
whatis-info.exp \
$(CROSS_EXECUTABLES)
# List of test executables that we have available. They are kept in
@ -130,23 +128,18 @@ CROSS_EXECUTABLES = \
.c.o:
$(CC) -c $(CFLAGS) $<
$(CC) -E $(CFLAGS) $(srcdir)/compiler.c >$*.tmp
mv $*.tmp $*.ci
all: $(EXECUTABLES)
run: run.o
$(CC) $(CFLAGS) $(LDFLAGS) -o run run.o $(LIBS)
# We want to make sure comp-info.exp reflects the way that whatis was compiled;
# that's why this isn't a separate rule.
whatis: whatis.o
$(CC) $(CFLAGS) $(LDFLAGS) -o whatis whatis.o $(LIBS)
whatis whatis-info.exp: whatis.o
$(CC) $(CFLAGS) $(LDFLAGS) -o whatis.tmp whatis.o $(LIBS)
$(CC) $(CFLAGS) -E $(srcdir)/whatis-info.c >whatis-info.tmp
mv whatis-info.tmp whatis-info.exp
mv whatis.tmp whatis
.PRECIOUS: whatis whatis-info.exp
.PRECIOUS: whatis
ptype: ptype.o
$(CC) $(CFLAGS) $(LDFLAGS) -o ptype ptype.o $(LIBS)
@ -177,14 +170,8 @@ watchpoint: watchpoint.o
recurse: recurse.o
$(CC) $(CFLAGS) $(LDFLAGS) -o recurse recurse.o $(LIBS)
# We want to make sure opaque-info.exp reflects the way that opaque
# was compiled; that's why this isn't a separate rule.
opaque opaque-info.exp: opaque0.o opaque1.o
$(CC) $(CFLAGS) $(LDFLAGS) -o opaque.tmp opaque0.o opaque1.o $(LIBS)
$(CC) $(CFLAGS) -E $(srcdir)/opaque-info.c >opaque-info.tmp
mv opaque-info.tmp opaque-info.exp
mv opaque.tmp opaque
opaque: opaque0.o opaque1.o
$(CC) $(CFLAGS) $(LDFLAGS) -o opaque opaque0.o opaque1.o $(LIBS)
coremaker: coremaker.o
$(CC) $(CFLAGS) $(LDFLAGS) -o coremaker coremaker.o $(LIBS)
@ -254,10 +241,12 @@ printcmds: printcmds.o
# Try compiling this with prototypes, if that fails maybe the compiler
# is a pre-ANSI compiler, in which case don't use prototypes.
callfuncs.o: callfuncs.c
(echo set prototypes 1 > callf-info.exp; \
(echo set prototypes 1 >callfuncs.tmp; \
$(CC) -c $(CFLAGS) $(srcdir)/callfuncs.c 2>/dev/null) \
|| (echo set prototypes 0 > callf-info.exp; \
|| (echo set prototypes 0 >callfuncs.tmp; \
$(CC) -c $(CFLAGS) -DNO_PROTOTYPES $(srcdir)/callfuncs.c)
$(CC) $(CFLAGS) -E $(srcdir)/compiler.c >>callfuncs.tmp
mv callfuncs.tmp callfuncs.ci
callfuncs: callfuncs.o
$(CC) $(CFLAGS) $(LDFLAGS) -o callfuncs callfuncs.o $(LIBS)
@ -310,7 +299,7 @@ just-check:
$(RUNTEST) $(RUNTESTFLAGS) --tool gdb --srcdir $(srcdir)
clean mostlyclean:
-rm -f *~ *.o a.out xgdb *.x $(EXECUTABLES) callf-info.exp
-rm -f *~ *.o a.out xgdb *.x $(EXECUTABLES) *.ci *.tmp
-rm -f core core.coremaker coremaker.core corefile
distclean realclean: clean

View file

@ -79,6 +79,7 @@ proc set_lang_c {} {
proc do_function_calls {} {
global prototypes
global gcc_compiled
gdb_test "p t_char_values(0,0)" " = 0"
gdb_test "p t_char_values('a','b')" " = 1"
@ -112,7 +113,13 @@ proc do_function_calls {} {
# Test passing of arguments which might not be widened.
gdb_test "p t_float_values2(0.0,0.0)" " = 0"
if $prototypes then {setup_xfail "*-*-*" 5318}
# Although PR 5318 mentions SunOS specifically, this seems
# to be a generic problem on all platforms except r6000.
if $prototypes then {
setup_xfail "*-*-*" 5318
clear_xfail "rs6000-*-*"
}
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"
@ -174,20 +181,27 @@ proc do_function_calls {} {
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"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "p t_structs_c(struct_val1)" "= 120 'x'" \
"call inferior func with struct - returns char"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "p t_structs_s(struct_val1)" "= 87" \
"call inferior func with struct - returns short"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "p t_structs_i(struct_val1)" "= 76" \
"call inferior func with struct - returns int"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "p t_structs_l(struct_val1)" "= 51" \
"call inferior func with struct - returns long"
setup_xfail "i*86-*-*"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "p t_structs_f(struct_val1)" "= 2.12.*" \
"call inferior func with struct - returns float"
setup_xfail "i*86-*-*"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "p t_structs_d(struct_val1)" "= 9.87.*" \
"call inferior func with struct - returns double"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "p t_structs_a(struct_val1)" "= \"foo\"" \
"call inferior func with struct - returns char *"
@ -200,7 +214,7 @@ gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $objdir/$subdir/$binfile
source gdb.base/callf-info.exp
source gdb.base/callfuncs.ci
send "set print sevenbit-strings\n" ; expect -re "$prompt $"
send "set print address off\n" ; expect -re "$prompt $"

View 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. If this proves to end 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

View file

@ -12,7 +12,7 @@
#
# 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
# 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
@ -41,6 +41,7 @@ if ![file exists $objdir/$subdir/$binfile] then {
proc integral_args {} {
global prompt
global det_file
global gcc_compiled
delete_breakpoints
@ -54,6 +55,7 @@ proc integral_args {} {
# The a29k fails all of these tests, perhaps because the prologue
# code is broken.
setup_xfail "a29k-*-udi"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_run_cmd
expect {
-re ".* call0a \\(c=97 'a', s=1, i=2, l=3\\) .*$prompt $" {
@ -65,28 +67,28 @@ proc integral_args {} {
# Print each arg as a double check to see if we can print
# them here as well as with backtrace.
gdb_test "print c" ".* = 97 'a'"
gdb_test "print s" ".* = 1"
gdb_test "print i" ".* = 2"
gdb_test "print l" ".* = 3"
gdb_test "print c" ".* = 97 'a'" "print c after run to call0a"
gdb_test "print s" ".* = 1" "print s after run to call0a"
gdb_test "print i" ".* = 2" "print i after run to call0a"
gdb_test "print l " ".* = 3" "print l after run to call0a"
# Continue; should stop at call0b and print actual arguments.
if [gdb_test "cont" ".* call0b \\(s=1, i=2, l=3, c=97 'a'\\) " "continue to call0b"] {
if [gdb_test "cont" ".* call0b \\(s=1, i=2, l=3, c=97 'a'\\) .*" "continue to call0b"] {
return
}
# Continue; should stop at call0c and print actual arguments.
if [gdb_test "cont" ".* call0c \\(i=2, l=3, c=97 'a', s=1\\) " "continue to call0c"] {
if [gdb_test "cont" ".* call0c \\(i=2, l=3, c=97 'a', s=1\\) .*" "continue to call0c"] {
return
}
# Continue; should stop at call0d and print actual arguments.
if [gdb_test "cont" ".* call0d \\(l=3, c=97 'a', s=1, i=2\\) " "continue to call0d";] {
if [gdb_test "cont" ".* call0d \\(l=3, c=97 'a', s=1, i=2\\) .*" "continue to call0d";] {
return
}
# Continue; should stop at call0e and print actual arguments.
if [gdb_test "cont" ".* call0e \\(c1=97 'a', l=3, c2=97 'a', i=2, c3=97 'a', s=1, c4=97 'a', c5=97 'a'\\) " "continue to call0e" ] {
if [gdb_test "cont" ".* call0e \\(c1=97 'a', l=3, c2=97 'a', i=2, c3=97 'a', s=1, c4=97 'a', c5=97 'a'\\) .*" "continue to call0e" ] {
return
}
}
@ -98,6 +100,7 @@ proc integral_args {} {
proc unsigned_integral_args {} {
global prompt
global det_file
global gcc_compiled
delete_breakpoints
@ -111,6 +114,7 @@ proc unsigned_integral_args {} {
# The a29k fails all of these tests, perhaps because the prologue
# code is broken.
setup_xfail "a29k-*-udi"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_run_cmd
expect {
-re ".* call1a \\(uc=98 'b', us=6, ui=7, ul=8\\) .*$prompt $" {
@ -128,22 +132,22 @@ proc unsigned_integral_args {} {
gdb_test "print ul" ".* = 8"
# Continue; should stop at call1b and print actual arguments.
if [gdb_test "cont" ".* call1b \\(us=6, ui=7, ul=8, uc=98 'b'\\) " "continue to call1b"] {
if [gdb_test "cont" ".* call1b \\(us=6, ui=7, ul=8, uc=98 'b'\\) .*" "continue to call1b"] {
return
}
# Continue; should stop at call1c and print actual arguments.
if [gdb_test "cont" ".* call1c \\(ui=7, ul=8, uc=98 'b', us=6\\) " "continue to call1c"] {
if [gdb_test "cont" ".* call1c \\(ui=7, ul=8, uc=98 'b', us=6\\) .*" "continue to call1c"] {
return
}
# Continue; should stop at call1d and print actual arguments.
if [gdb_test "cont" ".* call1d \\(ul=8, uc=98 'b', us=6, ui=7\\) " "continue to call1d"] {
if [gdb_test "cont" ".* call1d \\(ul=8, uc=98 'b', us=6, ui=7\\) .*" "continue to call1d"] {
return
}
# Continue; should stop at call1e and print actual arguments.
if [gdb_test "cont" ".* call1e \\(uc1=98 'b', ul=8, uc2=98 'b', ui=7, uc3=98 'b', us=6, uc4=98 'b', uc5=98 'b'\\) " "continue to call1e"] {
if [gdb_test "cont" ".* call1e \\(uc1=98 'b', ul=8, uc2=98 'b', ui=7, uc3=98 'b', us=6, uc4=98 'b', uc5=98 'b'\\) .*" "continue to call1e"] {
return
}
}
@ -155,6 +159,7 @@ proc unsigned_integral_args {} {
proc float_and_integral_args {} {
global prompt
global det_file
global gcc_compiled
delete_breakpoints
@ -174,6 +179,7 @@ proc float_and_integral_args {} {
# The a29k fails all of these tests, perhaps because the prologue
# code is broken.
setup_xfail "a29k-*-udi"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_run_cmd
expect {
-re ".* call2a \\(c=97 'a', f1=4, s=1, d1=5, i=2, f2=4, l=3, d2=5\\) .*$prompt $" { pass "run to call2a" }
@ -182,52 +188,54 @@ proc float_and_integral_args {} {
}
# Print each arg as a double check to see if we can print
gdb_test "print c" ".* = 97 'a'"
gdb_test "print f1" ".* = 4"
gdb_test "print s" ".* = 1"
gdb_test "print d1" ".* = 5"
gdb_test "print i" ".* = 2"
gdb_test "print f2" ".* = 4"
gdb_test "print l" ".* = 3"
gdb_test "print d2" ".* = 5"
gdb_test "print c" ".* = 97 'a'" "print c after run to call2a"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "print fl" ".* = 4" "print f1 after run to call2a"
gdb_test "print s" ".* = 1" "print s after run to call2a"
gdb_test "print d1" ".* = 5" "print d1 after run to call2a"
gdb_test "print i" ".* = 2" "print i after run to call2a"
gdb_test "print f2" ".* = 4" "print f2 after run to call2a"
gdb_test "print l" ".* = 3" "print l after run to call2a"
gdb_test "print d2" ".* = 5" "print d2 after run to call2a"
setup_xfail "rs6000-*-*"
# Continue; should stop at call2b and print actual arguments.
if [gdb_test "cont" ".* call2b \\(f1=4, s=1, d1=5, i=2, f2=4, l=3, d2=5, c=97 'a'\\) " "continue to call2b"] {
if [gdb_test "cont" ".* call2b \\(f1=4, s=1, d1=5, i=2, f2=4, l=3, d2=5, c=97 'a'\\) .*" "continue to call2b"] {
return
}
# Continue; should stop at call2c and print actual arguments.
if [gdb_test "cont" ".* call2c \\(s=1, d1=5, i=2, f2=4, l=3, d2=5, c=97 'a', f1=4\\) " "continue to call2c"] {
if [gdb_test "cont" ".* call2c \\(s=1, d1=5, i=2, f2=4, l=3, d2=5, c=97 'a', f1=4\\) .*" "continue to call2c"] {
return
}
# Continue; should stop at call2d and print actual arguments.
if [gdb_test "cont" ".* call2d \\(d1=5, i=2, f2=4, l=3, d2=5, c=97 'a', f1=4, s=1\\) " "continue to call2d"] {
if [gdb_test "cont" ".* call2d \\(d1=5, i=2, f2=4, l=3, d2=5, c=97 'a', f1=4, s=1\\) .*" "continue to call2d"] {
return
}
# Continue; should stop at call2e and print actual arguments.
if [gdb_test "cont" ".* call2e \\(i=2, f2=4, l=3, d2=5, c=97 'a', f1=4, s=1, d1=5\\) " "continue to call2e"] {
if [gdb_test "cont" ".* call2e \\(i=2, f2=4, l=3, d2=5, c=97 'a', f1=4, s=1, d1=5\\) .*" "continue to call2e"] {
return
}
# Continue; should stop at call2f and print actual arguments.
if [gdb_test "cont" ".* call2f \\(f2=4, l=3, d2=5, c=97 'a', f1=4, s=1, d1=5, i=2\\) " "continue to call2f"] {
if [gdb_test "cont" ".* call2f \\(f2=4, l=3, d2=5, c=97 'a', f1=4, s=1, d1=5, i=2\\) .*" "continue to call2f"] {
return
}
# Continue; should stop at call2g and print actual arguments.
if [gdb_test "cont" ".* call2g \\(l=3, d2=5, c=97 'a', f1=4, s=1, d1=5, i=2, f2=4\\) " "continue to call2g"] {
if [gdb_test "cont" ".* call2g \\(l=3, d2=5, c=97 'a', f1=4, s=1, d1=5, i=2, f2=4\\) .*" "continue to call2g"] {
return
}
# Continue; should stop at call2h and print actual arguments.
if [gdb_test "cont" ".* call2h \\(d2=5, c=97 'a', f1=4, s=1, d1=5, i=2, f2=4, l=3\\) " "continue to call2h"] {
if [gdb_test "cont" ".* call2h \\(d2=5, c=97 'a', f1=4, s=1, d1=5, i=2, f2=4, l=3\\) .*" "continue to call2h"] {
return
}
# Continue; should stop at call2i and print actual arguments.
if [gdb_test "cont" ".* call2i \\(c1=97 'a', f1=4, c2=97 'a', c3=97 'a', d1=5, c4=97 'a', c5=97 'a', c6=97 'a', f2=4, s=1, c7=97 'a', d2=5\\) " "continue to call2i"] {
if [gdb_test "cont" ".* call2i \\(c1=97 'a', f1=4, c2=97 'a', c3=97 'a', d1=5, c4=97 'a', c5=97 'a', c6=97 'a', f2=4, s=1, c7=97 'a', d2=5\\) .*" "continue to call2i"] {
return
}
}
@ -267,7 +275,7 @@ proc pointer_args {} {
# Continue; should stop at call3b and print actual arguments.
# Try dereferencing the arguments.
if [gdb_test "cont" ".* call3b \\(ucp=$hex \"b\", usp=$hex, uip=$hex, ulp=$hex\\) " "continue to call3b"] {
if [gdb_test "cont" ".* call3b \\(ucp=$hex \"b\", usp=$hex, uip=$hex, ulp=$hex\\) .*" "continue to call3b"] {
return
}
@ -278,7 +286,7 @@ proc pointer_args {} {
# Continue; should stop at call3c and print actual arguments.
# Try dereferencing the arguments.
if [gdb_test "cont" ".* call3c \\(fp=$hex, dp=$hex\\) " "continue to call3c"] {
if [gdb_test "cont" ".* call3c \\(fp=$hex, dp=$hex\\) .*" "continue to call3c"] {
return
}
@ -322,7 +330,7 @@ proc structs_by_reference {} {
# Continue; should stop at call4b and print actual arguments.
# Try dereferencing the arguments.
gdb_test "cont" ".* call4b \\(unp=$hex\\) " "continue to call4b"
gdb_test "cont" ".* call4b \\(unp=$hex\\) .*" "continue to call4b"
gdb_test "print *unp" ".* = \{u1 = 1, u2 = 1\}"
@ -362,7 +370,7 @@ proc structs_by_value {} {
# Continue; should stop at call5b and print actual arguments.
# Try dereferencing the arguments.
gdb_test "cont" ".* call5b \\(un=\{u1 = 2, u2 = 2\}\\) " \
gdb_test "cont" ".* call5b \\(un=\{u1 = 2, u2 = 2\}\\) .*" \
"continue to call5b"
gdb_test "print un" ".* = \{u1 = 2, u2 = 2\}"
@ -405,9 +413,10 @@ proc discard_and_shuffle {} {
timeout { fail "(timeout) run to call6a" ; return }
}
setup_xfail "rs6000-*-*"
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
.* main \\(.*\\) .*\r
$prompt $" { pass "backtrace from call6a" }
@ -427,7 +436,7 @@ $prompt $" { pass "backtrace from call6a" }
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n]+
.* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
.* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
.* main \\(.*\\) .*\r
@ -448,7 +457,7 @@ $prompt $" { pass "backtrace from call6b" }
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
.* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
.* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
@ -470,7 +479,7 @@ $prompt $" { pass "backtrace from call6c" }
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
.* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
.* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
@ -493,7 +502,7 @@ $prompt $" { pass "backtrace from call6d" }
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
.* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
.* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
@ -517,7 +526,7 @@ $prompt $" { pass "backtrace from call6e" }
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
.* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
.* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
@ -542,7 +551,7 @@ $prompt $" { pass "backtrace from call6f" }
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) .*\r
.* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
.* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
@ -568,7 +577,7 @@ $prompt $" { pass "backtrace from call6g" }
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* call6h \\(us=6, ui=7, ul=8\\) .*\r
.* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) .*\r
.* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
@ -595,7 +604,7 @@ $prompt $" { pass "backtrace from call6h" }
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* call6i \\(ui=7, ul=8\\) .*\r
.* call6h \\(us=6, ui=7, ul=8\\) .*\r
.* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) .*\r
@ -623,7 +632,7 @@ $prompt $" { pass "backtrace from call6i" }
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* call6j \\(ul=8\\) .*\r
.* call6i \\(ui=7, ul=8\\) .*\r
.* call6h \\(us=6, ui=7, ul=8\\) .*\r
@ -656,7 +665,7 @@ $prompt $" { pass "backtrace from call6j" }
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* call6k \\(\\) .*\r
.* call6j \\(ul=8\\) .*\r
.* call6i \\(ui=7, ul=8\\) .*\r
@ -684,6 +693,7 @@ proc shuffle_round_robin {} {
global hex
global decimal
global det_file
global gcc_compiled
delete_breakpoints
@ -715,9 +725,10 @@ proc shuffle_round_robin {} {
}
setup_xfail "i960-*-*" 1813
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\r
.* main \\(.*\\) .*\r
$prompt $" { pass "backtrace from call7a" }
@ -735,9 +746,10 @@ $prompt $" { pass "backtrace from call7a" }
timeout { fail "(timeout) continue to call7b" ; return }
}
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) .*\r
.* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\r
.* main \\(.*\\) .*\r
@ -758,7 +770,7 @@ $prompt $" { pass "backtrace from call7b" }
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) .*\r
.* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) .*\r
.* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\r
@ -780,7 +792,7 @@ $prompt $" { pass "backtrace from call7c" }
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) .*\r
.* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) .*\r
.* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) .*\r
@ -803,7 +815,7 @@ $prompt $" { pass "backtrace from call7d" }
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) .*\r
.* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) .*\r
.* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) .*\r
@ -827,7 +839,7 @@ $prompt $" { pass "backtrace from call7e" }
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) .*\r
.* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) .*\r
.* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) .*\r
@ -852,7 +864,7 @@ $prompt $" { pass "backtrace from call7f" }
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) .*\r
.* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) .*\r
.* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) .*\r
@ -878,7 +890,7 @@ $prompt $" { pass "backtrace from call7g" }
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\) .*\r
.* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) .*\r
.* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) .*\r
@ -905,7 +917,7 @@ $prompt $" { pass "backtrace from call7h" }
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* call7i \\(ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6\\) .*\r
.* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\) .*\r
.* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) .*\r
@ -933,7 +945,7 @@ $prompt $" { pass "backtrace from call7i" }
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* call7j \\(ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8\\) .*\r
.* call7i \\(ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6\\) .*\r
.* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\) .*\r
@ -962,7 +974,7 @@ $prompt $" { pass "backtrace from call7j" }
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* call7k \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\r
.* call7j \\(ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8\\) .*\r
.* call7i \\(ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6\\) .*\r
@ -1009,7 +1021,7 @@ proc recursive_structs_by_value {} {
setup_xfail "a29k-*-udi"
send "backtrace 100\n"
expect {
-re "backtrace 100\r
-re "backtrace 100\[\r\n\]+
.* hitbottom \\(\\) .*\r
.* recurse \\(a=\{s = 0, i = 0, l = 0\}, depth=0\\) .*\r
.* recurse \\(a=\{s = 1, i = 1, l = 1\}, depth=1\\) .*\r
@ -1052,10 +1064,14 @@ proc localvars_after_alloca { } {
# Print each arg as a double check to see if we can print
# them here as well as with backtrace.
gdb_test "print c" " = 97 'a'"
gdb_test "print s" " = 1"
gdb_test "print i" " = 2"
gdb_test "print l" " = 3"
setup_xfail "rs6000-*-*"
gdb_test "print c after runto localvars_after_alloca" " = 97 'a'"
setup_xfail "rs6000-*-*"
gdb_test "print s after runto localvars_after_alloca" " = 1"
setup_xfail "rs6000-*-*"
gdb_test "print i after runto localvars_after_alloca" " = 2"
setup_xfail "rs6000-*-*"
gdb_test "print l after runto localvars_after_alloca" " = 3"
send "next\n"
expect {
@ -1071,25 +1087,29 @@ proc localvars_after_alloca { } {
gdb_test "print i" " = 2" "print i in localvars_after_alloca"
gdb_test "print l" " = 3" "print l in localvars_after_alloca"
gdb_test "backtrace 8" "#0.*localvars_after_alloca \\(c=97 'a', s=1, i=2, l=3\\).*#1.*main" "backtrace after alloca"
gdb_test "backtrace 8" "#0.*localvars_after_alloca \\(c=97 'a', s=1, i=2, l=3\\).*#1.*main.*" "backtrace after alloca"
}
proc call_after_alloca { } {
global prompt
global hex
global decimal
global gcc_compiled
if { ! [ runto call_after_alloca_subr ] } then { return 0 }
# Print each arg as a double check to see if we can print
# them here as well as with backtrace.
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "print c" " = 97 'a'" "print c in call_after_alloca"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "print s" " = 1" "print s in call_after_alloca"
gdb_test "print i" " = 2" "print i in call_after_alloca"
gdb_test "print l" " = 3" "print l in call_after_alloca"
gdb_test "backtrace 8" "#0.*call_after_alloca_subr \\(c=97 'a', s=1, i=2, l=3, uc=98 'b', us=11, ui=12, ul=13\\).*#1.*call_after_alloca \\(c=97 'a', s=1, i=2, l=3\\).*#2.*main" "backtrace from call_after_alloca_subr"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "backtrace 8" "#0.*call_after_alloca_subr \\(c=97 'a', s=1, i=2, l=3, uc=98 'b', us=11, ui=12, ul=13\\).*#1.*call_after_alloca \\(c=97 'a', s=1, i=2, l=3\\).*#2.*main.*" "backtrace from call_after_alloca_subr"
}
#
@ -1101,6 +1121,7 @@ proc localvars_in_indirect_call { } {
global prompt
global hex
global decimal
global gcc_compiled
# Can not use "runto call0a" as call0a is called several times
# during single run. Instead stop in a marker function and
@ -1117,13 +1138,16 @@ proc localvars_in_indirect_call { } {
# Print each arg as a double check to see if we can print
# them here as well as with backtrace.
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "print c" " = 97 'a'" "print c in localvars_in_indirect_call"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "print s" " = 1" "print s in localvars_in_indirect_call"
gdb_test "print i" " = 2" "print i in localvars_in_indirect_call"
gdb_test "print l" " = 3" "print l in localvars_in_indirect_call"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "backtrace 8" \
"#0.*call0a \\(c=97 'a', s=1, i=2, l=3\\).*#1.*main" \
"#0.*call0a \\(c=97 'a', s=1, i=2, l=3\\).*#1.*main.*" \
"backtrace in indirectly called function"
#
@ -1151,7 +1175,8 @@ proc localvars_in_indirect_call { } {
default { fail "finish from indirectly called function" ; return }
}
gdb_test "step" "call0a \\(c=97 'a', s=1, i=2, l=3\\)" \
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "step" "call0a \\(c=97 'a', s=1, i=2, l=3\\).*" \
"stepping into indirectly called function"
}
@ -1186,11 +1211,11 @@ proc test_stepping_over_trampolines { } {
}
# Try to step into the target function.
gdb_test "step" "call_with_trampolines \\(d1=5\\)" \
gdb_test "step" "call_with_trampolines \\(d1=5\\).*" \
"stepping into function called with trampolines"
# Make we can backtrace and the argument looks correct. */
gdb_test "backtrace 8" "#0.*call_with_trampolines \\(d1=5\\).*1.*main" \
gdb_test "backtrace 8" "#0.*call_with_trampolines \\(d1=5\\).*1.*main.*" \
"backtrace through call with trampolines"
# Make sure we can get back to main.
@ -1221,8 +1246,7 @@ gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $objdir/$subdir/$binfile
set oldtimeout $timeout
set timeout 120
source gdb.base/funcargs.ci
integral_args
funcargs_reload
@ -1249,5 +1273,3 @@ funcargs_reload
localvars_in_indirect_call
funcargs_reload
test_stepping_over_trampolines
catch "set timeout $oldtimeout"

View file

@ -17,6 +17,8 @@ gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
source gdb.base/langs0.ci
gdb_test "b langs0" {Function "langs0" not defined\.} \
"break on nonexistent function in langs.exp"
@ -30,6 +32,7 @@ if [runto csub] then {
# because it depends on details of the compiler.
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-*-*" }
setup_xfail "i*86-*-sysv4*"
gdb_test "up" ".* in (foo|foo__Fi) .* at langs2\\.cxx.*return csub \\(.*" \
"up to foo in langs.exp"
@ -38,6 +41,7 @@ if [runto csub] then {
"show language at foo in langs.exp"
setup_xfail "i*86-*-sysv4*"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "up" ".* in cppsub_ .* at langs2\\.cxx.*return foo \\(.*" \
"up to cppsub_ in langs.exp"
setup_xfail "i*86-*-sysv4*"
@ -45,6 +49,7 @@ if [runto csub] then {
"show language at cppsub_ in langs.exp"
setup_xfail "i*86-*-sysv4*"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "up" ".* in fsub.* at langs1\\.f.*return \\(cppsub .*" \
"up to fsub in langs.exp"
setup_xfail "i*86-*-sysv4*"

View file

@ -1,5 +0,0 @@
#if defined (__GNUC__)
set gcc_compiled __GNUC__
#else
set gcc_compiled 0
#endif

View file

@ -12,7 +12,7 @@
#
# 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
# 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
@ -41,7 +41,7 @@ gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $objdir/$subdir/$binfile
source gdb.base/opaque-info.exp
source gdb.base/opaque0.ci
#
# Test basic opaque structure handling (statically).
@ -59,8 +59,8 @@ source gdb.base/opaque-info.exp
# 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.
# XCOFF does not seem to support it either. See the very end of gcc/xcoffout.h.
# 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.
@ -68,80 +68,54 @@ source gdb.base/opaque-info.exp
proc setup_xfail_on_opaque_pointer {} {
global gcc_compiled
setup_xfail "rs6000-*-*" "a29k-*-udi" "vax-*-*" "i*86-sequent-bsd*"
setup_xfail "a29k-*-udi" "vax-*-*" "i*86-sequent-bsd*"
if {!$gcc_compiled} then {
setup_xfail "alpha-*-*"
}
}
setup_xfail_on_opaque_pointer
send "whatis foop\n"
expect {
-re "whatis foop\r
type = struct foo \[*\]+\r
$prompt $" { pass "whatis on opaque struct pointer (statically)"}
-re ".*$prompt $" { fail "whatis on opaque struct *" }
timeout { fail "(timeout) whatis on opaque struct *" }
# 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
send "ptype foop\n"
expect {
-re "ptype foop\r
type = struct foo \{\r
int a;\r
int b;\r
\} \[*\]+\r
$prompt $" { pass "ptype on opaque struct pointer (statically)" }
-re ".*$prompt $" { fail "ptype on opaque struct *" }
timeout { fail "(timeout) ptype on opaque struct *" }
}
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
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.
send "whatis afoo\n"
expect {
-re "whatis afoo\r
type = struct foo\r
$prompt $" { pass "whatis on opaque struct instance (statically)" }
-re ".*$prompt $" { fail "whatis on opaque struct" }
timeout { fail "(timeout) whatis on opaque struct" }
}
gdb_test "whatis afoo" \
"type = struct foo" \
"whatis on opaque struct instance (statically)"
# Ensure that we know the form of "afoo".
send "ptype afoo\n"
expect {
-re "ptype afoo\r
type = struct foo \{\r
int a;\r
int b;\r
\}\r
$prompt $" { pass "ptype on opaque struct instance (statically)" }
-re ".*$prompt $" { fail "ptype on opaque struct instance" }
timeout { fail "(timeout) ptype on opaque struct" }
}
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.
send "ptype struct foo\n"
expect {
-re "ptype struct foo\r
type = struct foo \{\r
int a;\r
int b;\r
\}\r
$prompt $" { pass "ptype on opaque struct tagname (statically)" }
-re ".*$prompt $" { fail "ptype on opaque struct" }
timeout { fail "(timeout) ptype on opaque struct" }
}
gdb_test "ptype struct foo" \
"type = struct foo \{\r\n int a;\r\n int b;\r\n\}" \
"ptype on opaque struct tagname (statically)"
#
@ -159,7 +133,7 @@ gdb_reinitialize_dir $srcdir/$subdir
gdb_load $objdir/$subdir/$binfile
# Run to main, where struct foo is incomplete.
if ![runto main] {
if ![runto_main] {
perror "cannot run to breakpoint at main"
}
@ -169,70 +143,37 @@ if ![runto main] {
# the opaque structure in the current file. Ensure we know it's type.
setup_xfail_on_opaque_pointer
send "whatis foop\n"
expect {
-re "whatis foop\r
type = struct foo \[*\]+\r
$prompt $" { pass "whatis on opaque struct pointer (dynamically)"}
-re ".*$prompt $" { fail "whatis on opaque struct pointer" }
timeout { fail "(timeout) whatis on opaque struct ptr" }
}
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
send "ptype foop\n"
expect {
-re "ptype foop\r
type = struct foo \{\r
int a;\r
int b;\r
\} \[*\]+\r
$prompt $" { pass "ptype on opaque struct pointer (dynamically)" }
-re ".*$prompt $" { fail "ptype on opaque struct *" }
timeout { fail "(timeout) ptype on opaque struct *" }
}
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "ptype foop" \
"type = struct foo \{\r\n int a;\r\n int b;\r\n\} \[*\]+" \
"ptype on opaque struct pointer (dynamically) 1"
send "whatis afoo\n"
expect {
-re "whatis afoo\r
type = struct foo\r
$prompt $" { pass "whatis on opaque struct instance (dynamically)" }
-re ".*$prompt $" { fail "whatis on opaque struct" }
timeout { fail "(timeout) whatis on opaque struct" }
}
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.
send "ptype afoo\n"
expect {
-re "ptype afoo\r
type = struct foo \{\r
int a;\r
int b;\r
\}\r
$prompt $" { pass "ptype on opaque struct instance (dynamically)" }
-re ".*$prompt $" { fail "ptype on opaque struct instance" }
timeout { fail "(timeout) ptype on opaque struct" }
}
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.
send "ptype struct foo\n"
expect {
-re "ptype struct foo\r
type = struct foo \{\r
int a;\r
int b;\r
\}\r
$prompt $" { pass "ptype on opaque struct tagname (dynamically)" }
-re ".*$prompt $" { fail "ptype on opaque struct" }
timeout { fail "(timeout) ptype on opaque struct" }
}
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
@ -255,67 +196,33 @@ if ![runto getfoo] {
# Ensure that we know what foop is.
setup_xfail_on_opaque_pointer
send "whatis foop\n"
expect {
-re "whatis foop\r
type = struct foo \[*\]+\r
$prompt $" { pass "whatis on opaque struct pointer (dynamically)"}
-re ".*$prompt $" { fail "whatis on opaque struct pointer" }
timeout { fail "(timeout) whatis on opaque struct ptr" }
}
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
send "ptype foop\n"
expect {
-re "ptype foop\r
type = struct foo \{\r
int a;\r
int b;\r
\} \[*\]+\r
$prompt $" { pass "ptype on opaque struct pointer (dynamically)" }
-re ".*$prompt $" { fail "ptype on opaque struct *" }
timeout { fail "(timeout) ptype on opaque struct *" }
}
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "ptype foop" \
"type = struct foo \{\r\n int a;\r\n int b;\r\n\} \[*\]+" \
"ptype on opaque struct pointer (dynamically) 2"
send "whatis afoo\n"
expect {
-re "whatis afoo\r
type = struct foo\r
$prompt $" { pass "whatis on opaque struct instance (dynamically)" }
-re ".*$prompt $" { fail "whatis on opaque struct" }
timeout { fail "(timeout) whatis on opaque struct" }
}
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.
send "ptype afoo\n"
expect {
-re "ptype afoo\r
type = struct foo \{\r
int a;\r
int b;\r
\}\r
$prompt $" { pass "ptype on opaque struct instance (dynamically)" }
-re ".*$prompt $" { fail "ptype on opaque struct instance" }
timeout { fail "(timeout) ptype on opaque struct" }
}
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.
send "ptype struct foo\n"
expect {
-re "ptype struct foo\r
type = struct foo \{\r
int a;\r
int b;\r
\}\r
$prompt $" { pass "ptype on opaque struct tagname (dynamically)" }
-re ".*$prompt $" { fail "ptype on opaque struct" }
timeout { fail "(timeout) ptype on opaque struct" }
}
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"

View file

@ -34,6 +34,8 @@ if ![file exists $objdir/$subdir/$binfile] then {
return 0
}
source gdb.base/scope0.ci
# Test locating various things when stopped just inside main, after
# running init(). To prevent cascading of errors, we report the
# first one and quit. If all pass, then we print the pass results.
@ -44,6 +46,7 @@ proc test_at_main {} {
global det_file
global srcdir
global subdir
global gcc_compiled
# skip past init. There may be a call to __main at the start of
# main, so the first next may only get us to the init call.
@ -69,8 +72,6 @@ proc test_at_main {} {
}
}
# The RS/6000 does not seem to be handle print 'file'::var.
setup_xfail "rs6000-*-*"
send "print 'scope0.c'::filelocal\n"
expect {
-re "\\\$$decimal = 1\r\n$prompt $" {
@ -99,7 +100,6 @@ proc test_at_main {} {
}
}
setup_xfail "rs6000-*-*"
send "print 'scope0.c'::filelocal_bss\n"
expect {
-re "\\\$$decimal = 101\r\n$prompt $" {
@ -122,16 +122,23 @@ proc test_at_main {} {
# No clue why the powerpc fails this test.
setup_xfail "powerpc-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print filelocal_ro\n"
expect {
-re "\\\$$decimal = 201\r\n$prompt $" { pass "print filelocal_ro" }
-re "$prompt $" { fail "print filelocal_ro" ; return }
-re "\\\$$decimal = 201\r\n$prompt $" {
pass "print filelocal_ro in test_at_main"
}
-re "$prompt $" {
fail "print filelocal_ro in test_at_main"
return
}
timeout {
fail "(timeout) print filelocal_ro" ; return
fail "(timeout) print filelocal_ro in test_at_main"
return
}
}
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
setup_xfail "powerpc-*-*"
send "print 'scope0.c'::filelocal_ro\n"
expect {
@ -150,7 +157,7 @@ proc test_at_main {} {
# Print scope1.c::filelocal, which is 2
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::filelocal\n"
expect {
-re "\\\$$decimal = 2\r\n$prompt $" {
@ -168,7 +175,7 @@ proc test_at_main {} {
# Print scope1.c::filelocal_bss, which is 102
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::filelocal_bss\n"
expect {
-re "\\\$$decimal = 102\r\n$prompt $" {
@ -186,7 +193,7 @@ proc test_at_main {} {
# Print scope1.c::filelocal_ro, which is 202
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::filelocal_ro\n"
expect {
-re "\\\$$decimal = 202\r\n$prompt $" {
@ -213,7 +220,7 @@ proc test_at_main {} {
}
}
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::foo::funclocal\n"
expect {
-re "\\\$$decimal = 3\r\n$prompt $" {
@ -242,7 +249,7 @@ proc test_at_main {} {
}
}
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::foo::funclocal_ro\n"
expect {
-re "\\\$$decimal = 203\r\n$prompt $" {
@ -268,7 +275,7 @@ proc test_at_main {} {
}
}
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::bar::funclocal\n"
expect {
-re "\\\$$decimal = 4\r\n$prompt $" {
@ -291,6 +298,7 @@ proc test_at_foo {} {
global det_file
global srcdir
global subdir
global gcc_compiled
send "next\n"
expect {
@ -301,7 +309,6 @@ proc test_at_foo {} {
# Print scope0.c::filelocal, which is 1
setup_xfail "rs6000-*-*"
send "print 'scope0.c'::filelocal\n"
expect {
-re "\\\$$decimal = 1\r\n$prompt $" {
@ -319,7 +326,6 @@ proc test_at_foo {} {
# Print scope0.c::filelocal_bss, which is 101
setup_xfail "rs6000-*-*"
send "print 'scope0.c'::filelocal_bss\n"
expect {
-re "\\\$$decimal = 101\r\n$prompt $" {
@ -341,7 +347,7 @@ proc test_at_foo {} {
# Print scope0.c::filelocal_ro, which is 201
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
setup_xfail "powerpc-*-*"
send "print 'scope0.c'::filelocal_ro\n"
expect {
@ -360,7 +366,7 @@ proc test_at_foo {} {
# Print scope1.c::filelocal, which is 2
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::filelocal\n"
expect {
-re "\\\$$decimal = 2\r\n$prompt $" {
@ -379,7 +385,7 @@ proc test_at_foo {} {
gdb_test "print filelocal_bss" "\\\$$decimal = 102" \
"print filelocal_bss at foo"
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::filelocal_bss\n"
expect {
-re "\\\$$decimal = 102\r\n$prompt $" {
@ -398,7 +404,7 @@ proc test_at_foo {} {
gdb_test "print filelocal_ro" "\\\$$decimal = 202" \
"print filelocal_ro at foo"
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::filelocal_ro\n"
expect {
-re "\\\$$decimal = 202\r\n$prompt $" { pass "print 'scope1.c'::filelocal_ro at foo" }
@ -419,7 +425,7 @@ proc test_at_foo {} {
gdb_test "print foo::funclocal" "\\\$$decimal = 3" \
"print foo::funclocal at foo"
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::foo::funclocal\n"
expect {
-re "\\\$$decimal = 3\r\n$prompt $" {
@ -443,7 +449,7 @@ proc test_at_foo {} {
gdb_test "print foo::funclocal_bss" "\\\$$decimal = 103" \
"print foo::funclocal_bss at foo"
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::foo::funclocal_bss\n"
expect {
-re "\\\$$decimal = 103\r\n$prompt $" {
@ -469,7 +475,7 @@ proc test_at_foo {} {
gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203" \
"print foo::funclocal_ro at foo"
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::foo::funclocal_ro\n"
expect {
-re "\\\$$decimal = 203\r\n$prompt $" {
@ -490,7 +496,7 @@ proc test_at_foo {} {
gdb_test "print bar::funclocal" "\\\$$decimal = 4" \
"print bar::funclocal at foo"
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::bar::funclocal\n"
expect {
-re "\\\$$decimal = 4\r\n$prompt $" {
@ -513,6 +519,7 @@ proc test_at_bar {} {
global det_file
global srcdir
global subdir
global gcc_compiled
send "next\n"
expect {
@ -522,7 +529,6 @@ proc test_at_bar {} {
# Print scope0.c::filelocal, which is 1
setup_xfail "rs6000-*-*"
send "print 'scope0.c'::filelocal\n"
expect {
-re "\\\$$decimal = 1\r\n$prompt $" {
@ -540,7 +546,6 @@ proc test_at_bar {} {
# Print scope0.c::filelocal_bss, which is 101
setup_xfail "rs6000-*-*"
send "print 'scope0.c'::filelocal_bss\n"
expect {
-re "\\\$$decimal = 101\r\n$prompt $" {
@ -562,7 +567,7 @@ proc test_at_bar {} {
# Print scope0.c::filelocal_ro, which is 201
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
setup_xfail "powerpc-*-*"
send "print 'scope0.c'::filelocal_ro\n"
expect {
@ -588,7 +593,7 @@ proc test_at_bar {} {
}
}
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::filelocal\n"
expect {
-re "\\\$$decimal = 2\r\n$prompt $" { pass "print 'scope1.c'::filelocal" }
@ -613,7 +618,7 @@ proc test_at_bar {} {
}
}
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::filelocal_bss\n"
expect {
-re "\\\$$decimal = 102\r\n$prompt $" { pass "print 'scope1.c'::filelocal_bss" }
@ -631,14 +636,20 @@ proc test_at_bar {} {
send "print filelocal_ro\n"
expect {
-re "\\\$$decimal = 202\r\n$prompt $" { pass "print filelocal_ro" }
-re "$prompt $" { fail "print filelocal_ro" ; return }
-re "\\\$$decimal = 202\r\n$prompt $" {
pass "print filelocal_ro in test_at_bar"
}
-re "$prompt $" {
fail "print filelocal_ro in test_at_bar"
return
}
timeout {
fail "(timeout) print filelocal_ro" ; return
fail "(timeout) print filelocal_ro in test_at_bar"
return
}
}
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::filelocal_ro\n"
expect {
-re "\\\$$decimal = 202\r\n$prompt $" { pass "print 'scope1.c'::filelocal_ro" }
@ -663,7 +674,7 @@ proc test_at_bar {} {
}
}
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::foo::funclocal\n"
expect {
-re "\\\$$decimal = 3\r\n$prompt $" { pass "print 'scope1.c'::foo::funclocal" }
@ -688,7 +699,7 @@ proc test_at_bar {} {
}
}
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::foo::funclocal_bss\n"
expect {
-re "\\\$$decimal = 103\r\n$prompt $" { pass "print 'scope1.c'::foo::funclocal_bss" }
@ -713,7 +724,7 @@ proc test_at_bar {} {
}
}
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::foo::funclocal_ro\n"
expect {
-re "\\\$$decimal = 203\r\n$prompt $" { pass "print 'scope1.c'::foo::funclocal_ro" }
@ -747,7 +758,7 @@ proc test_at_bar {} {
}
}
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::bar::funclocal\n"
expect {
-re "\\\$$decimal = 4\r\n$prompt $" { pass "print 'scope1.c'::bar::funclocal" }
@ -781,7 +792,7 @@ proc test_at_bar {} {
}
}
setup_xfail "rs6000-*-*"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::bar::funclocal_bss\n"
expect {
-re "\\\$$decimal = 104\r\n$prompt $" { pass "print 'scope1.c'::bar::funclocal_bss" }
@ -923,6 +934,7 @@ gdb_test "print 'scope0.c'::filelocal_ro" "= 201"
# gdb currently cannot access bss memory on some targets if the inferior
# is not running.
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope0.c'::filelocal_bss\n"
expect {
-re " = 0\r\n$prompt $" {

View file

@ -1,15 +0,0 @@
/* This needs to be kept in sync with whatis.c. If this proves to end 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

View file

@ -43,7 +43,7 @@ gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $objdir/$subdir/$binfile
source gdb.base/whatis-info.exp
source gdb.base/whatis.ci
# If we did not use the signed keyword when compiling the file, don't
# expect GDB to know that char is signed.