+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.
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
callfuncs.c
callfuncs.exp
commands.exp
+compiler.c
configure.in
corefile.exp
coremaker.c
mips_pro.exp
nodebug.c
nodebug.exp
-opaque-info.c
opaque.exp
opaque0.c
opaque1.c
twice.exp
watchpoint.c
watchpoint.exp
-whatis-info.c
whatis.c
whatis.exp
# 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
mips_pro \
nodebug \
opaque \
- opaque-info.exp \
printcmds \
ptype \
recurse \
twice \
watchpoint \
whatis \
- whatis-info.exp \
$(CROSS_EXECUTABLES)
# List of test executables that we have available. They are kept in
.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-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
+whatis: whatis.o
+ $(CC) $(CFLAGS) $(LDFLAGS) -o whatis whatis.o $(LIBS)
-.PRECIOUS: whatis whatis-info.exp
+.PRECIOUS: whatis
ptype: ptype.o
$(CC) $(CFLAGS) $(LDFLAGS) -o ptype ptype.o $(LIBS)
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)
# 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)
$(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
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"
# 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"
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 *"
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 $"
--- /dev/null
+/* 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
#
# 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
proc integral_args {} {
global prompt
global det_file
+ global gcc_compiled
delete_breakpoints
# 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 $" {
# 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
}
}
proc unsigned_integral_args {} {
global prompt
global det_file
+ global gcc_compiled
delete_breakpoints
# 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 $" {
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
}
}
proc float_and_integral_args {} {
global prompt
global det_file
+ global gcc_compiled
delete_breakpoints
# 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" }
}
# 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
}
}
# 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
}
# 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
}
# 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\}"
# 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\}"
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" }
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
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
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
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
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
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
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
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
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
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
global hex
global decimal
global det_file
+ global gcc_compiled
delete_breakpoints
}
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" }
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
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
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
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
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
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
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
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
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
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
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
# 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 {
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"
}
#
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
# 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"
#
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"
}
}
# 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.
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
localvars_in_indirect_call
funcargs_reload
test_stepping_over_trampolines
-
-catch "set timeout $oldtimeout"
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"
# 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"
"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*"
"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*"
+++ /dev/null
-#if defined (__GNUC__)
-set gcc_compiled __GNUC__
-#else
-set gcc_compiled 0
-#endif
#
# 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
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).
# 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.
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)"
#
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"
}
# 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
# 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"
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.
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.
}
}
- # 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 $" {
}
}
- setup_xfail "rs6000-*-*"
send "print 'scope0.c'::filelocal_bss\n"
expect {
-re "\\\$$decimal = 101\r\n$prompt $" {
# 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 {
# 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 $" {
# 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 $" {
# 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 $" {
}
}
- setup_xfail "rs6000-*-*"
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::foo::funclocal\n"
expect {
-re "\\\$$decimal = 3\r\n$prompt $" {
}
}
- 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 $" {
}
}
- setup_xfail "rs6000-*-*"
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send "print 'scope1.c'::bar::funclocal\n"
expect {
-re "\\\$$decimal = 4\r\n$prompt $" {
global det_file
global srcdir
global subdir
+ global gcc_compiled
send "next\n"
expect {
# Print scope0.c::filelocal, which is 1
- setup_xfail "rs6000-*-*"
send "print 'scope0.c'::filelocal\n"
expect {
-re "\\\$$decimal = 1\r\n$prompt $" {
# 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 $" {
# 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 {
# 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 $" {
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 $" {
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" }
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 $" {
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 $" {
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 $" {
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 $" {
global det_file
global srcdir
global subdir
+ global gcc_compiled
send "next\n"
expect {
# Print scope0.c::filelocal, which is 1
- setup_xfail "rs6000-*-*"
send "print 'scope0.c'::filelocal\n"
expect {
-re "\\\$$decimal = 1\r\n$prompt $" {
# 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 $" {
# 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 {
}
}
- 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" }
}
}
- 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" }
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" }
}
}
- 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" }
}
}
- 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" }
}
}
- 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" }
}
}
- 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" }
}
}
- 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" }
# 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 $" {
+++ /dev/null
-/* 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
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.